Skip to content

Commit

Permalink
Merge pull request #120 from sergey-tihon/mono5
Browse files Browse the repository at this point in the history
Mono5 support
  • Loading branch information
vasily-kirichenko committed May 12, 2017
2 parents 66cb83d + 85e6cc0 commit 3adc08d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion FSharp.Configuration.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<summary>@summary@</summary>
<description>@description@</description>
<releaseNotes>@releaseNotes@</releaseNotes>
<copyright>Copyright 2015</copyright>
<copyright>Copyright 2017</copyright>
<tags>@tags@</tags>
<dependencies />
</metadata>
Expand Down
4 changes: 2 additions & 2 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NUGET
Argu (>= 3.7)
FSharp.Core (>= 3.1.2.5)
Mono.Cecil (>= 0.9.6.4)
FAKE (4.58.6)
FAKE (4.61.2)
FSharp.Compiler.Service (2.0.0.6)
FSharp.Core (4.0.0.1)
FSharp.Formatting (2.14.4)
Expand All @@ -21,5 +21,5 @@ NUGET
SourceLink.Fake (1.1)
GITHUB
remote: fsharp/FAKE
modules/Octokit/Octokit.fsx (d009fd212e9773e155e958c5d12f61c39022de5d)
modules/Octokit/Octokit.fsx (43917109af4ef38194d8993215c3e7c862b19d36)
Octokit (>= 0.20)
22 changes: 17 additions & 5 deletions src/FSharp.Configuration/ProvidedTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,29 @@ module P = Quotations.Patterns
module ES = Quotations.ExprShape
module DP = Quotations.DerivedPatterns

type internal ExpectedStackState =
type internal ExpectedStackState =
| Empty = 1
| Address = 2
| Value = 3

[<AutoOpen>]
module internal Misc =
let TypeBuilderInstantiationType =
let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e -> false
let typeName = if runningOnMono then "System.Reflection.MonoGenericClass" else "System.Reflection.Emit.TypeBuilderInstantiation"
typeof<TypeBuilder>.Assembly.GetType(typeName)
// TypeBuilderInstantiation should really be a public type, since we
// have to use alternative means for various Method/Field/Constructor lookups on this kind of type.
// Also, on Mono 3.x and 4.x this type had a different name.
let TypeBuilderInstantiationType =
let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e-> false
let ty =
if runningOnMono then
let ty = Type.GetType("System.Reflection.MonoGenericClass")
match ty with
| null -> Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")
| _ -> ty
else
Type.GetType("System.Reflection.Emit.TypeBuilderInstantiation")

ty

let GetTypeFromHandleMethod = typeof<Type>.GetMethod("GetTypeFromHandle")
let LanguagePrimitivesType = typedefof<list<_>>.Assembly.GetType("Microsoft.FSharp.Core.LanguagePrimitives")
let ParseInt32Method = LanguagePrimitivesType.GetMethod "ParseInt32"
Expand Down

0 comments on commit 3adc08d

Please sign in to comment.