Skip to content

Commit 7a8aa63

Browse files
nosamidsyme
authored andcommitted
Changes to make the build work with Mono 4.9+ (dotnet#2707)
Mono changed Looks like the problem is due to this commit to Mono mono/mono@efd53c8 Mono's internal System.Reflection.Emit.MonoGenericClass was renamed to System.Reflection.Emit.TypeBuilderInstantiation That broke the workaround in https://github.com/fsharp/fsharp/blob/5a942daf930d7023c78f578ec6876b86a6f13f1e/src/absil/ilreflect.fs#L619-L623 .
1 parent 91da9db commit 7a8aa63

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/absil/ilreflect.fs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,18 @@ let convFieldInit x =
616616
// it isn't we resort to this technique...
617617
let TypeBuilderInstantiationT =
618618
let ty =
619+
Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
619620
#if ENABLE_MONO_SUPPORT
620-
if runningOnMono then
621+
let ty =
622+
if runningOnMono && (isNull ty) then
621623
Type.GetType("System.Reflection.MonoGenericClass")
622624
else
625+
ty
623626
#endif
624-
Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
625627
assert (not (isNull ty))
626628
ty
627629

628-
let typeIsNotQueryable (typ : Type) =
630+
let typeIsNotQueryable (typ : Type) =
629631
#if FX_RESHAPED_REFLECTION
630632
let typ = typ.GetTypeInfo()
631633
#endif

src/scripts/fssrgen.fsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
2-
32
let PrintErr(filename, line, msg) =
43
printfn "%s(%d): error : %s" filename line msg
54

@@ -9,7 +8,7 @@ let Err(filename, line, msg) =
98
printfn "# comment"
109
printfn "ident,\"string\""
1110
printfn "errNum,ident,\"string\""
12-
failwithf "there were errors in the file '%s'" filename
11+
failwith (sprintf "there were errors in the file '%s'" filename)
1312

1413
let xmlBoilerPlateString = @"<?xml version=""1.0"" encoding=""utf-8""?>
1514
<root>
@@ -470,4 +469,4 @@ let Main args =
470469
1
471470

472471
printfn "fssrgen: args = %A" fsi.CommandLineArgs
473-
Main fsi.CommandLineArgs
472+
Main fsi.CommandLineArgs

0 commit comments

Comments
 (0)