diff --git a/FSharp.Compiler.Service.sln b/FSharp.Compiler.Service.sln
index 0f0d871b018..3348e46ca41 100644
--- a/FSharp.Compiler.Service.sln
+++ b/FSharp.Compiler.Service.sln
@@ -5,9 +5,15 @@ VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{A59DB8AE-8044-41A5-848A-800A7FF31C93}"
EndProject
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{8D9C9683-5041-48AB-8FA9-0939D2D27D33}"
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{8D9C9683-5041-48AB-8FA9-0939D2D27D33}"
EndProject
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DependencyManager.Nuget", "src\fsharp\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{98E7659D-8E0C-489F-B4F5-E12AFC0D1BFA}"
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager.Nuget", "src\fsharp\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{98E7659D-8E0C-489F-B4F5-E12AFC0D1BFA}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FSharp.Compiler.Service.Tests support", "FSharp.Compiler.Service.Tests support", "{875D91AC-BA4C-4191-AB11-AE461DB9B8DB}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp_Analysis", "tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj", "{BFE6E6F1-1B73-404F-A3A5-30B57E5E0731}"
+EndProject
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestTP", "tests\service\data\TestTP\TestTP.fsproj", "{2EF674B9-8B56-4796-9933-42B2629E52C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,10 +33,22 @@ Global
{98E7659D-8E0C-489F-B4F5-E12AFC0D1BFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98E7659D-8E0C-489F-B4F5-E12AFC0D1BFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98E7659D-8E0C-489F-B4F5-E12AFC0D1BFA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2EF674B9-8B56-4796-9933-42B2629E52C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2EF674B9-8B56-4796-9933-42B2629E52C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2EF674B9-8B56-4796-9933-42B2629E52C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2EF674B9-8B56-4796-9933-42B2629E52C3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {BFE6E6F1-1B73-404F-A3A5-30B57E5E0731} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
+ {2EF674B9-8B56-4796-9933-42B2629E52C3} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
+ EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F9A60F3B-D894-4C8E-BA0F-C51115B25A5A}
EndGlobalSection
diff --git a/FSharp.sln b/FSharp.sln
index da837f9b04f..bcbb76848ae 100644
--- a/FSharp.sln
+++ b/FSharp.sln
@@ -60,6 +60,18 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tes
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{9B4CF83C-C215-4EA0-9F8B-B5A77090F634}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FSharp.Compiler.Service.Tests support", "FSharp.Compiler.Service.Tests support", "{452EED3C-AA87-471F-B9AC-0F4479C5820C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp_Analysis", "tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj", "{F8743670-C8D4-41B3-86BE-BBB1226C352F}"
+EndProject
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestTP", "tests\service\data\TestTP\TestTP.fsproj", "{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{E02ADBCA-D6C0-4898-A8AA-86DE6EBE2DC2}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroPerfCSharp", "tests\benchmarks\MicroPerf\CS\MicroPerfCSharp.csproj", "{2904313F-7782-4522-894C-DC946DFFE22D}"
+EndProject
+Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmarks\MicroPerf\MicroPerf.fsproj", "{C888A81D-2372-4B4A-8BA1-525AEE3918D6}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -298,6 +310,54 @@ Global
{9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|Any CPU.Build.0 = Release|Any CPU
{9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|x86.ActiveCfg = Release|Any CPU
{9B4CF83C-C215-4EA0-9F8B-B5A77090F634}.Release|x86.Build.0 = Release|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Debug|x86.Build.0 = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Proto|Any CPU.Build.0 = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Proto|x86.ActiveCfg = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Proto|x86.Build.0 = Debug|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Release|x86.ActiveCfg = Release|Any CPU
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F}.Release|x86.Build.0 = Release|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Debug|x86.Build.0 = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Proto|Any CPU.Build.0 = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Proto|x86.ActiveCfg = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Proto|x86.Build.0 = Debug|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.ActiveCfg = Release|Any CPU
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.Build.0 = Release|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Debug|x86.Build.0 = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Proto|Any CPU.Build.0 = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Proto|x86.ActiveCfg = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Proto|x86.Build.0 = Debug|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Release|x86.ActiveCfg = Release|Any CPU
+ {2904313F-7782-4522-894C-DC946DFFE22D}.Release|x86.Build.0 = Release|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Debug|x86.Build.0 = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Proto|Any CPU.Build.0 = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Proto|x86.ActiveCfg = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Proto|x86.Build.0 = Debug|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Release|x86.ActiveCfg = Release|Any CPU
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -324,6 +384,11 @@ Global
{25568CD2-E654-4C8F-BE5B-59BABFC5BD20} = {07482B5E-4980-4285-B732-820F15870284}
{DDFD06DC-D7F2-417F-9177-107764EEBCD8} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{9B4CF83C-C215-4EA0-9F8B-B5A77090F634} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
+ {452EED3C-AA87-471F-B9AC-0F4479C5820C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
+ {F8743670-C8D4-41B3-86BE-BBB1226C352F} = {452EED3C-AA87-471F-B9AC-0F4479C5820C}
+ {7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F} = {452EED3C-AA87-471F-B9AC-0F4479C5820C}
+ {2904313F-7782-4522-894C-DC946DFFE22D} = {E02ADBCA-D6C0-4898-A8AA-86DE6EBE2DC2}
+ {C888A81D-2372-4B4A-8BA1-525AEE3918D6} = {E02ADBCA-D6C0-4898-A8AA-86DE6EBE2DC2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8}
diff --git a/VisualFSharp.sln b/VisualFSharp.sln
index 4ab8ee853dc..d35c1ba10b9 100644
--- a/VisualFSharp.sln
+++ b/VisualFSharp.sln
@@ -157,6 +157,10 @@ EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{B5A9BBD9-2F45-4722-A6CA-BAE3C64CD4E2}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{14F3D3D6-5C8E-43C2-98A2-17EA704D4DEA}"
+ ProjectSection(ProjectDependencies) = postProject
+ {FF76BD3C-5E0A-4752-B6C3-044F6E15719B} = {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}
+ {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} = {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}
+ EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpDebug", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpDebug.csproj", "{A422D673-8E3B-4924-821B-DD3174173426}"
EndProject
diff --git a/eng/Versions.props b/eng/Versions.props
index 21424130395..49ed9028652 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -87,7 +87,7 @@
4.3.0
4.5.4
4.3.0
- 4.3.0
+ 4.3.1
4.3.0
5.0.0
4.3.0
@@ -95,7 +95,6 @@
4.3.0
4.3.0
4.3.0
- 4.3.0
4.3.0
4.3.0
4.3.0
diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs
index 10e4807a72d..b14c995f86e 100644
--- a/src/fsharp/CheckExpressions.fs
+++ b/src/fsharp/CheckExpressions.fs
@@ -10158,12 +10158,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (bindingTy, m, syn
match dispatchSlotsArityMatch with
| meths when methInfosEquivByNameAndSig meths -> meths
| [] ->
- let details =
- slots
- |> Seq.map (NicePrint.stringOfMethInfo cenv.infoReader m envinner.DisplayEnv)
- |> Seq.map (sprintf "%s %s" System.Environment.NewLine)
- |> String.concat ""
-
+ let details = NicePrint.multiLineStringOfMethInfos cenv.infoReader m envinner.DisplayEnv slots
errorR(Error(FSComp.SR.tcOverrideArityMismatch details, memberId.idRange))
[]
| _ -> [] // check that method to override is sealed is located at CheckOverridesAreAllUsedOnce (typrelns.fs)
diff --git a/src/fsharp/CompilerConfig.fs b/src/fsharp/CompilerConfig.fs
index 0bdc81698c5..a98fb573140 100644
--- a/src/fsharp/CompilerConfig.fs
+++ b/src/fsharp/CompilerConfig.fs
@@ -201,12 +201,17 @@ type TimeStampCache(defaultTimeStamp: DateTime) =
projects.[pr] <- v
v
+and []
+ ProjectAssemblyDataResult =
+ | Available of IRawFSharpAssemblyData
+ | Unavailable of useOnDiskInstead: bool
+
and IProjectReference =
/// The name of the assembly file generated by the project
abstract FileName: string
/// Evaluate raw contents of the assembly file generated by the project
- abstract EvaluateRawContents: unit -> NodeCode
+ abstract EvaluateRawContents: unit -> NodeCode
/// Get the logical timestamp that would be the timestamp of the assembly file generated by the project
///
diff --git a/src/fsharp/CompilerConfig.fsi b/src/fsharp/CompilerConfig.fsi
index acb5f140b3d..41f347e4528 100644
--- a/src/fsharp/CompilerConfig.fsi
+++ b/src/fsharp/CompilerConfig.fsi
@@ -63,13 +63,20 @@ type TimeStampCache =
member GetFileTimeStamp: string -> DateTime
member GetProjectReferenceTimeStamp: IProjectReference -> DateTime
+and []
+ ProjectAssemblyDataResult =
+ | Available of IRawFSharpAssemblyData
+ | Unavailable of useOnDiskInstead: bool
+
and IProjectReference =
/// The name of the assembly file generated by the project
abstract FileName: string
- /// Evaluate raw contents of the assembly file generated by the project
- abstract EvaluateRawContents: unit -> NodeCode
+ /// Evaluate raw contents of the assembly file generated by the project.
+ /// 'None' may be returned if an in-memory view of the contents is, for some reason,
+ /// not available. In this case the on-disk view of the contents will be preferred.
+ abstract EvaluateRawContents: unit -> NodeCode
/// Get the logical timestamp that would be the timestamp of the assembly file generated by the project.
///
diff --git a/src/fsharp/CompilerImports.fs b/src/fsharp/CompilerImports.fs
index 82b55aaff7e..4e25796592f 100644
--- a/src/fsharp/CompilerImports.fs
+++ b/src/fsharp/CompilerImports.fs
@@ -1635,19 +1635,20 @@ and [] TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAsse
| Some ilb ->
return! ilb.EvaluateRawContents()
| None ->
- return None
+ return ProjectAssemblyDataResult.Unavailable true
}
// If we have a project reference but did not get any valid contents,
// just return None and do not attempt to read elsewhere.
- if contentsOpt.IsNone && r.ProjectReference.IsSome then
+ match contentsOpt with
+ | ProjectAssemblyDataResult.Unavailable false ->
return None
- else
+ | _ ->
let assemblyData =
match contentsOpt with
- | Some ilb -> ilb
- | None ->
+ | ProjectAssemblyDataResult.Available ilb -> ilb
+ | ProjectAssemblyDataResult.Unavailable _ ->
let ilModule, ilAssemblyRefs = tcImports.OpenILBinaryModule(ctok, filename, m)
RawFSharpAssemblyDataBackedByFileOnDisk (ilModule, ilAssemblyRefs) :> IRawFSharpAssemblyData
diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs
index 609ab4c202f..2ff48082fa5 100644
--- a/src/fsharp/DetupleArgs.fs
+++ b/src/fsharp/DetupleArgs.fs
@@ -715,7 +715,7 @@ let fixupApp (penv: penv) (fx, fty, tys, args, m) =
// Is it a val app, where the val has a transform?
match fx with
- | Expr.Val (vref, _, vm) ->
+ | Expr.Val (vref, _, m) ->
let f = vref.Deref
match hasTransfrom penv f with
| Some trans ->
@@ -723,7 +723,7 @@ let fixupApp (penv: penv) (fx, fty, tys, args, m) =
let callPattern = trans.transformCallPattern
let transformedVal = trans.transformedVal
let fCty = transformedVal.Type
- let fCx = exprForVal vm transformedVal
+ let fCx = exprForVal m transformedVal
(* [[f tps args ]] -> transformedVal tps [[COLLAPSED: args]] *)
let env = {prefix = "arg";m = m;eg=penv.g}
let bindings = []
diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt
index ff48ded92fd..133ac7880bf 100644
--- a/src/fsharp/FSComp.txt
+++ b/src/fsharp/FSComp.txt
@@ -31,6 +31,7 @@ buildUnexpectedTypeArgs,"The non-generic type '%s' does not expect any type argu
returnUsedInsteadOfReturnBang,"Consider using 'return!' instead of 'return'."
yieldUsedInsteadOfYieldBang,"Consider using 'yield!' instead of 'yield'."
tupleRequiredInAbstractMethod,"\nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface."
+202,unsupportedAttribute,"This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect."
203,buildInvalidWarningNumber,"Invalid warning number '%s'"
204,buildInvalidVersionString,"Invalid version string '%s'"
205,buildInvalidVersionFile,"Invalid version file '%s'"
@@ -1556,7 +1557,8 @@ forFormatInvalidForInterpolated4,"Interpolated strings used as type IFormattable
3384,scriptSdkNotDeterminedNoHost,"The .NET SDK for this script could not be determined. dotnet.exe could not be found ensure a .NET SDK is installed."
3385,tcInvalidStructReturn,"The use of '[]' on values, functions and methods is only allowed on partial active pattern definitions"
3386,tcImplicitConversionUsed,"This expression uses an implicit conversion to convert type '%s' to type '%s'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning."
-3387,tcAmbiguousImplicitConversion,"This expression has type '%s' and is only made compatible with type '%s' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'."
+3386,tcImplicitConversionUsed2,"This expression uses the implicit conversion '%s' to convert type '%s' to type '%s'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning."
+3387,tcAmbiguousImplicitConversion,"This expression has type '%s' and is only made compatible with type '%s' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:%s"
#3501 "This construct is not supported by your version of the F# compiler" CompilerMessage(ExperimentalAttributeMessages.NotSupportedYet, 3501, IsError=true)
3390,xmlDocBadlyFormed,"This XML comment is invalid: '%s'"
3390,xmlDocMissingParameterName,"This XML comment is invalid: missing 'name' attribute for parameter or parameter reference"
diff --git a/src/fsharp/FSharp.Core/async.fs b/src/fsharp/FSharp.Core/async.fs
index 0d5abef0333..6fb92fe5c1d 100644
--- a/src/fsharp/FSharp.Core/async.fs
+++ b/src/fsharp/FSharp.Core/async.fs
@@ -23,11 +23,11 @@ namespace Microsoft.FSharp.Control
let linkedCTS = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, failureCTS.Token)
- member this.Token = linkedCTS.Token
+ member _.Token = linkedCTS.Token
- member this.Cancel() = failureCTS.Cancel()
+ member _.Cancel() = failureCTS.Cancel()
- member this.Dispose() =
+ member _.Dispose() =
linkedCTS.Dispose()
failureCTS.Dispose()
@@ -108,11 +108,27 @@ namespace Microsoft.FSharp.Control
| Some cont ->
storedCont <- None
action <- cont
- // Let the exception propagate all the way to the trampoline to get a full .StackTrace entry
+
+ // Catch exceptions at the trampoline to get a full .StackTrace entry
+ // This is because of this problem https://stackoverflow.com/questions/5301535/exception-call-stack-truncated-without-any-re-throwing
+ // where only a limited number of stack frames are included in the .StackTrace property
+ // of a .NET exception when it is thrown, up to the first catch handler.
+ //
+ // So when running async code, there aren't any intermediate catch handlers (though there
+ // may be intermediate try/finally frames), there is just this one catch handler at the
+ // base of the stack.
+ //
+ // If an exception is thrown we must have storedExnCont via OnExceptionRaised.
with exn ->
match storedExnCont with
| None ->
+ // Here, the exception escapes the trampoline. This should not happen since all
+ // exception-generating code should use ProtectCode. However some
+ // direct uses of combinators (not using async {...}) may cause
+ // code to execute unprotected, e.g. async.While((fun () -> failwith ".."), ...) executes the first
+ // guardExpr unprotected.
reraise()
+
| Some econt ->
storedExnCont <- None
let edi = ExceptionDispatchInfo.RestoreOrCapture exn
@@ -168,11 +184,11 @@ namespace Microsoft.FSharp.Control
trampoline <- Trampoline()
trampoline.Execute firstAction
- member this.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) =
+ member _.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) =
syncCtxt.Post (sendOrPostCallbackWithTrampoline, state=(f |> box))
AsyncReturn.Fake()
- member this.QueueWorkItemWithTrampoline (f: unit -> AsyncReturn) =
+ member _.QueueWorkItemWithTrampoline (f: unit -> AsyncReturn) =
if not (ThreadPool.QueueUserWorkItem(waitCallbackForQueueWorkItemWithTrampoline, f |> box)) then
failwith "failed to queue user work item"
AsyncReturn.Fake()
@@ -237,45 +253,47 @@ namespace Microsoft.FSharp.Control
member ctxt.WithExceptionContinuation econt = AsyncActivation<'T> { contents with aux = { ctxt.aux with econt = econt } }
/// Produce a new execution context for a composite async
- member ctxt.WithContinuation cont = AsyncActivation<'U> { cont = cont; aux = contents.aux }
+ member _.WithContinuation cont = AsyncActivation<'U> { cont = cont; aux = contents.aux }
/// Produce a new execution context for a composite async
- member ctxt.WithContinuations(cont, econt) = AsyncActivation<'U> { cont = cont; aux = { contents.aux with econt = econt } }
+ member _.WithContinuations(cont, econt) = AsyncActivation<'U> { cont = cont; aux = { contents.aux with econt = econt } }
/// Produce a new execution context for a composite async
member ctxt.WithContinuations(cont, econt, ccont) = AsyncActivation<'T> { contents with cont = cont; aux = { ctxt.aux with econt = econt; ccont = ccont } }
/// The extra information relevant to the execution of the async
- member ctxt.aux = contents.aux
+ member _.aux = contents.aux
/// The success continuation relevant to the execution of the async
- member ctxt.cont = contents.cont
+ member _.cont = contents.cont
/// The exception continuation relevant to the execution of the async
- member ctxt.econt = contents.aux.econt
+ member _.econt = contents.aux.econt
/// The cancellation continuation relevant to the execution of the async
- member ctxt.ccont = contents.aux.ccont
+ member _.ccont = contents.aux.ccont
/// The cancellation token relevant to the execution of the async
- member ctxt.token = contents.aux.token
+ member _.token = contents.aux.token
/// The trampoline holder being used to protect execution of the async
- member ctxt.trampolineHolder = contents.aux.trampolineHolder
+ member _.trampolineHolder = contents.aux.trampolineHolder
/// Check if cancellation has been requested
- member ctxt.IsCancellationRequested = contents.aux.token.IsCancellationRequested
+ member _.IsCancellationRequested = contents.aux.token.IsCancellationRequested
/// Call the cancellation continuation of the active computation
- member ctxt.OnCancellation () =
+ member _.OnCancellation () =
contents.aux.ccont (OperationCanceledException (contents.aux.token))
/// Check for trampoline hijacking.
- member inline ctxt.HijackCheckThenCall cont arg =
+ member inline _.HijackCheckThenCall cont arg =
contents.aux.trampolineHolder.HijackCheckThenCall cont arg
/// Call the success continuation of the asynchronous execution context after checking for
/// cancellation and trampoline hijacking.
+ // - Cancellation check
+ // - Hijack check
member ctxt.OnSuccess result =
if ctxt.IsCancellationRequested then
ctxt.OnCancellation ()
@@ -283,7 +301,7 @@ namespace Microsoft.FSharp.Control
ctxt.HijackCheckThenCall ctxt.cont result
/// Save the exception continuation during propagation of an exception, or prior to raising an exception
- member ctxt.OnExceptionRaised() =
+ member _.OnExceptionRaised() =
contents.aux.trampolineHolder.OnExceptionRaised contents.aux.econt
/// Make an initial async activation.
@@ -293,8 +311,28 @@ namespace Microsoft.FSharp.Control
/// Queue the success continuation of the asynchronous execution context as a work item in the thread pool
/// after installing a trampoline
member ctxt.QueueContinuationWithTrampoline (result: 'T) =
- let ctxt = ctxt
- ctxt.aux.trampolineHolder.QueueWorkItemWithTrampoline(fun () -> ctxt.cont result)
+ let cont = ctxt.cont
+ ctxt.aux.trampolineHolder.QueueWorkItemWithTrampoline(fun () -> cont result)
+
+ /// Ensure that any exceptions raised by the immediate execution of "userCode"
+ /// are sent to the exception continuation. This is done by allowing the exception to propagate
+ /// to the trampoline, and the saved exception continuation is called there.
+ ///
+ /// It is also valid for MakeAsync primitive code to call the exception continuation directly.
+ []
+ member ctxt.ProtectCode userCode =
+ let mutable ok = false
+ try
+ let res = userCode()
+ ok <- true
+ res
+ finally
+ if not ok then
+ ctxt.OnExceptionRaised()
+
+ member ctxt.PostWithTrampoline (syncCtxt: SynchronizationContext) (f: unit -> AsyncReturn) =
+ let holder = contents.aux.trampolineHolder
+ ctxt.ProtectCode (fun () -> holder.PostWithTrampoline syncCtxt f)
/// Call the success continuation of the asynchronous execution context
member ctxt.CallContinuation(result: 'T) =
@@ -311,17 +349,7 @@ namespace Microsoft.FSharp.Control
let mutable i = 0
/// Execute the latch
- member this.Enter() = Interlocked.CompareExchange(&i, 1, 0) = 0
-
- /// Ensures that a function is only called once
- []
- type Once() =
- let latch = Latch()
-
- /// Execute the function at most once
- member this.Do f =
- if latch.Enter() then
- f()
+ member _.Enter() = Interlocked.CompareExchange(&i, 1, 0) = 0
/// Represents the result of an asynchronous computation
[]
@@ -355,8 +383,11 @@ namespace Microsoft.FSharp.Control
let Invoke (computation: Async<'T>) (ctxt: AsyncActivation<_>) : AsyncReturn =
ctxt.HijackCheckThenCall computation.Invoke ctxt
- /// Apply userCode to x. If no exception is raised then call the normal continuation. Used to implement
+ /// Apply 'userCode' to 'arg'. If no exception is raised then call the normal continuation. Used to implement
/// 'finally' and 'when cancelled'.
+ ///
+ /// - Apply 'userCode' to argument with exception protection
+ /// - Hijack check before invoking the continuation
[]
let CallThenContinue userCode arg (ctxt: AsyncActivation<_>) : AsyncReturn =
let mutable result = Unchecked.defaultof<_>
@@ -375,8 +406,11 @@ namespace Microsoft.FSharp.Control
fake()
/// Apply 'part2' to 'result1' and invoke the resulting computation.
- //
- // Note: direct calls to this function end up in user assemblies via inlining
+ ///
+ /// Note: direct calls to this function end up in user assemblies via inlining
+ ///
+ /// - Apply 'part2' to argument with exception protection
+ /// - Hijack check before invoking the resulting computation
[]
let CallThenInvoke (ctxt: AsyncActivation<_>) result1 part2 : AsyncReturn =
let mutable result = Unchecked.defaultof<_>
@@ -396,7 +430,7 @@ namespace Microsoft.FSharp.Control
/// Like `CallThenInvoke` but does not do a hijack check for historical reasons (exact code compat)
[]
- let CallThenInvokeNoHijackCheck (ctxt: AsyncActivation<_>) userCode result1 =
+ let CallThenInvokeNoHijackCheck (ctxt: AsyncActivation<_>) result1 userCode =
let mutable res = Unchecked.defaultof<_>
let mutable ok = false
@@ -412,15 +446,18 @@ namespace Microsoft.FSharp.Control
else
fake()
- /// Apply 'catchFilter' to 'arg'. If the result is 'Some' invoke the resulting computation. If the result is 'None'
+ /// Apply 'filterFunction' to 'arg'. If the result is 'Some' invoke the resulting computation. If the result is 'None'
/// then send 'result1' to the exception continuation.
+ ///
+ /// - Apply 'filterFunction' to argument with exception protection
+ /// - Hijack check before invoking the resulting computation or exception continuation
[]
- let CallFilterThenInvoke (ctxt: AsyncActivation<'T>) catchFilter (edi: ExceptionDispatchInfo) : AsyncReturn =
- let mutable resOpt = Unchecked.defaultof<_>
+ let CallFilterThenInvoke (ctxt: AsyncActivation<'T>) filterFunction (edi: ExceptionDispatchInfo) : AsyncReturn =
+ let mutable resOpt = None
let mutable ok = false
try
- resOpt <- catchFilter (edi.GetAssociatedSourceException())
+ resOpt <- filterFunction (edi.GetAssociatedSourceException())
ok <- true
finally
if not ok then
@@ -435,159 +472,220 @@ namespace Microsoft.FSharp.Control
else
fake()
- /// Internal way of making an async from code, for exact code compat.
- /// Perform a cancellation check and ensure that any exceptions raised by
- /// the immediate execution of "userCode" are sent to the exception continuation.
- []
- let ProtectedCode (ctxt: AsyncActivation<'T>) userCode =
- if ctxt.IsCancellationRequested then
- ctxt.OnCancellation ()
- else
- let mutable ok = false
- try
- let res = userCode ctxt
- ok <- true
- res
- finally
- if not ok then
- ctxt.OnExceptionRaised()
-
/// Build a primitive without any exception or resync protection
[]
let MakeAsync body = { Invoke = body }
[]
- // Note: direct calls to this function end up in user assemblies via inlining
+ let MakeAsyncWithCancelCheck body =
+ MakeAsync (fun ctxt ->
+ if ctxt.IsCancellationRequested then
+ ctxt.OnCancellation ()
+ else
+ body ctxt)
+
+ /// Execute part1, then apply part2, then execute the result of that
+ ///
+ /// Note: direct calls to this function end up in user assemblies via inlining
+ /// - Initial cancellation check
+ /// - Initial hijack check (see Invoke)
+ /// - No hijack check after applying 'part2' to argument (see CallThenInvoke)
+ /// - No cancellation check after applying 'part2' to argument (see CallThenInvoke)
+ /// - Apply 'part2' to argument with exception protection (see CallThenInvoke)
+ []
let Bind (ctxt: AsyncActivation<'T>) (part1: Async<'U>) (part2: 'U -> Async<'T>) : AsyncReturn =
if ctxt.IsCancellationRequested then
ctxt.OnCancellation ()
else
- Invoke part1 (ctxt.WithContinuation(fun result1 -> CallThenInvokeNoHijackCheck ctxt part2 result1 ))
+ // Note, no cancellation check is done before calling 'part2'. This is
+ // because part1 may bind a resource, while part2 is a try/finally, and, if
+ // the resource creation completes, we want to enter part2 before cancellation takes effect.
+ Invoke part1 (ctxt.WithContinuation(fun result1 -> CallThenInvokeNoHijackCheck ctxt result1 part2))
- []
/// Re-route all continuations to execute the finally function.
- let TryFinally (ctxt: AsyncActivation<'T>) computation finallyFunction =
+ /// - Cancellation check after 'entering' the try/finally and before running the body
+ /// - Hijack check after 'entering' the try/finally and before running the body (see Invoke)
+ /// - Run 'finallyFunction' with exception protection (see CallThenContinue)
+ /// - Hijack check before any of the continuations (see CallThenContinue)
+ []
+ let TryFinally (ctxt: AsyncActivation<'T>) (computation: Async<'T>) finallyFunction =
+ // Note, we don't test for cancellation before entering a try/finally. This prevents
+ // a resource being created without being disposed.
+
+ // The new continuation runs the finallyFunction and resumes the old continuation
+ // If an exception is thrown we continue with the previous exception continuation.
+ let cont result =
+ CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.cont result))
+
+ // The new exception continuation runs the finallyFunction and then runs the previous exception continuation.
+ // If an exception is thrown we continue with the previous exception continuation.
+ let econt edi =
+ CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.econt edi))
+
+ // The cancellation continuation runs the finallyFunction and then runs the previous cancellation continuation.
+ // If an exception is thrown we continue with the previous cancellation continuation (the exception is lost)
+ let ccont cexn =
+ CallThenContinue finallyFunction () (ctxt.WithContinuations(cont=(fun () -> ctxt.ccont cexn), econt = (fun _ -> ctxt.ccont cexn)))
+
+ let ctxt = ctxt.WithContinuations(cont=cont, econt=econt, ccont=ccont)
if ctxt.IsCancellationRequested then
ctxt.OnCancellation ()
else
- // The new continuation runs the finallyFunction and resumes the old continuation
- // If an exception is thrown we continue with the previous exception continuation.
- let cont result =
- CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.cont result))
- // The new exception continuation runs the finallyFunction and then runs the previous exception continuation.
- // If an exception is thrown we continue with the previous exception continuation.
- let econt exn =
- CallThenContinue finallyFunction () (ctxt.WithContinuation(fun () -> ctxt.econt exn))
- // The cancellation continuation runs the finallyFunction and then runs the previous cancellation continuation.
- // If an exception is thrown we continue with the previous cancellation continuation (the exception is lost)
- let ccont cexn =
- CallThenContinue finallyFunction () (ctxt.WithContinuations(cont=(fun () -> ctxt.ccont cexn), econt = (fun _ -> ctxt.ccont cexn)))
- let newCtxt = ctxt.WithContinuations(cont=cont, econt=econt, ccont=ccont)
- computation.Invoke newCtxt
+ computation.Invoke ctxt
/// Re-route the exception continuation to call to catchFunction. If catchFunction returns None then call the exception continuation.
/// If it returns Some, invoke the resulting async.
+ /// - Cancellation check before entering the try
+ /// - No hijack check after 'entering' the try/with
+ /// - Cancellation check before applying the 'catchFunction'
+ /// - Apply `catchFunction' to argument with exception protection (see CallFilterThenInvoke)
+ /// - Hijack check before invoking the resulting computation or exception continuation (see CallFilterThenInvoke)
[]
- let TryWith (ctxt: AsyncActivation<'T>) computation catchFunction =
+ let TryWith (ctxt: AsyncActivation<'T>) (computation: Async<'T>) catchFunction =
if ctxt.IsCancellationRequested then
ctxt.OnCancellation ()
else
- let newCtxt =
+ let ctxt =
ctxt.WithExceptionContinuation(fun edi ->
if ctxt.IsCancellationRequested then
ctxt.OnCancellation ()
else
CallFilterThenInvoke ctxt catchFunction edi)
- computation.Invoke newCtxt
- /// Internal way of making an async from code, for exact code compat.
- /// When run, ensures that any exceptions raised by the immediate execution of "f" are
- /// sent to the exception continuation.
- let CreateProtectedAsync f =
- MakeAsync (fun ctxt -> ProtectedCode ctxt f)
+ computation.Invoke ctxt
- /// Internal way of making an async from result, for exact code compat.
+ /// Make an async for an AsyncResult
+ // - No cancellation check
+ // - No hijack check
let CreateAsyncResultAsync res =
MakeAsync (fun ctxt ->
match res with
| AsyncResult.Ok r -> ctxt.cont r
| AsyncResult.Error edi -> ctxt.econt edi
- | AsyncResult.Canceled oce -> ctxt.ccont oce)
+ | AsyncResult.Canceled cexn -> ctxt.ccont cexn)
- // Generate async computation which calls its continuation with the given result
+ /// Generate async computation which calls its continuation with the given result
+ /// - Cancellation check (see OnSuccess)
+ /// - Hijack check (see OnSuccess)
let inline CreateReturnAsync res =
// Note: this code ends up in user assemblies via inlining
MakeAsync (fun ctxt -> ctxt.OnSuccess res)
- // The primitive bind operation. Generate a process that runs the first process, takes
- // its result, applies f and then runs the new process produced. Hijack if necessary and
- // run 'f' with exception protection
+ /// Runs the first process, takes its result, applies f and then runs the new process produced.
+ /// - Initial cancellation check (see Bind)
+ /// - Initial hijack check (see Bind)
+ /// - No hijack check after applying 'part2' to argument (see Bind)
+ /// - No cancellation check after applying 'part2' to argument (see Bind)
+ /// - Apply 'part2' to argument with exception protection (see Bind)
let inline CreateBindAsync part1 part2 =
// Note: this code ends up in user assemblies via inlining
MakeAsync (fun ctxt ->
Bind ctxt part1 part2)
- // Call the given function with exception protection, but first
- // check for cancellation.
+ /// Call the given function with exception protection.
+ /// - No initial cancellation check
+ /// - Hijack check after applying part2 to argument (see CallThenInvoke)
let inline CreateCallAsync part2 result1 =
// Note: this code ends up in user assemblies via inlining
MakeAsync (fun ctxt ->
- if ctxt.IsCancellationRequested then
- ctxt.OnCancellation ()
- else
- CallThenInvoke ctxt result1 part2)
+ CallThenInvoke ctxt result1 part2)
+ /// Call the given function with exception protection.
+ /// - Initial cancellation check
+ /// - Hijack check after applying computation to argument (see CallThenInvoke)
+ /// - Apply 'computation' to argument with exception protection (see CallThenInvoke)
let inline CreateDelayAsync computation =
// Note: this code ends up in user assemblies via inlining
- CreateCallAsync computation ()
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ CallThenInvoke ctxt () computation)
/// Implements the sequencing construct of async computation expressions
+ /// - Initial cancellation check (see CreateBindAsync)
+ /// - Initial hijack check (see CreateBindAsync)
+ /// - No hijack check after applying 'part2' to argument (see CreateBindAsync)
+ /// - No cancellation check after applying 'part2' to argument (see CreateBindAsync)
+ /// - Apply 'part2' to argument with exception protection (see CreateBindAsync)
let inline CreateSequentialAsync part1 part2 =
// Note: this code ends up in user assemblies via inlining
CreateBindAsync part1 (fun () -> part2)
/// Create an async for a try/finally
+ /// - Cancellation check after 'entering' the try/finally and before running the body
+ /// - Hijack check after 'entering' the try/finally and before running the body (see TryFinally)
+ /// - Apply 'finallyFunction' with exception protection (see TryFinally)
let inline CreateTryFinallyAsync finallyFunction computation =
MakeAsync (fun ctxt -> TryFinally ctxt computation finallyFunction)
/// Create an async for a try/with filtering exceptions through a pattern match
- let inline CreateTryWithFilterAsync catchFunction computation =
- MakeAsync (fun ctxt -> TryWith ctxt computation (fun edi -> catchFunction edi))
+ /// - Cancellation check before entering the try (see TryWith)
+ /// - Cancellation check before entering the with (see TryWith)
+ /// - Apply `filterFunction' to argument with exception protection (see TryWith)
+ /// - Hijack check before invoking the resulting computation or exception continuation
+ let inline CreateTryWithFilterAsync filterFunction computation =
+ MakeAsync (fun ctxt -> TryWith ctxt computation filterFunction)
/// Create an async for a try/with filtering
+ /// - Cancellation check before entering the try (see TryWith)
+ /// - Cancellation check before entering the with (see TryWith)
+ /// - Apply `catchFunction' to argument with exception protection (see TryWith)
+ /// - Hijack check before invoking the resulting computation or exception continuation
let inline CreateTryWithAsync catchFunction computation =
- CreateTryWithFilterAsync (fun exn -> Some (catchFunction exn)) computation
+ MakeAsync (fun ctxt -> TryWith ctxt computation (fun exn -> Some (catchFunction exn)))
/// Call the finallyFunction if the computation results in a cancellation, and then continue with cancellation.
/// If the finally function gives an exception then continue with cancellation regardless.
+ /// - No cancellation check before entering the when-cancelled
+ /// - No hijack check before entering the when-cancelled
+ /// - Apply `finallyFunction' to argument with exception protection (see CallThenContinue)
+ /// - Hijack check before continuing with cancellation (see CallThenContinue)
let CreateWhenCancelledAsync (finallyFunction: OperationCanceledException -> unit) computation =
MakeAsync (fun ctxt ->
let ccont = ctxt.ccont
- let newCtxt =
- ctxt.WithCancellationContinuation(fun exn ->
- CallThenContinue finallyFunction exn (ctxt.WithContinuations(cont = (fun _ -> ccont exn), econt = (fun _ -> ccont exn))))
- computation.Invoke newCtxt)
+ let ctxt =
+ ctxt.WithCancellationContinuation(fun cexn ->
+ CallThenContinue finallyFunction cexn (ctxt.WithContinuations(cont = (fun _ -> ccont cexn), econt = (fun _ -> ccont cexn))))
+ computation.Invoke ctxt)
/// A single pre-allocated computation that fetched the current cancellation token
let cancellationTokenAsync =
MakeAsync (fun ctxt -> ctxt.cont ctxt.aux.token)
/// A single pre-allocated computation that returns a unit result
+ /// - Cancellation check (see CreateReturnAsync)
+ /// - Hijack check (see CreateReturnAsync)
let unitAsync =
CreateReturnAsync()
/// Implement use/Dispose
+ ///
+ /// - No initial cancellation check before applying computation to its argument. See CreateTryFinallyAsync
+ /// and CreateCallAsync. We enter the try/finally before any cancel checks.
+ /// - Cancellation check after 'entering' the implied try/finally and before running the body (see CreateTryFinallyAsync)
+ /// - Hijack check after 'entering' the implied try/finally and before running the body (see CreateTryFinallyAsync)
+ /// - Run 'disposeFunction' with exception protection (see CreateTryFinallyAsync)
let CreateUsingAsync (resource:'T :> IDisposable) (computation:'T -> Async<'a>) : Async<'a> =
- let mutable x = 0
- let disposeFunction _ =
- if Interlocked.CompareExchange(&x, 1, 0) = 0 then
- Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose resource
- CreateTryFinallyAsync disposeFunction (CreateCallAsync computation resource) |> CreateWhenCancelledAsync disposeFunction
+ let disposeFunction () = Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.Dispose resource
+ CreateTryFinallyAsync disposeFunction (CreateCallAsync computation resource)
+ /// - Initial cancellation check (see CreateBindAsync)
+ /// - Initial hijack check (see CreateBindAsync)
+ /// - Cancellation check after (see unitAsync)
+ /// - No hijack check after (see unitAsync)
let inline CreateIgnoreAsync computation =
CreateBindAsync computation (fun _ -> unitAsync)
/// Implement the while loop construct of async computation expressions
+ /// - No initial cancellation check before first execution of guard
+ /// - No initial hijack check before first execution of guard
+ /// - No cancellation check before each execution of guard (see CreateBindAsync)
+ /// - Hijack check before each execution of guard (see CreateBindAsync)
+ /// - Cancellation check before each execution of the body after guard (CreateBindAsync)
+ /// - No hijack check before each execution of the body after guard (see CreateBindAsync)
+ /// - Cancellation check after guard fails (see unitAsync)
+ /// - Hijack check after guard fails (see unitAsync)
+ /// - Apply 'guardFunc' with exception protection (see ProtectCode)
+ //
+ // Note: There are allocations during loop set up, but no allocations during iterations of the loop
let CreateWhileAsync guardFunc computation =
if guardFunc() then
let mutable whileAsync = Unchecked.defaultof<_>
@@ -596,39 +694,107 @@ namespace Microsoft.FSharp.Control
else
unitAsync
+#if REDUCED_ALLOCATIONS_BUT_RUNS_SLOWER
+ /// Implement the while loop construct of async computation expressions
+ /// - Initial cancellation check before each execution of guard
+ /// - No initial hijack check before each execution of guard
+ /// - No cancellation check before each execution of the body after guard
+ /// - Hijack check before each execution of the body after guard (see Invoke)
+ /// - Cancellation check after guard fails (see OnSuccess)
+ /// - Hijack check after guard fails (see OnSuccess)
+ /// - Apply 'guardFunc' with exception protection (see ProtectCode)
+ //
+ // Note: There are allocations during loop set up, but no allocations during iterations of the loop
+ // One allocation for While async
+ // One allocation for While async context function
+ MakeAsync (fun ctxtGuard ->
+ // One allocation for ctxtLoop reference cell
+ let mutable ctxtLoop = Unchecked.defaultof<_>
+ // One allocation for While recursive closure
+ let rec WhileLoop () =
+ if ctxtGuard.IsCancellationRequested then
+ ctxtGuard.OnCancellation ()
+ elif ctxtGuard.ProtectCode guardFunc then
+ Invoke computation ctxtLoop
+ else
+ ctxtGuard.OnSuccess ()
+ // One allocation for While body activation context
+ ctxtLoop <- ctxtGuard.WithContinuation(WhileLoop)
+ WhileLoop ())
+#endif
+
/// Implement the for loop construct of async commputation expressions
+ /// - No initial cancellation check before GetEnumerator call.
+ /// - No initial cancellation check before entering protection of implied try/finally
+ /// - Cancellation check after 'entering' the implied try/finally and before loop
+ /// - Hijack check after 'entering' the implied try/finally and after MoveNext call
+ /// - Do not apply 'GetEnumerator' with exception protection. However for an 'async'
+ /// in an 'async { ... }' the exception protection will be provided by the enclosing
+ // Delay or Bind or similar construct.
+ /// - Apply 'MoveNext' with exception protection
+ /// - Apply 'Current' with exception protection
+
+ // Note: No allocations during iterations of the loop apart from those from
+ // applying the loop body to the element
let CreateForLoopAsync (source: seq<_>) computation =
CreateUsingAsync (source.GetEnumerator()) (fun ie ->
CreateWhileAsync
(fun () -> ie.MoveNext())
(CreateDelayAsync (fun () -> computation ie.Current)))
+#if REDUCED_ALLOCATIONS_BUT_RUNS_SLOWER
+ CreateUsingAsync (source.GetEnumerator()) (fun ie ->
+ // One allocation for While async
+ // One allocation for While async context function
+ MakeAsync (fun ctxtGuard ->
+ // One allocation for ctxtLoop reference cell
+ let mutable ctxtLoop = Unchecked.defaultof<_>
+ // Two allocations for protected functions
+ let guardFunc() = ie.MoveNext()
+ let currentFunc() = ie.Current
+ // One allocation for ForLoop recursive closure
+ let rec ForLoop () =
+ if ctxtGuard.IsCancellationRequested then
+ ctxtGuard.OnCancellation ()
+ elif ctxtGuard.ProtectCode guardFunc then
+ let x = ctxtGuard.ProtectCode currentFunc
+ CallThenInvoke ctxtLoop x computation
+ else
+ ctxtGuard.OnSuccess ()
+ // One allocation for loop activation context
+ ctxtLoop <- ctxtGuard.WithContinuation(ForLoop)
+ ForLoop ()))
+#endif
+
+ /// - Initial cancellation check
+ /// - Call syncCtxt.Post with exception protection. THis may fail as it is arbitrary user code
let CreateSwitchToAsync (syncCtxt: SynchronizationContext) =
- CreateProtectedAsync (fun ctxt ->
- ctxt.trampolineHolder.PostWithTrampoline syncCtxt ctxt.cont)
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ ctxt.PostWithTrampoline syncCtxt ctxt.cont)
+ /// - Initial cancellation check
+ /// - Create Thread and call Start() with exception protection. We don't expect this
+ /// to fail but protect nevertheless.
let CreateSwitchToNewThreadAsync() =
- CreateProtectedAsync (fun ctxt ->
- ctxt.trampolineHolder.StartThreadWithTrampoline ctxt.cont)
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ ctxt.ProtectCode (fun () -> ctxt.trampolineHolder.StartThreadWithTrampoline ctxt.cont))
+ /// - Initial cancellation check
+ /// - Call ThreadPool.QueueUserWorkItem with exception protection. We don't expect this
+ /// to fail but protect nevertheless.
let CreateSwitchToThreadPoolAsync() =
- CreateProtectedAsync (fun ctxt ->
- ctxt.trampolineHolder.QueueWorkItemWithTrampoline ctxt.cont)
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ ctxt.ProtectCode (fun () -> ctxt.trampolineHolder.QueueWorkItemWithTrampoline ctxt.cont))
/// Post back to the sync context regardless of which continuation is taken
+ /// - Call syncCtxt.Post with exception protection
let DelimitSyncContext (ctxt: AsyncActivation<_>) =
match SynchronizationContext.Current with
| null -> ctxt
| syncCtxt ->
- ctxt.WithContinuations(cont = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.cont x)),
- econt = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.econt x)),
- ccont = (fun x -> ctxt.trampolineHolder.PostWithTrampoline syncCtxt (fun () -> ctxt.ccont x)))
-
- // When run, ensures that each of the continuations of the process are run in the same synchronization context.
- let CreateDelimitedUserCodeAsync f =
- CreateProtectedAsync (fun ctxt ->
- let ctxtWithSync = DelimitSyncContext ctxt
- f ctxtWithSync)
+ ctxt.WithContinuations(cont = (fun x -> ctxt.PostWithTrampoline syncCtxt (fun () -> ctxt.cont x)),
+ econt = (fun edi -> ctxt.PostWithTrampoline syncCtxt (fun () -> ctxt.econt edi)),
+ ccont = (fun cexn -> ctxt.PostWithTrampoline syncCtxt (fun () -> ctxt.ccont cexn)))
[]
[]
@@ -650,14 +816,15 @@ namespace Microsoft.FSharp.Control
match syncCtxt, currentSyncCtxt with
| null, null ->
executeImmediately ()
- // See bug 370350; this logic is incorrect from the perspective of how SynchronizationContext is meant to work,
- // but the logic works for mainline scenarios (WinForms/WPF/ASP.NET) and we won't change it again.
+ // This logic was added in F# 2.0 though is incorrect from the perspective of
+ // how SynchronizationContext is meant to work. However the logic works for
+ // mainline scenarios (WinForms/WPF) and for compatibility reasons we won't change it.
| _ when Object.Equals(syncCtxt, currentSyncCtxt) && thread.Equals Thread.CurrentThread ->
executeImmediately ()
| _ ->
trampolineHolder.PostOrQueueWithTrampoline syncCtxt action
- member _.ContinueWithPostOrQueue res =
+ member _.PostOrQueueWithTrampoline res =
trampolineHolder.PostOrQueueWithTrampoline syncCtxt (fun () -> ctxt.cont res)
/// A utility type to provide a synchronization point between an asynchronous computation
@@ -743,9 +910,9 @@ namespace Microsoft.FSharp.Control
if reuseThread then
cont.ContinueImmediate res
else
- cont.ContinueWithPostOrQueue res
+ cont.PostOrQueueWithTrampoline res
| otherwise ->
- otherwise |> List.iter (fun cont -> cont.ContinueWithPostOrQueue res |> unfake) |> fake
+ otherwise |> List.iter (fun cont -> cont.PostOrQueueWithTrampoline res |> unfake) |> fake
member x.ResultAvailable = result.IsSome
@@ -815,7 +982,7 @@ namespace Microsoft.FSharp.Control
/// Run the asynchronous workflow and wait for its result.
[]
- let RunSynchronouslyInAnotherThread (token:CancellationToken, computation, timeout) =
+ let QueueAsyncAndWaitForResultSynchronously (token:CancellationToken) computation timeout =
let token, innerCTS =
// If timeout is provided, we govern the async by our own CTS, to cancel
// when execution times out. Otherwise, the user-supplied token governs the async.
@@ -827,12 +994,12 @@ namespace Microsoft.FSharp.Control
use resultCell = new ResultCell>()
QueueAsync
- token
- (fun res -> resultCell.RegisterResult(AsyncResult.Ok res, reuseThread=true))
- (fun edi -> resultCell.RegisterResult(AsyncResult.Error edi, reuseThread=true))
- (fun exn -> resultCell.RegisterResult(AsyncResult.Canceled exn, reuseThread=true))
- computation
- |> unfake
+ token
+ (fun res -> resultCell.RegisterResult(AsyncResult.Ok res, reuseThread=true))
+ (fun edi -> resultCell.RegisterResult(AsyncResult.Error edi, reuseThread=true))
+ (fun exn -> resultCell.RegisterResult(AsyncResult.Canceled exn, reuseThread=true))
+ computation
+ |> unfake
let res = resultCell.TryWaitForResultSynchronously(?timeout = timeout)
match res with
@@ -851,7 +1018,7 @@ namespace Microsoft.FSharp.Control
res.Commit()
[]
- let RunSynchronouslyInCurrentThread (cancellationToken:CancellationToken, computation) =
+ let RunImmediate (cancellationToken:CancellationToken) computation =
use resultCell = new ResultCell>()
let trampolineHolder = TrampolineHolder()
@@ -873,17 +1040,8 @@ namespace Microsoft.FSharp.Control
let RunSynchronously cancellationToken (computation: Async<'T>) timeout =
// Reuse the current ThreadPool thread if possible.
match Thread.CurrentThread.IsThreadPoolThread, timeout with
- | true, None -> RunSynchronouslyInCurrentThread (cancellationToken, computation)
- // When the timeout is given we need a dedicated thread
- // which cancels the computation.
- // Performing the cancellation in the ThreadPool eg. by using
- // Timer from System.Threading or CancellationTokenSource.CancelAfter
- // (which internally uses Timer) won't work properly
- // when the ThreadPool is busy.
- //
- // And so when the timeout is given we always use the current thread
- // for the cancellation and run the computation in another thread.
- | _ -> RunSynchronouslyInAnotherThread (cancellationToken, computation, timeout)
+ | true, None -> RunImmediate cancellationToken computation
+ | _ -> QueueAsyncAndWaitForResultSynchronously cancellationToken computation timeout
[]
let Start cancellationToken (computation:Async) =
@@ -921,46 +1079,92 @@ namespace Microsoft.FSharp.Control
|> unfake
task
- // Helper to attach continuation to the given task.
+ // Call the appropriate continuation on completion of a task
[]
- let taskContinueWith (task: Task<'T>) (ctxt: AsyncActivation<'T>) =
-
- let continuation (completedTask: Task<_>) : unit =
- ctxt.trampolineHolder.ExecuteWithTrampoline (fun () ->
- if completedTask.IsCanceled then
- let edi = ExceptionDispatchInfo.Capture(TaskCanceledException completedTask)
- ctxt.econt edi
- elif completedTask.IsFaulted then
- let edi = ExceptionDispatchInfo.RestoreOrCapture completedTask.Exception
- ctxt.econt edi
- else
- ctxt.cont completedTask.Result) |> unfake
-
- if task.IsCompleted then
- continuation task |> fake
+ let OnTaskCompleted (completedTask: Task<'T>) (ctxt: AsyncActivation<'T>) =
+ assert completedTask.IsCompleted
+ if completedTask.IsCanceled then
+ let edi = ExceptionDispatchInfo.Capture(TaskCanceledException completedTask)
+ ctxt.econt edi
+ elif completedTask.IsFaulted then
+ let edi = ExceptionDispatchInfo.RestoreOrCapture completedTask.Exception
+ ctxt.econt edi
else
- task.ContinueWith(Action>(continuation), TaskContinuationOptions.ExecuteSynchronously)
- |> ignore |> fake
+ ctxt.cont completedTask.Result
+ // Call the appropriate continuation on completion of a task. A cancelled task
+ // calls the exception continuation with TaskCanceledException, since it may not represent cancellation of
+ // the overall async (they may be governed by different cancellation tokens, or
+ // the task may not have a cancellation token at all).
[]
- let taskContinueWithUnit (task: Task) (ctxt: AsyncActivation) =
+ let OnUnitTaskCompleted (completedTask: Task) (ctxt: AsyncActivation) =
+ assert completedTask.IsCompleted
+ if completedTask.IsCanceled then
+ let edi = ExceptionDispatchInfo.Capture(TaskCanceledException(completedTask))
+ ctxt.econt edi
+ elif completedTask.IsFaulted then
+ let edi = ExceptionDispatchInfo.RestoreOrCapture completedTask.Exception
+ ctxt.econt edi
+ else
+ ctxt.cont ()
- let continuation (completedTask: Task) : unit =
+ // Helper to attach continuation to the given task, which is assumed not to be completed.
+ // When the task completes the continuation will be run synchronously on the thread
+ // completing the task. This will install a new trampoline on that thread and continue the
+ // execution of the async there.
+ []
+ let AttachContinuationToTask (task: Task<'T>) (ctxt: AsyncActivation<'T>) =
+ task.ContinueWith(Action>(fun completedTask ->
ctxt.trampolineHolder.ExecuteWithTrampoline (fun () ->
- if completedTask.IsCanceled then
- let edi = ExceptionDispatchInfo.Capture(TaskCanceledException(completedTask))
- ctxt.econt edi
- elif completedTask.IsFaulted then
- let edi = ExceptionDispatchInfo.RestoreOrCapture completedTask.Exception
- ctxt.econt edi
- else
- ctxt.cont ()) |> unfake
-
- if task.IsCompleted then
- continuation task |> fake
- else
- task.ContinueWith(Action(continuation), TaskContinuationOptions.ExecuteSynchronously)
- |> ignore |> fake
+ OnTaskCompleted completedTask ctxt)
+ |> unfake), TaskContinuationOptions.ExecuteSynchronously)
+ |> ignore
+ |> fake
+
+ // Helper to attach continuation to the given task, which is assumed not to be completed
+ // When the task completes the continuation will be run synchronously on the thread
+ // completing the task. This will install a new trampoline on that thread and continue the
+ // execution of the async there.
+ []
+ let AttachContinuationToUnitTask (task: Task) (ctxt: AsyncActivation) =
+ task.ContinueWith(Action(fun completedTask ->
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () ->
+ OnUnitTaskCompleted completedTask ctxt)
+ |> unfake), TaskContinuationOptions.ExecuteSynchronously)
+ |> ignore
+ |> fake
+
+ /// Removes a registration places on a cancellation token
+ let DisposeCancellationRegistration (registration: byref) =
+ match registration with
+ | Some r ->
+ registration <- None
+ r.Dispose()
+ | None -> ()
+
+ /// Cleans up a Timer, helper for Async.Sleep
+ let DisposeTimer (timer: byref) =
+ match timer with
+ | None -> ()
+ | Some t ->
+ timer <- None
+ t.Dispose()
+
+ /// Unregisters a RegisteredWaitHandle, helper for AwaitWaitHandle
+ let UnregisterWaitHandle (rwh: byref) =
+ match rwh with
+ | None -> ()
+ | Some r ->
+ r.Unregister null |> ignore
+ rwh <- None
+
+ /// Unregisters a delegate handler, helper for AwaitEvent
+ let RemoveHandler (event: IEvent<_, _>) (del: byref<'Delegate option>) =
+ match del with
+ | Some d ->
+ del <- None
+ event.RemoveHandler d
+ | None -> ()
[]
type AsyncIAsyncResult<'T>(callback: System.AsyncCallback, state:obj) =
@@ -1006,10 +1210,10 @@ namespace Microsoft.FSharp.Control
completedSynchronously <- false
interface System.IAsyncResult with
- member x.IsCompleted = result.ResultAvailable
- member x.CompletedSynchronously = completedSynchronously
- member x.AsyncWaitHandle = result.GetWaitHandle()
- member x.AsyncState = state
+ member _.IsCompleted = result.ResultAvailable
+ member _.CompletedSynchronously = completedSynchronously
+ member _.AsyncWaitHandle = result.GetWaitHandle()
+ member _.AsyncState = state
interface System.IDisposable with
member x.Dispose() = x.Close()
@@ -1017,9 +1221,9 @@ namespace Microsoft.FSharp.Control
module AsBeginEndHelpers =
let beginAction (computation, callback, state) =
let aiar = new AsyncIAsyncResult<'T>(callback, state)
- let cont v = aiar.SetResult (AsyncResult.Ok v)
- let econt v = aiar.SetResult (AsyncResult.Error v)
- let ccont v = aiar.SetResult (AsyncResult.Canceled v)
+ let cont res = aiar.SetResult (AsyncResult.Ok res)
+ let econt edi = aiar.SetResult (AsyncResult.Error edi)
+ let ccont cexn = aiar.SetResult (AsyncResult.Canceled cexn)
StartWithContinuations aiar.Token computation cont econt ccont
aiar.CheckForNotSynchronous()
(aiar :> IAsyncResult)
@@ -1083,47 +1287,40 @@ namespace Microsoft.FSharp.Control
static member CancelCheck () = unitAsync
static member FromContinuations (callback: ('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) : Async<'T> =
- MakeAsync (fun ctxt ->
- if ctxt.IsCancellationRequested then
- ctxt.OnCancellation ()
- else
- let mutable underCurrentThreadStack = true
- let mutable contToTailCall = None
- let thread = Thread.CurrentThread
- let latch = Latch()
- let once cont x =
- if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes))
- if Thread.CurrentThread.Equals thread && underCurrentThreadStack then
- contToTailCall <- Some(fun () -> cont x)
- else if Trampoline.ThisThreadHasTrampoline then
- let syncCtxt = SynchronizationContext.Current
- ctxt.trampolineHolder.PostOrQueueWithTrampoline syncCtxt (fun () -> cont x) |> unfake
- else
- ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> cont x ) |> unfake
- try
- callback (once ctxt.cont, (fun exn -> once ctxt.econt (ExceptionDispatchInfo.RestoreOrCapture exn)), once ctxt.ccont)
- with exn ->
- if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes))
- let edi = ExceptionDispatchInfo.RestoreOrCapture exn
- ctxt.econt edi |> unfake
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ let mutable underCurrentThreadStack = true
+ let mutable contToTailCall = None
+ let thread = Thread.CurrentThread
+ let latch = Latch()
+ let once cont x =
+ if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes))
+ if Thread.CurrentThread.Equals thread && underCurrentThreadStack then
+ contToTailCall <- Some(fun () -> cont x)
+ elif Trampoline.ThisThreadHasTrampoline then
+ let syncCtxt = SynchronizationContext.Current
+ ctxt.trampolineHolder.PostOrQueueWithTrampoline syncCtxt (fun () -> cont x) |> unfake
+ else
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> cont x ) |> unfake
+ try
+ callback (once ctxt.cont, (fun exn -> once ctxt.econt (ExceptionDispatchInfo.RestoreOrCapture exn)), once ctxt.ccont)
+ with exn ->
+ if not(latch.Enter()) then invalidOp(SR.GetString(SR.controlContinuationInvokedMultipleTimes))
+ let edi = ExceptionDispatchInfo.RestoreOrCapture exn
+ ctxt.econt edi |> unfake
- underCurrentThreadStack <- false
+ underCurrentThreadStack <- false
- match contToTailCall with
- | Some k -> k()
- | _ -> fake())
+ match contToTailCall with
+ | Some k -> k()
+ | _ -> fake())
static member DefaultCancellationToken = defaultCancellationTokenSource.Token
static member CancelDefaultToken() =
-
let cts = defaultCancellationTokenSource
-
// set new CancellationTokenSource before calling Cancel - otherwise if Cancel throws token will stay unchanged
defaultCancellationTokenSource <- new CancellationTokenSource()
-
cts.Cancel()
-
// we do not dispose the old default CTS - let GC collect it
static member Catch (computation: Async<'T>) =
@@ -1150,46 +1347,46 @@ namespace Microsoft.FSharp.Control
AsyncPrimitives.StartAsTask cancellationToken computation taskCreationOptions
static member StartChildAsTask (computation, ?taskCreationOptions) =
- async { let! cancellationToken = cancellationTokenAsync
- return AsyncPrimitives.StartAsTask cancellationToken computation taskCreationOptions }
+ async {
+ let! cancellationToken = cancellationTokenAsync
+ return AsyncPrimitives.StartAsTask cancellationToken computation taskCreationOptions
+ }
- static member Parallel (computations: seq>) = Async.Parallel(computations, ?maxDegreeOfParallelism=None)
+ static member Parallel (computations: seq>) =
+ Async.Parallel(computations, ?maxDegreeOfParallelism=None)
static member Parallel (computations: seq>, ?maxDegreeOfParallelism: int) =
match maxDegreeOfParallelism with
| Some x when x < 1 -> raise(System.ArgumentException(String.Format(SR.GetString(SR.maxDegreeOfParallelismNotPositive), x), "maxDegreeOfParallelism"))
| _ -> ()
- MakeAsync (fun ctxt ->
- let tasks, result =
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ // manually protect eval of seq
+ let result =
try
- Seq.toArray computations, None // manually protect eval of seq
+ Choice1Of2 (Seq.toArray computations)
with exn ->
- let edi = ExceptionDispatchInfo.RestoreOrCapture exn
- null, Some (ctxt.econt edi)
+ Choice2Of2 (ExceptionDispatchInfo.RestoreOrCapture exn)
match result with
- | Some r -> r
- | None ->
- if tasks.Length = 0 then
- // must not be in a 'protect' if we call cont explicitly; if cont throws, it should unwind the stack, preserving Dev10 behavior
- ctxt.cont [| |]
- else
- ProtectedCode ctxt (fun ctxt ->
- let ctxtWithSync = DelimitSyncContext ctxt // manually resync
- let mutable count = tasks.Length
+ | Choice2Of2 edi -> ctxt.econt edi
+ | Choice1Of2 [| |] -> ctxt.cont [| |]
+ | Choice1Of2 computations ->
+ ctxt.ProtectCode (fun () ->
+ let ctxt = DelimitSyncContext ctxt // manually resync
+ let mutable count = computations.Length
let mutable firstExn = None
- let results = Array.zeroCreate tasks.Length
+ let results = Array.zeroCreate computations.Length
// Attempt to cancel the individual operations if an exception happens on any of the other threads
- let innerCTS = new LinkedSubSource(ctxtWithSync.token)
+ let innerCTS = new LinkedSubSource(ctxt.token)
let finishTask remaining =
if (remaining = 0) then
innerCTS.Dispose()
match firstExn with
- | None -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont results)
- | Some (Choice1Of2 exn) -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.econt exn)
- | Some (Choice2Of2 cexn) -> ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.ccont cexn)
+ | None -> ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.cont results)
+ | Some (Choice1Of2 exn) -> ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.econt exn)
+ | Some (Choice2Of2 cexn) -> ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.ccont cexn)
else
fake()
@@ -1219,14 +1416,14 @@ namespace Microsoft.FSharp.Control
let maxDegreeOfParallelism =
match maxDegreeOfParallelism with
| None -> None
- | Some x when x >= tasks.Length -> None
+ | Some x when x >= computations.Length -> None
| Some _ as x -> x
// Simple case (no maxDegreeOfParallelism) just queue all the work, if we have maxDegreeOfParallelism set we start that many workers
// which will make progress on the actual computations
match maxDegreeOfParallelism with
| None ->
- tasks |> Array.iteri (fun i p ->
+ computations |> Array.iteri (fun i p ->
QueueAsync
innerCTS.Token
// on success, record the result
@@ -1240,9 +1437,9 @@ namespace Microsoft.FSharp.Control
| Some maxDegreeOfParallelism ->
let mutable i = -1
let rec worker (trampolineHolder : TrampolineHolder) =
- if i < tasks.Length then
+ if i < computations.Length then
let j = Interlocked.Increment &i
- if j < tasks.Length then
+ if j < computations.Length then
if innerCTS.Token.IsCancellationRequested then
let cexn = OperationCanceledException (innerCTS.Token)
recordFailure (Choice2Of2 cexn) |> unfake
@@ -1255,7 +1452,7 @@ namespace Microsoft.FSharp.Control
(fun res -> recordSuccess j res |> unfake; worker trampolineHolder)
(fun edi -> recordFailure (Choice1Of2 edi) |> unfake; worker trampolineHolder)
(fun cexn -> recordFailure (Choice2Of2 cexn) |> unfake; worker trampolineHolder)
- tasks.[j].Invoke taskCtxt |> unfake
+ computations.[j].Invoke taskCtxt |> unfake
fake()
for x = 1 to maxDegreeOfParallelism do
let trampolineHolder = TrampolineHolder()
@@ -1265,37 +1462,41 @@ namespace Microsoft.FSharp.Control
fake()))
- static member Sequential (computations: seq>) = Async.Parallel(computations, maxDegreeOfParallelism=1)
+ static member Sequential (computations: seq>) =
+ Async.Parallel(computations, maxDegreeOfParallelism=1)
static member Choice(computations: Async<'T option> seq) : Async<'T option> =
- MakeAsync (fun ctxt ->
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ // manually protect eval of seq
let result =
- try Seq.toArray computations |> Choice1Of2
- with exn -> ExceptionDispatchInfo.RestoreOrCapture exn |> Choice2Of2
+ try
+ Choice1Of2 (Seq.toArray computations)
+ with exn ->
+ Choice2Of2 (ExceptionDispatchInfo.RestoreOrCapture exn)
match result with
| Choice2Of2 edi -> ctxt.econt edi
- | Choice1Of2 [||] -> ctxt.cont None
+ | Choice1Of2 [| |] -> ctxt.cont None
| Choice1Of2 computations ->
- ProtectedCode ctxt (fun ctxt ->
- let ctxtWithSync = DelimitSyncContext ctxt
+ let ctxt = DelimitSyncContext ctxt
+ ctxt.ProtectCode (fun () ->
let mutable count = computations.Length
let mutable noneCount = 0
let mutable someOrExnCount = 0
- let innerCts = new LinkedSubSource(ctxtWithSync.token)
+ let innerCts = new LinkedSubSource(ctxt.token)
let scont (result: 'T option) =
let result =
match result with
| Some _ ->
if Interlocked.Increment &someOrExnCount = 1 then
- innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont result)
+ innerCts.Cancel(); ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.cont result)
else
fake()
| None ->
if Interlocked.Increment &noneCount = computations.Length then
- innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.cont None)
+ innerCts.Cancel(); ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.cont None)
else
fake()
@@ -1307,7 +1508,7 @@ namespace Microsoft.FSharp.Control
let econt (exn: ExceptionDispatchInfo) =
let result =
if Interlocked.Increment &someOrExnCount = 1 then
- innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.econt exn)
+ innerCts.Cancel(); ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.econt exn)
else
fake()
@@ -1316,10 +1517,10 @@ namespace Microsoft.FSharp.Control
result
- let ccont (exn: OperationCanceledException) =
+ let ccont (cexn: OperationCanceledException) =
let result =
if Interlocked.Increment &someOrExnCount = 1 then
- innerCts.Cancel(); ctxtWithSync.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxtWithSync.ccont exn)
+ innerCts.Cancel(); ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.ccont cexn)
else
fake()
@@ -1328,8 +1529,8 @@ namespace Microsoft.FSharp.Control
result
- for c in computations do
- QueueAsync innerCts.Token scont econt ccont c |> unfake
+ for computation in computations do
+ QueueAsync innerCts.Token scont econt ccont computation |> unfake
fake()))
@@ -1358,44 +1559,37 @@ namespace Microsoft.FSharp.Control
AsyncPrimitives.StartWithContinuations cancellationToken computation id (fun edi -> edi.ThrowAny()) ignore
static member Sleep (millisecondsDueTime: int64) : Async =
- CreateDelimitedUserCodeAsync (fun ctxt ->
- let mutable timer = None: Timer option
- let cont = ctxt.cont
- let ccont = ctxt.ccont
- let latch = Latch()
- let registration =
- ctxt.token.Register(
- (fun () ->
- if latch.Enter() then
- match timer with
- | None -> ()
- | Some t -> t.Dispose()
- ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ccont(OperationCanceledException(ctxt.token))) |> unfake)
- )
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ let ctxt = DelimitSyncContext ctxt
let mutable edi = null
+ let latch = Latch()
+ let mutable timer: Timer option = None
+ let mutable registration: CancellationTokenRegistration option = None
+ registration <-
+ ctxt.token.Register(Action(fun () ->
+ if latch.Enter() then
+ // Make sure we're not cancelled again
+ DisposeCancellationRegistration ®istration
+ DisposeTimer &timer
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.ccont(OperationCanceledException(ctxt.token))) |> unfake)
+ ) |> Some
try
- timer <- new Timer((fun _ ->
+ timer <- new Timer(TimerCallback(fun _ ->
if latch.Enter() then
- // NOTE: If the CTS for the token would have been disposed, disposal of the registration would throw
- // However, our contract is that until async computation ceases execution (and invokes ccont)
- // the CTS will not be disposed. Execution of savedCCont is guarded by latch, so we are safe unless
- // user violates the contract.
- registration.Dispose()
- // Try to Dispose of the Timer.
- // Note: there is a race here: the Timer time very occasionally
- // calls the callback _before_ the timer object has been recorded anywhere. This makes it difficult to dispose the
- // timer in this situation. In this case we just let the timer be collected by finalization.
- match timer with
- | None -> ()
- | Some t -> t.Dispose()
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+ DisposeTimer &timer
// Now we're done, so call the continuation
- ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> cont()) |> unfake),
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.cont()) |> unfake),
null, dueTime=millisecondsDueTime, period = -1L) |> Some
with exn ->
if latch.Enter() then
- // post exception to econt only if we successfully enter the latch (no other continuations were called)
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+ // Prepare to call exception continuation
edi <- ExceptionDispatchInfo.RestoreOrCapture exn
+ // Call exception continuation if necessary
match edi with
| null ->
fake()
@@ -1413,74 +1607,72 @@ namespace Microsoft.FSharp.Control
/// Wait for a wait handle. Both timeout and cancellation are supported
static member AwaitWaitHandle(waitHandle: WaitHandle, ?millisecondsTimeout:int) =
- let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite
- if millisecondsTimeout = 0 then
- async.Delay(fun () ->
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite
+ if millisecondsTimeout = 0 then
let ok = waitHandle.WaitOne(0, exitContext=false)
- async.Return ok)
- else
- CreateDelimitedUserCodeAsync(fun ctxt ->
- let aux = ctxt.aux
- let rwh = ref (None: RegisteredWaitHandle option)
+ ctxt.cont ok
+ else
+ let ctxt = DelimitSyncContext ctxt
+ let mutable edi = null
let latch = Latch()
- let rec cancelHandler =
- Action(fun () ->
+ let mutable rwh: RegisteredWaitHandle option = None
+ let mutable registration: CancellationTokenRegistration option = None
+ registration <-
+ ctxt.token.Register(Action(fun () ->
if latch.Enter() then
- // if we got here - then we need to unregister RegisteredWaitHandle + trigger cancellation
- // entrance to TP callback is protected by latch - so savedCont will never be called
- lock rwh (fun () ->
- match !rwh with
- | None -> ()
- | Some rwh -> rwh.Unregister null |> ignore)
- Async.Start (async { do (ctxt.ccont (OperationCanceledException(aux.token)) |> unfake) }))
+ // Make sure we're not cancelled again
+ DisposeCancellationRegistration ®istration
+
+ UnregisterWaitHandle &rwh
- and registration: CancellationTokenRegistration = aux.token.Register(cancelHandler)
+ // Call the cancellation continuation
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.ccont(OperationCanceledException(ctxt.token))) |> unfake))
+ |> Some
- let savedCont = ctxt.cont
try
- lock rwh (fun () ->
- rwh := Some(ThreadPool.RegisterWaitForSingleObject
- (waitObject=waitHandle,
- callBack=WaitOrTimerCallback(fun _ timeOut ->
- if latch.Enter() then
- lock rwh (fun () -> rwh.Value.Value.Unregister null |> ignore)
- rwh := None
- registration.Dispose()
- ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> savedCont (not timeOut)) |> unfake),
- state=null,
- millisecondsTimeOutInterval=millisecondsTimeout,
- executeOnlyOnce=true))
- fake())
- with _ ->
+ rwh <- ThreadPool.RegisterWaitForSingleObject(waitObject=waitHandle,
+ callBack=WaitOrTimerCallback(fun _ timeOut ->
+ if latch.Enter() then
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+ UnregisterWaitHandle &rwh
+ // Call the success continuation
+ ctxt.trampolineHolder.ExecuteWithTrampoline (fun () -> ctxt.cont (not timeOut)) |> unfake),
+ state=null,
+ millisecondsTimeOutInterval=millisecondsTimeout,
+ executeOnlyOnce=true)
+ |> Some
+ with exn ->
if latch.Enter() then
- registration.Dispose()
- reraise() // reraise exception only if we successfully enter the latch (no other continuations were called)
- else
- fake()
- )
-
- static member AwaitIAsyncResult(iar: IAsyncResult, ?millisecondsTimeout): Async =
- async { if iar.CompletedSynchronously then
- return true
- else
- return! Async.AwaitWaitHandle(iar.AsyncWaitHandle, ?millisecondsTimeout=millisecondsTimeout) }
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+ // Prepare to call exception continuation
+ edi <- ExceptionDispatchInfo.RestoreOrCapture exn
+ // Call exception continuation if necessary
+ match edi with
+ | null ->
+ fake()
+ | _ ->
+ // Call the exception continuation
+ ctxt.econt edi)
- /// Bind the result of a result cell, calling the appropriate continuation.
- static member BindResult (result: AsyncResult<'T>) : Async<'T> =
- MakeAsync (fun ctxt ->
- (match result with
- | Ok v -> ctxt.cont v
- | Error exn -> ctxt.econt exn
- | Canceled exn -> ctxt.ccont exn) )
+ static member AwaitIAsyncResult(iar: IAsyncResult, ?millisecondsTimeout) =
+ async {
+ if iar.CompletedSynchronously then
+ return true
+ else
+ return! Async.AwaitWaitHandle(iar.AsyncWaitHandle, ?millisecondsTimeout=millisecondsTimeout)
+ }
/// Await and use the result of a result cell. The resulting async doesn't support cancellation
/// or timeout directly, rather the underlying computation must fill the result if cancellation
/// or timeout occurs.
- static member AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell: ResultCell>) : Async<'T> =
+ static member AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell: ResultCell>) =
async {
let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout
- return! Async.BindResult result
+ return! CreateAsyncResultAsync result
}
/// Await the result of a result cell belonging to a child computation. The resulting async supports timeout and if
@@ -1498,81 +1690,80 @@ namespace Microsoft.FSharp.Control
else
return raise (System.TimeoutException()) }
| _ ->
- async { try
- if resultCell.ResultAvailable then
- let res = resultCell.GrabResult()
- return res.Commit()
- else
- let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(), ?millisecondsTimeout=millisecondsTimeout)
- if ok then
+ async {
+ try
+ if resultCell.ResultAvailable then
+ let res = resultCell.GrabResult()
+ return res.Commit()
+ else
+ let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(), ?millisecondsTimeout=millisecondsTimeout)
+ if ok then
let res = resultCell.GrabResult()
return res.Commit()
- else // timed out
+ else // timed out
// issue cancellation signal
innerCTS.Cancel()
// wait for computation to quiesce
let! _ = Async.AwaitWaitHandle (resultCell.GetWaitHandle())
return raise (System.TimeoutException())
- finally
- resultCell.Close() }
+ finally
+ resultCell.Close()
+ }
static member FromBeginEnd(beginAction, endAction, ?cancelAction): Async<'T> =
- async { let! cancellationToken = cancellationTokenAsync
- let resultCell = new ResultCell<_>()
-
- let once = Once()
+ async {
+ let! ct = cancellationTokenAsync
+ let resultCell = new ResultCell<_>()
- let registration: CancellationTokenRegistration =
+ let latch = Latch()
+ let mutable registration: CancellationTokenRegistration option = None
+ registration <-
+ ct.Register(Action(fun () ->
+ if latch.Enter() then
+ // Make sure we're not cancelled again
+ DisposeCancellationRegistration ®istration
- let onCancel () =
- // Call the cancellation routine
+ // Call the cancellation function. Ignore any exceptions from the
+ // cancellation function.
match cancelAction with
- | None ->
- // Register the result. This may race with a successful result, but
- // ResultCell allows a race and throws away whichever comes last.
- once.Do(fun () ->
- let canceledResult = Canceled (OperationCanceledException cancellationToken)
- resultCell.RegisterResult(canceledResult, reuseThread=true) |> unfake
- )
+ | None -> ()
| Some cancel ->
- // If we get an exception from a cooperative cancellation function
- // we assume the operation has already completed.
try cancel() with _ -> ()
- cancellationToken.Register(Action(onCancel))
-
- let callback =
- System.AsyncCallback(fun iar ->
- if not iar.CompletedSynchronously then
- // The callback has been activated, so ensure cancellation is not possible
- // beyond this point.
- match cancelAction with
- | Some _ ->
- registration.Dispose()
- | None ->
- once.Do(fun () -> registration.Dispose())
-
- // Run the endAction and collect its result.
- let res =
- try
- Ok(endAction iar)
- with exn ->
- let edi = ExceptionDispatchInfo.RestoreOrCapture exn
- Error edi
-
- // Register the result. This may race with a cancellation result, but
- // ResultCell allows a race and throws away whichever comes last.
- resultCell.RegisterResult(res, reuseThread=true) |> unfake)
-
- let (iar:IAsyncResult) = beginAction (callback, (null:obj))
- if iar.CompletedSynchronously then
- registration.Dispose()
- return endAction iar
- else
- // Note: ok to use "NoDirectCancel" here because cancellation has been registered above
- // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method
- return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout resultCell }
+ // Register the cancellation result.
+ let canceledResult = Canceled (OperationCanceledException ct)
+ resultCell.RegisterResult(canceledResult, reuseThread=true) |> unfake))
+ |> Some
+
+ let callback =
+ AsyncCallback(fun iar ->
+ if not iar.CompletedSynchronously then
+ if latch.Enter() then
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+
+ // Run the endAction and collect its result.
+ let res =
+ try
+ Ok(endAction iar)
+ with exn ->
+ let edi = ExceptionDispatchInfo.RestoreOrCapture exn
+ Error edi
+
+ // Register the result.
+ resultCell.RegisterResult(res, reuseThread=true) |> unfake)
+
+ let (iar:IAsyncResult) = beginAction (callback, (null:obj))
+ if iar.CompletedSynchronously then
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
+ return endAction iar
+ else
+ // Note: ok to use "NoDirectCancel" here because cancellation has been registered above
+ // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method
+ return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout resultCell
+ }
static member FromBeginEnd(arg, beginAction, endAction, ?cancelAction): Async<'T> =
@@ -1595,44 +1786,52 @@ namespace Microsoft.FSharp.Control
beginAction, AsBeginEndHelpers.endAction<'T>, AsBeginEndHelpers.cancelAction<'T>
static member AwaitEvent(event:IEvent<'Delegate, 'T>, ?cancelAction) : Async<'T> =
- async { let! cancellationToken = cancellationTokenAsync
- let resultCell = new ResultCell<_>()
- // Set up the handlers to listen to events and cancellation
- let once = Once()
- let rec registration: CancellationTokenRegistration=
- let onCancel () =
- // We've been cancelled. Call the given cancellation routine
+ async {
+ let! ct = cancellationTokenAsync
+ let resultCell = new ResultCell<_>()
+ // Set up the handlers to listen to events and cancellation
+ let latch = Latch()
+ let mutable registration: CancellationTokenRegistration option = None
+ let mutable del: 'Delegate option = None
+ registration <-
+ ct.Register(Action(fun () ->
+ if latch.Enter() then
+ // Make sure we're not cancelled again
+ DisposeCancellationRegistration ®istration
+
+ // Stop listening to events
+ RemoveHandler event &del
+
+ // Call the given cancellation routine if we've been given one
+ // Exceptions from a cooperative cancellation are ignored.
match cancelAction with
- | None ->
- // We've been cancelled without a cancel action. Stop listening to events
- event.RemoveHandler del
- // Register the result. This may race with a successful result, but
- // ResultCell allows a race and throws away whichever comes last.
- once.Do(fun () -> resultCell.RegisterResult(Canceled (OperationCanceledException cancellationToken), reuseThread=true) |> unfake)
+ | None -> ()
| Some cancel ->
- // If we get an exception from a cooperative cancellation function
- // we assume the operation has already completed.
try cancel() with _ -> ()
- cancellationToken.Register(Action(onCancel))
+
+ // Register the cancellation result.
+ resultCell.RegisterResult(Canceled (OperationCanceledException ct), reuseThread=true) |> unfake
+ )) |> Some
+
+ let del =
+ FuncDelegate<'T>.Create<'Delegate>(fun eventArgs ->
+ if latch.Enter() then
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration
- and del =
- FuncDelegate<'T>.Create<'Delegate>(fun eventArgs ->
// Stop listening to events
- event.RemoveHandler del
- // The callback has been activated, so ensure cancellation is not possible beyond this point
- once.Do(fun () -> registration.Dispose())
- let res = Ok eventArgs
- // Register the result. This may race with a cancellation result, but
- // ResultCell allows a race and throws away whichever comes last.
- resultCell.RegisterResult(res, reuseThread=true) |> unfake)
-
- // Start listening to events
- event.AddHandler del
-
- // Return the async computation that allows us to await the result
- // Note: ok to use "NoDirectCancel" here because cancellation has been registered above
- // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method
- return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout resultCell }
+ RemoveHandler event &del
+
+ // Register the successful result.
+ resultCell.RegisterResult(Ok eventArgs, reuseThread=true) |> unfake)
+
+ // Start listening to events
+ event.AddHandler del
+
+ // Return the async computation that allows us to await the result
+ // Note: ok to use "NoDirectCancel" here because cancellation has been registered above
+ // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method
+ return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout resultCell }
static member Ignore (computation: Async<'T>) = CreateIgnoreAsync computation
@@ -1643,65 +1842,86 @@ namespace Microsoft.FSharp.Control
static member StartChild (computation:Async<'T>, ?millisecondsTimeout) =
async {
let resultCell = new ResultCell<_>()
- let! cancellationToken = cancellationTokenAsync
+ let! ct = cancellationTokenAsync
let innerCTS = new CancellationTokenSource() // innerCTS does not require disposal
let mutable ctsRef = innerCTS
- let reg = cancellationToken.Register(
- (fun () ->
- match ctsRef with
- | null -> ()
- | otherwise -> otherwise.Cancel()))
+ let registration =
+ ct.Register(Action(fun () ->
+ match ctsRef with
+ | null -> ()
+ | otherwise -> otherwise.Cancel()))
+
do QueueAsync
innerCTS.Token
// since innerCTS is not ever Disposed, can call reg.Dispose() without a safety Latch
- (fun res -> ctsRef <- null; reg.Dispose(); resultCell.RegisterResult (Ok res, reuseThread=true))
- (fun edi -> ctsRef <- null; reg.Dispose(); resultCell.RegisterResult (Error edi, reuseThread=true))
- (fun err -> ctsRef <- null; reg.Dispose(); resultCell.RegisterResult (Canceled err, reuseThread=true))
+ (fun res -> ctsRef <- null; registration.Dispose(); resultCell.RegisterResult (Ok res, reuseThread=true))
+ (fun edi -> ctsRef <- null; registration.Dispose(); resultCell.RegisterResult (Error edi, reuseThread=true))
+ (fun err -> ctsRef <- null; registration.Dispose(); resultCell.RegisterResult (Canceled err, reuseThread=true))
computation
|> unfake
return Async.AwaitAndBindChildResult(innerCTS, resultCell, millisecondsTimeout) }
static member SwitchToContext syncContext =
- async { match syncContext with
- | null ->
- // no synchronization context, just switch to the thread pool
- do! Async.SwitchToThreadPool()
- | syncCtxt ->
- // post the continuation to the synchronization context
- return! CreateSwitchToAsync syncCtxt }
+ async {
+ match syncContext with
+ | null ->
+ // no synchronization context, just switch to the thread pool
+ do! Async.SwitchToThreadPool()
+ | syncCtxt ->
+ // post the continuation to the synchronization context
+ return! CreateSwitchToAsync syncCtxt
+ }
static member OnCancel interruption =
- async { let! cancellationToken = cancellationTokenAsync
- // latch protects CancellationTokenRegistration.Dispose from being called twice
- let latch = Latch()
- let rec handler () =
- try
- if latch.Enter() then registration.Dispose()
- interruption ()
- with _ -> ()
- and registration: CancellationTokenRegistration = cancellationToken.Register(Action(handler))
- return { new System.IDisposable with
- member this.Dispose() =
- // dispose CancellationTokenRegistration only if cancellation was not requested.
- // otherwise - do nothing, disposal will be performed by the handler itself
- if not cancellationToken.IsCancellationRequested then
- if latch.Enter() then registration.Dispose() } }
+ async {
+ let! ct = cancellationTokenAsync
+ // latch protects cancellation and disposal contention
+ let latch = Latch()
+ let mutable registration: CancellationTokenRegistration option = None
+ registration <-
+ ct.Register(Action(fun () ->
+ if latch.Enter() then
+ // Make sure we're not cancelled again
+ DisposeCancellationRegistration ®istration
+ try
+ interruption ()
+ with _ -> ()))
+ |> Some
+ let disposer =
+ { new System.IDisposable with
+ member _.Dispose() =
+ // dispose CancellationTokenRegistration only if cancellation was not requested.
+ // otherwise - do nothing, disposal will be performed by the handler itself
+ if not ct.IsCancellationRequested then
+ if latch.Enter() then
+ // Ensure cancellation is not possible beyond this point
+ DisposeCancellationRegistration ®istration }
+ return disposer
+ }
static member TryCancelled (computation: Async<'T>, compensation) =
CreateWhenCancelledAsync compensation computation
static member AwaitTask (task:Task<'T>) : Async<'T> =
- if task.IsCompleted then
- CreateProtectedAsync (fun ctxt -> taskContinueWith task ctxt)
- else
- CreateDelimitedUserCodeAsync (fun ctxt -> taskContinueWith task ctxt)
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ if task.IsCompleted then
+ // Run synchronously without installing new trampoline
+ OnTaskCompleted task ctxt
+ else
+ // Continue asynchronously, via syncContext if necessary, installing new trampoline
+ let ctxt = DelimitSyncContext ctxt
+ ctxt.ProtectCode (fun () -> AttachContinuationToTask task ctxt))
static member AwaitTask (task:Task) : Async =
- if task.IsCompleted then
- CreateProtectedAsync (fun ctxt -> taskContinueWithUnit task ctxt)
- else
- CreateDelimitedUserCodeAsync (fun ctxt -> taskContinueWithUnit task ctxt)
+ MakeAsyncWithCancelCheck (fun ctxt ->
+ if task.IsCompleted then
+ // Continue synchronously without installing new trampoline
+ OnUnitTaskCompleted task ctxt
+ else
+ // Continue asynchronously, via syncContext if necessary, installing new trampoline
+ let ctxt = DelimitSyncContext ctxt
+ ctxt.ProtectCode (fun () -> AttachContinuationToUnitTask task ctxt))
module CommonExtensions =
@@ -1715,14 +1935,16 @@ namespace Microsoft.FSharp.Control
[] // give the extension member a 'nice', unmangled compiled name, unique within this module
member stream.AsyncRead count =
- async { let buffer = Array.zeroCreate count
- let mutable i = 0
- while i < count do
- let! n = stream.AsyncRead(buffer, i, count - i)
- i <- i + n
- if n = 0 then
- raise(System.IO.EndOfStreamException(SR.GetString(SR.failedReadEnoughBytes)))
- return buffer }
+ async {
+ let buffer = Array.zeroCreate count
+ let mutable i = 0
+ while i < count do
+ let! n = stream.AsyncRead(buffer, i, count - i)
+ i <- i + n
+ if n = 0 then
+ raise(System.IO.EndOfStreamException(SR.GetString(SR.failedReadEnoughBytes)))
+ return buffer
+ }
[] // give the extension member a 'nice', unmangled compiled name, unique within this module
member stream.AsyncWrite(buffer:byte[], ?offset:int, ?count:int) =
@@ -1759,7 +1981,7 @@ namespace Microsoft.FSharp.Control
| :? System.Net.WebException as webExn
when webExn.Status = System.Net.WebExceptionStatus.RequestCanceled && canceled ->
- Some (Async.BindResult(AsyncResult.Canceled (OperationCanceledException webExn.Message)))
+ Some (CreateAsyncResultAsync(AsyncResult.Canceled (OperationCanceledException webExn.Message)))
| _ ->
None)
diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fs b/src/fsharp/InnerLambdasToTopLevelFuncs.fs
index fb070b66176..7721d0ccbac 100644
--- a/src/fsharp/InnerLambdasToTopLevelFuncs.fs
+++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fs
@@ -967,14 +967,13 @@ module Pass4_RewriteAssembly =
// pass4: lowertop - convert_vterm_bind on TopLevel binds
//-------------------------------------------------------------------------
- let AdjustBindToTopVal g (TBind(v, repr, _)) =
+ let ConvertBind g (TBind(v, repr, _) as bind) =
match v.ValReprInfo with
- | None ->
- v.SetValReprInfo (Some (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v repr ))
- // Things that don't have an arity from type inference but are top-level are compiler-generated
- v.SetIsCompilerGenerated(true)
+ | None -> v.SetValReprInfo (Some (InferArityOfExprBinding g AllowTypeDirectedDetupling.Yes v repr ))
| Some _ -> ()
+ bind
+
//-------------------------------------------------------------------------
// pass4: transBind (translate)
//-------------------------------------------------------------------------
@@ -1036,9 +1035,6 @@ module Pass4_RewriteAssembly =
| None -> List.empty // no env for this mutual binding
| Some envp -> envp.ep_pack // environment pack bindings
- let forceTopBindToHaveArity penv (bind: Binding) =
- if penv.topValS.Contains(bind.Var) then AdjustBindToTopVal penv.g bind
-
let TransBindings xisRec penv (binds: Bindings) =
let tlrBs, nonTlrBs = binds |> List.partition (fun b -> Zset.contains b.Var penv.tlrS)
let fclass = BindingGroupSharingSameReqdItems tlrBs
@@ -1049,9 +1045,12 @@ module Pass4_RewriteAssembly =
// QUERY: we repeat this logic in LowerCallsAndSeqs. Do we really need to do this here?
// QUERY: yes and no - if we don't, we have an unrealizable term, and many decisions must
// QUERY: correlate with LowerCallsAndSeqs.
+ let forceTopBindToHaveArity (bind: Binding) =
+ if penv.topValS.Contains(bind.Var) then ConvertBind penv.g bind
+ else bind
- nonTlrBs |> List.iter (forceTopBindToHaveArity penv)
- tlrRebinds |> List.iter (forceTopBindToHaveArity penv)
+ let nonTlrBs = nonTlrBs |> List.map forceTopBindToHaveArity
+ let tlrRebinds = tlrRebinds |> List.map forceTopBindToHaveArity
// assemble into replacement bindings
let bindAs, rebinds =
match xisRec with
@@ -1068,7 +1067,7 @@ module Pass4_RewriteAssembly =
// Is it a val app, where the val f is TLR with arity wf?
// CLEANUP NOTE: should be using a mkApps to make all applications
match fx with
- | Expr.Val (fvref: ValRef, _, vm) when
+ | Expr.Val (fvref: ValRef, _, m) when
(Zset.contains fvref.Deref penv.tlrS) &&
(let wf = Zmap.force fvref.Deref penv.arityM ("TransApp - wf", nameOfVal)
IsArityMet fvref wf tys args) ->
@@ -1079,9 +1078,9 @@ module Pass4_RewriteAssembly =
let envp = Zmap.force fc penv.envPackM ("TransApp - envp", string)
let fHat = Zmap.force f penv.fHatM ("TransApp - fHat", nameOfVal)
let tys = (List.map mkTyparTy envp.ep_etps) @ tys
- let aenvExprs = List.map (exprForVal vm) envp.ep_aenvs
+ let aenvExprs = List.map (exprForVal m) envp.ep_aenvs
let args = aenvExprs @ args
- mkApps penv.g ((exprForVal vm fHat, fHat.Type), [tys], args, m) (* change, direct fHat call with closure (reqdTypars, aenvs) *)
+ mkApps penv.g ((exprForVal m fHat, fHat.Type), [tys], args, m) (* change, direct fHat call with closure (reqdTypars, aenvs) *)
| _ ->
if isNil tys && isNil args then
fx
diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs
index 3643a31ff47..b9edef9a7a3 100644
--- a/src/fsharp/MethodCalls.fs
+++ b/src/fsharp/MethodCalls.fs
@@ -218,13 +218,19 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT
| minfo :: _ ->
Some (minfo, (reqdTy, reqdTy2, fun denv ->
let reqdTy2Text, actualTyText, _cxs = NicePrint.minimalStringsOfTwoTypes denv reqdTy2 actualTy
- errorR(Error(FSComp.SR.tcAmbiguousImplicitConversion(actualTyText, reqdTy2Text), m))))
+ let implicitsText = NicePrint.multiLineStringOfMethInfos infoReader m denv implicits
+ errorR(Error(FSComp.SR.tcAmbiguousImplicitConversion(actualTyText, reqdTy2Text, implicitsText), m))))
| _ -> None
else
None
else
None
+[]
+type TypeDirectedConversion =
+ | BuiltIn
+ | Implicit of MethInfo
+
[]
type TypeDirectedConversionUsed =
| Yes of (DisplayEnv -> exn)
@@ -243,9 +249,14 @@ let MapCombineTDC2D mapper xs ys =
let rec AdjustRequiredTypeForTypeDirectedConversions (infoReader: InfoReader) ad isConstraint (reqdTy: TType) actualTy m =
let g = infoReader.g
- let warn denv =
+ let warn info denv =
let reqdTyText, actualTyText, _cxs = NicePrint.minimalStringsOfTwoTypes denv reqdTy actualTy
- Error(FSComp.SR.tcImplicitConversionUsed(actualTyText, reqdTyText), m)
+ match info with
+ | TypeDirectedConversion.BuiltIn ->
+ Error(FSComp.SR.tcImplicitConversionUsed(actualTyText, reqdTyText), m)
+ | TypeDirectedConversion.Implicit convMeth ->
+ let methText = NicePrint.stringOfMethInfo infoReader m denv convMeth
+ Error(FSComp.SR.tcImplicitConversionUsed2(methText, actualTyText, reqdTyText), m)
if isConstraint then
reqdTy, TypeDirectedConversionUsed.No, None
@@ -262,17 +273,21 @@ let rec AdjustRequiredTypeForTypeDirectedConversions (infoReader: InfoReader) ad
// Adhoc int32 --> int64
elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.int64_ty reqdTy && typeEquiv g g.int32_ty actualTy then
- g.int32_ty, TypeDirectedConversionUsed.Yes(warn), None
+ g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None
+
+ // Adhoc int32 --> nativeint
+ elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.nativeint_ty reqdTy && typeEquiv g g.int32_ty actualTy then
+ g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None
// Adhoc int32 --> float64
elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.float_ty reqdTy && typeEquiv g g.int32_ty actualTy then
- g.int32_ty, TypeDirectedConversionUsed.Yes(warn), None
+ g.int32_ty, TypeDirectedConversionUsed.Yes(warn TypeDirectedConversion.BuiltIn), None
// Adhoc based on op_Implicit, perhaps returing a new equational type constraint to
// eliminate articifical constrained type variables.
elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions then
match TryFindRelevantImplicitConversion infoReader ad reqdTy actualTy m with
- | Some (_minfo, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn), Some eqn
+ | Some (minfo, eqn) -> actualTy, TypeDirectedConversionUsed.Yes(warn (TypeDirectedConversion.Implicit minfo)), Some eqn
| None -> reqdTy, TypeDirectedConversionUsed.No, None
else reqdTy, TypeDirectedConversionUsed.No, None
@@ -1204,6 +1219,10 @@ let rec AdjustExprForTypeDirectedConversions tcVal (g: TcGlobals) amap infoReade
elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.int64_ty reqdTy && typeEquiv g g.int32_ty actualTy then
mkCallToInt64Operator g m actualTy expr
+ // Adhoc int32 --> nativeint
+ elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.nativeint_ty reqdTy && typeEquiv g g.int32_ty actualTy then
+ mkCallToIntPtrOperator g m actualTy expr
+
// Adhoc int32 --> float64
elif g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions && typeEquiv g g.float_ty reqdTy && typeEquiv g g.int32_ty actualTy then
mkCallToDoubleOperator g m actualTy expr
diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs
index 4cf03cb77ec..6ec8c38b2dd 100755
--- a/src/fsharp/NicePrint.fs
+++ b/src/fsharp/NicePrint.fs
@@ -2214,7 +2214,15 @@ let prettyLayoutOfMethInfoFreeStyle infoReader m denv typarInst minfo = InfoMemb
let prettyLayoutOfPropInfoFreeStyle g amap m denv d = InfoMemberPrinting.prettyLayoutOfPropInfoFreeStyle g amap m denv d
/// Convert a MethInfo to a string
-let stringOfMethInfo infoReader m denv d = bufs (fun buf -> InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf d)
+let stringOfMethInfo infoReader m denv minfo =
+ bufs (fun buf -> InfoMemberPrinting.formatMethInfoToBufferFreeStyle infoReader m denv buf minfo)
+
+/// Convert MethInfos to lines separated by newline including a newline as the first character
+let multiLineStringOfMethInfos infoReader m denv minfos =
+ minfos
+ |> List.map (stringOfMethInfo infoReader m denv)
+ |> List.map (sprintf "%s %s" System.Environment.NewLine)
+ |> String.concat ""
/// Convert a ParamData to a string
let stringOfParamData denv paramData = bufs (fun buf -> InfoMemberPrinting.formatParamDataToBuffer denv buf paramData)
diff --git a/src/fsharp/NicePrint.fsi b/src/fsharp/NicePrint.fsi
index fd7fc1cbd88..fece7c07232 100644
--- a/src/fsharp/NicePrint.fsi
+++ b/src/fsharp/NicePrint.fsi
@@ -58,7 +58,9 @@ val prettyLayoutOfMethInfoFreeStyle: infoReader:InfoReader -> m:range -> denv:Di
val prettyLayoutOfPropInfoFreeStyle: g:TcGlobals -> amap:ImportMap -> m:range -> denv:DisplayEnv -> d:PropInfo -> Layout
-val stringOfMethInfo: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> d:MethInfo -> string
+val stringOfMethInfo: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> minfo:MethInfo -> string
+
+val multiLineStringOfMethInfos: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> minfos:MethInfo list -> string
val stringOfParamData: denv:DisplayEnv -> paramData:ParamData -> string
diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs
index 6c61ca7985b..d579077b081 100644
--- a/src/fsharp/Optimizer.fs
+++ b/src/fsharp/Optimizer.fs
@@ -97,13 +97,13 @@ type ExprValueInfo =
| ConstValue of Const * TType
- /// CurriedLambdaValue(id, arity, size, lambdaExpression, isCrossAssembly, ty)
+ /// CurriedLambdaValue(id, arity, size, lambdaExpression, ty)
///
/// arities: The number of bunches of untupled args and type args, and
/// the number of args in each bunch. NOTE: This include type arguments.
/// expr: The value, a lambda term.
/// ty: The type of lambda term
- | CurriedLambdaValue of id: Unique * arity: int * size: int * lambdaExpr: Expr * isCrossAssembly: bool * lambdaExprTy: TType
+ | CurriedLambdaValue of id: Unique * arity: int * size: int * value: Expr * TType
/// ConstExprValue(size, value)
| ConstExprValue of size: int * value: Expr
@@ -202,7 +202,7 @@ let rec exprValueInfoL g exprVal =
| TupleValue vinfos -> bracketL (exprValueInfosL g vinfos)
| RecdValue (_, vinfos) -> braceL (exprValueInfosL g vinfos)
| UnionCaseValue (ucr, vinfos) -> unionCaseRefL ucr ^^ bracketL (exprValueInfosL g vinfos)
- | CurriedLambdaValue(_lambdaId, _arities, _bsize, expr, _isCrossAssembly, _ety) -> wordL (tagText "lam") ++ exprL expr (* (sprintf "lam(size=%d)" bsize) *)
+ | CurriedLambdaValue(_lambdaId, _arities, _bsize, expr, _ety) -> wordL (tagText "lam") ++ exprL expr (* (sprintf "lam(size=%d)" bsize) *)
| ConstExprValue (_size, x) -> exprL x
and exprValueInfosL g vinfos = commaListL (List.map (exprValueInfoL g) (Array.toList vinfos))
@@ -252,7 +252,7 @@ and SizeOfValueInfo x =
| TupleValue vinfos
| RecdValue (_, vinfos)
| UnionCaseValue (_, vinfos) -> 1 + SizeOfValueInfos vinfos
- | CurriedLambdaValue _ -> 1
+ | CurriedLambdaValue(_lambdaId, _arities, _bsize, _expr, _ety) -> 1
| ConstExprValue (_size, _) -> 1
let [] minDepthForASizeNode = 5 // for small vinfos do not record size info, save space
@@ -279,7 +279,7 @@ let BoundValueInfoBySize vinfo =
| UnionCaseValue (ucr, vinfos) -> UnionCaseValue (ucr, Array.map (bound (depth-1)) vinfos)
| ConstValue _ -> x
| UnknownValue -> x
- | CurriedLambdaValue _ -> x
+ | CurriedLambdaValue(_lambdaId, _arities, _bsize, _expr, _ety) -> x
| ConstExprValue (_size, _) -> x
let maxDepth = 6 (* beware huge constants! *)
let trimDepth = 3
@@ -661,7 +661,7 @@ let (|StripConstValue|_|) ev =
let (|StripLambdaValue|_|) ev =
match stripValue ev with
- | CurriedLambdaValue (id, arity, sz, expr, isCrossAssembly, ty) -> Some (id, arity, sz, expr, isCrossAssembly, ty)
+ | CurriedLambdaValue (id, arity, sz, expr, ty) -> Some (id, arity, sz, expr, ty)
| _ -> None
let destTupleValue ev =
@@ -1064,7 +1064,7 @@ let AbstractLazyModulInfoByHiding isAssemblyBoundary mhi =
else ValValue (vref2, detailR)
// Check for escape in lambda
- | CurriedLambdaValue (_, _, _, expr, _, _) | ConstExprValue(_, expr) when
+ | CurriedLambdaValue (_, _, _, expr, _) | ConstExprValue(_, expr) when
(let fvs = freeInExpr CollectAll expr
(isAssemblyBoundary && not (freeVarsAllPublic fvs)) ||
Zset.exists hiddenVal fvs.FreeLocals ||
@@ -1158,7 +1158,7 @@ let AbstractExprInfoByVars (boundVars: Val list, boundTyVars) ivalue =
ValValue (v2, detailR)
// Check for escape in lambda
- | CurriedLambdaValue (_, _, _, expr, _, _) | ConstExprValue(_, expr) when
+ | CurriedLambdaValue (_, _, _, expr, _) | ConstExprValue(_, expr) when
(let fvs = freeInExpr (if isNil boundTyVars then CollectLocals else CollectTyparsAndLocals) expr
(not (isNil boundVars) && List.exists (Zset.memberOf fvs.FreeLocals) boundVars) ||
(not (isNil boundTyVars) && List.exists (Zset.memberOf fvs.FreeTyvars.FreeTypars) boundTyVars) ||
@@ -1207,7 +1207,7 @@ let RemapOptimizationInfo g tmenv =
| UnionCaseValue(cspec, vinfos) -> UnionCaseValue (remapUnionCaseRef tmenv.tyconRefRemap cspec, Array.map remapExprInfo vinfos)
| SizeValue(_vdepth, vinfo) -> MakeSizedValueInfo (remapExprInfo vinfo)
| UnknownValue -> UnknownValue
- | CurriedLambdaValue (uniq, arity, sz, expr, isCrossAssembly, ty) -> CurriedLambdaValue (uniq, arity, sz, remapExpr g CloneAll tmenv expr, isCrossAssembly, remapPossibleForallTy g tmenv ty)
+ | CurriedLambdaValue (uniq, arity, sz, expr, ty) -> CurriedLambdaValue (uniq, arity, sz, remapExpr g CloneAll tmenv expr, remapPossibleForallTy g tmenv ty)
| ConstValue (c, ty) -> ConstValue (c, remapPossibleForallTy g tmenv ty)
| ConstExprValue (sz, expr) -> ConstExprValue (sz, remapExpr g CloneAll tmenv expr)
@@ -2557,17 +2557,6 @@ and OptimizeTraitCall cenv env (traitInfo, args, m) =
let argsR, arginfos = OptimizeExprsThenConsiderSplits cenv env args
OptimizeExprOpFallback cenv env (TOp.TraitCall traitInfo, [], argsR, m) arginfos UnknownValue
-and CopyExprForInlining cenv isCrossAssembly expr m =
- if isCrossAssembly then
- // Debug points are erased when doing cross-assembly inlining
- // Locals are marked compiler generated when doing cross-assembly inlining
- expr
- |> copyExpr cenv.g CloneAllAndMarkExprValsAsCompilerGenerated
- |> remarkExpr m
- else
- expr
- |> copyExpr cenv.g CloneAll
-
/// Make optimization decisions once we know the optimization information
/// for a value
and TryOptimizeVal cenv env (vOpt: ValRef option, mustInline, valInfoForVal, m) =
@@ -2590,10 +2579,9 @@ and TryOptimizeVal cenv env (vOpt: ValRef option, mustInline, valInfoForVal, m)
// If we have proven 'v = compilerGeneratedValue'
// and 'v' is being eliminated in favour of 'compilerGeneratedValue'
// then replace the name of 'compilerGeneratedValue'
- // by 'v' and mark it not compiler generated so we preserve good debugging and names.
- // Don't do this for things represented statically as it may publish multiple values with the same name.
+ // by 'v' and mark it not compiler generated so we preserve good debugging and names
match vOpt with
- | Some v when not v.IsCompilerGenerated && vR.IsCompilerGenerated && not vR.IsCompiledAsTopLevel && not v.IsCompiledAsTopLevel ->
+ | Some v when not v.IsCompilerGenerated && vR.IsCompilerGenerated ->
vR.Deref.SetIsCompilerGenerated(false)
vR.Deref.SetLogicalName(v.LogicalName)
| _ -> ()
@@ -2602,9 +2590,8 @@ and TryOptimizeVal cenv env (vOpt: ValRef option, mustInline, valInfoForVal, m)
| ConstExprValue(_size, expr) ->
Some (remarkExpr m (copyExpr cenv.g CloneAllAndMarkExprValsAsCompilerGenerated expr))
- | CurriedLambdaValue (_, _, _, expr, isCrossAssembly, _) when mustInline ->
- let exprCopy = CopyExprForInlining cenv isCrossAssembly expr m
- Some exprCopy
+ | CurriedLambdaValue (_, _, _, expr, _) when mustInline ->
+ Some (remarkExpr m (copyExpr cenv.g CloneAllAndMarkExprValsAsCompilerGenerated expr))
| TupleValue _ | UnionCaseValue _ | RecdValue _ when mustInline ->
failwith "tuple, union and record values cannot be marked 'inline'"
@@ -2900,7 +2887,7 @@ and TryDevirtualizeApplication cenv env (f, tyargs, args, m) =
and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m) =
// Considering inlining app
match finfo.Info with
- | StripLambdaValue (lambdaId, arities, size, f2, isCrossAssembly, f2ty) when
+ | StripLambdaValue (lambdaId, arities, size, f2, f2ty) when
(// Considering inlining lambda
cenv.optimizing &&
cenv.settings.InlineLambdas () &&
@@ -2961,8 +2948,7 @@ and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m)
// Inlining lambda
(* ---------- printf "Inlining lambda near %a = %s\n" outputRange m (showL (exprL f2)) (* JAMES: *) ----------*)
- let f2R = CopyExprForInlining cenv isCrossAssembly f2 m
-
+ let f2R = remarkExpr m (copyExpr cenv.g CloneAllAndMarkExprValsAsCompilerGenerated f2)
// Optimizing arguments after inlining
// REVIEW: this is a cheapshot way of optimizing the arg expressions as well without the restriction of recursive
@@ -2976,16 +2962,6 @@ and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m)
| _ -> None
-/// When optimizing a function in an application, use the whole range including arguments for the range
-/// to apply to 'inline' code
-and OptimizeFuncInApplication cenv env f0 mWithArgs =
- let f0 = stripExpr f0
- match f0 with
- | Expr.Val (v, _vFlags, _) ->
- OptimizeVal cenv env f0 (v, mWithArgs)
- | _ ->
- OptimizeExpr cenv env f0
-
/// Optimize/analyze an application of a function to type and term arguments
and OptimizeApplication cenv env (f0, f0ty, tyargs, args, m) =
// trying to devirtualize
@@ -2994,7 +2970,7 @@ and OptimizeApplication cenv env (f0, f0ty, tyargs, args, m) =
// devirtualized
res
| None ->
- let newf0, finfo = OptimizeFuncInApplication cenv env f0 m
+ let newf0, finfo = OptimizeExpr cenv env f0
match TryInlineApplication cenv env finfo (tyargs, args, m) with
| Some res ->
// inlined
@@ -3110,14 +3086,14 @@ and OptimizeLambdas (vspec: Val option) cenv env topValInfo e ety =
// can't inline any values with semi-recursive object references to self or base
let valu =
match baseValOpt with
- | None -> CurriedLambdaValue (lambdaId, arities, bsize, exprR, false, ety)
+ | None -> CurriedLambdaValue (lambdaId, arities, bsize, exprR, ety)
| Some baseVal ->
let fvs = freeInExpr CollectLocals bodyR
if fvs.UsesMethodLocalConstructs || fvs.FreeLocals.Contains baseVal then
UnknownValue
else
let expr2 = mkMemberLambdas m tps ctorThisValOpt None vsl (bodyR, bodyty)
- CurriedLambdaValue (lambdaId, arities, bsize, expr2, false, ety)
+ CurriedLambdaValue (lambdaId, arities, bsize, expr2, ety)
let estimatedSize =
match vspec with
@@ -3347,7 +3323,7 @@ and OptimizeBinding cenv isRec env (TBind(vref, expr, spBind)) =
// Trim out optimization information for expressions that call protected members
let rec cut ivalue =
match ivalue with
- | CurriedLambdaValue (_, arities, size, body, _, _) ->
+ | CurriedLambdaValue (_, arities, size, body, _) ->
if size > (cenv.settings.lambdaInlineThreshold + arities + 2) then
// Discarding lambda for large binding
UnknownValue
@@ -3624,7 +3600,7 @@ let rec p_ExprValueInfo x st =
| UnionCaseValue (a, b) ->
p_byte 4 st
p_tup2 p_ucref (p_array p_ExprValueInfo) (a, b) st
- | CurriedLambdaValue (_, b, c, d, _isCrossAssembly, e) ->
+ | CurriedLambdaValue (_, b, c, d, e) ->
p_byte 5 st
p_tup4 p_int p_int p_expr p_ty (b, c, d, e) st
| ConstExprValue (a, b) ->
@@ -3659,12 +3635,11 @@ let rec u_ExprInfo st =
| 2 -> u_tup2 u_vref loop st |> (fun (a, b) -> ValValue (a, b))
| 3 -> u_array loop st |> (fun a -> TupleValue a)
| 4 -> u_tup2 u_ucref (u_array loop) st |> (fun (a, b) -> UnionCaseValue (a, b))
- | 5 -> u_tup4 u_int u_int u_expr u_ty st |> (fun (b, c, d, e) -> CurriedLambdaValue (newUnique(), b, c, d, (* isCrossAssembly *) true, e))
+ | 5 -> u_tup4 u_int u_int u_expr u_ty st |> (fun (b, c, d, e) -> CurriedLambdaValue (newUnique(), b, c, d, e))
| 6 -> u_tup2 u_int u_expr st |> (fun (a, b) -> ConstExprValue (a, b))
| 7 -> u_tup2 u_tcref (u_array loop) st |> (fun (a, b) -> RecdValue (a, b))
| _ -> failwith "loop"
- // calc size of unpicked ExprValueInfo
- MakeSizedValueInfo (loop st)
+ MakeSizedValueInfo (loop st) (* calc size of unpicked ExprValueInfo *)
and u_ValInfo st =
let a, b = u_tup2 u_ExprInfo u_bool st
diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs
index d196a60e363..6008120291e 100644
--- a/src/fsharp/PostInferenceChecks.fs
+++ b/src/fsharp/PostInferenceChecks.fs
@@ -1639,7 +1639,9 @@ and CheckDecisionTreeTest cenv env m discrim =
| DecisionTreeTest.ActivePatternCase (exp, _, _, _, _, _) -> CheckExprNoByrefs cenv env exp
| DecisionTreeTest.Error _ -> ()
-and CheckAttrib cenv env (Attrib(_, _, args, props, _, _, _)) =
+and CheckAttrib cenv env (Attrib(tcref, _, args, props, _, _, m)) =
+ if List.exists (tyconRefEq cenv.g tcref) cenv.g.attribs_Unsupported then
+ warning(Error(FSComp.SR.unsupportedAttribute(), m))
props |> List.iter (fun (AttribNamedArg(_, _, _, expr)) -> CheckAttribExpr cenv env expr)
args |> List.iter (CheckAttribExpr cenv env)
diff --git a/src/fsharp/SyntaxTree.fs b/src/fsharp/SyntaxTree.fs
index efec365b65d..06e1b054ba0 100644
--- a/src/fsharp/SyntaxTree.fs
+++ b/src/fsharp/SyntaxTree.fs
@@ -1826,7 +1826,7 @@ type SynModuleOrNamespaceSig =
match this with
| SynModuleOrNamespaceSig (range=m) -> m
-[]
+[]
type ParsedHashDirectiveArgument =
| String of value: string * stringKind: SynStringKind * range: Range
| SourceIdentifier of constant: string * value: string * range: Range
diff --git a/src/fsharp/SyntaxTree.fsi b/src/fsharp/SyntaxTree.fsi
index a04fc70da39..4a82c325a5f 100644
--- a/src/fsharp/SyntaxTree.fsi
+++ b/src/fsharp/SyntaxTree.fsi
@@ -2015,7 +2015,7 @@ type SynModuleOrNamespaceSig =
member Range: range
/// Represents a parsed hash directive argument
-[]
+[]
type ParsedHashDirectiveArgument =
| String of value: string * stringKind: SynStringKind * range: Range
| SourceIdentifier of constant: string * value: string * range: Range
diff --git a/src/fsharp/SyntaxTreeOps.fs b/src/fsharp/SyntaxTreeOps.fs
index 0efa2344877..ce22c839900 100644
--- a/src/fsharp/SyntaxTreeOps.fs
+++ b/src/fsharp/SyntaxTreeOps.fs
@@ -174,10 +174,15 @@ let rec SimplePatOfPat (synArgNameGenerator: SynArgNameGenerator) p =
let id = mkSynId m nm
let item = mkSynIdGet m nm
true, None, id, item
- SynSimplePat.Id (id, altNameRefCell, isCompGen, false, false, id.idRange),
- Some (fun e ->
- let clause = SynMatchClause(p, None, e, m, DebugPointForTarget.No)
- SynExpr.Match (DebugPointAtBinding.NoneAtInvisible, item, [clause], clause.Range))
+ let fn =
+ match p with
+ | SynPat.Wild _ -> None
+ | _ ->
+ Some (fun e ->
+ let clause = SynMatchClause(p, None, e, m, DebugPointForTarget.No)
+ SynExpr.Match (DebugPointAtBinding.NoneAtInvisible, item, [clause], clause.Range))
+
+ SynSimplePat.Id (id, altNameRefCell, isCompGen, false, false, id.idRange), fn
let appFunOpt funOpt x = match funOpt with None -> x | Some f -> f x
diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs
index 80ef6017a0e..87b1810fe34 100755
--- a/src/fsharp/TcGlobals.fs
+++ b/src/fsharp/TcGlobals.fs
@@ -1202,6 +1202,10 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d
member val attrib_CallerFilePathAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerFilePathAttribute"
member val attrib_CallerMemberNameAttribute = findSysAttrib "System.Runtime.CompilerServices.CallerMemberNameAttribute"
member val attrib_SkipLocalsInitAttribute = findSysAttrib "System.Runtime.CompilerServices.SkipLocalsInitAttribute"
+ member val attribs_Unsupported = [
+ tryFindSysAttrib "System.Runtime.CompilerServices.ModuleInitializerAttribute"
+ tryFindSysAttrib "System.Runtime.CompilerServices.CallerArgumentExpressionAttribute"
+ ] |> List.choose (Option.map (fun x -> x.TyconRef))
member val attrib_ProjectionParameterAttribute = mk_MFCore_attrib "ProjectionParameterAttribute"
member val attrib_CustomOperationAttribute = mk_MFCore_attrib "CustomOperationAttribute"
diff --git a/src/fsharp/TypedTreeOps.fs b/src/fsharp/TypedTreeOps.fs
index 18b78371c1c..3cdda13adc8 100644
--- a/src/fsharp/TypedTreeOps.fs
+++ b/src/fsharp/TypedTreeOps.fs
@@ -7544,7 +7544,7 @@ let rec MakeApplicationAndBetaReduceAux g (f, fty, tyargsl: TType list list, arg
match f with
| Expr.TyLambda (_, tyvs, body, _, bodyty) when tyvs.Length = List.length tyargs ->
let tpenv = bindTypars tyvs tyargs emptyTyparInst
- let body = instExpr g tpenv body
+ let body = remarkExpr m (instExpr g tpenv body)
let bodyty' = instType tpenv bodyty
MakeApplicationAndBetaReduceAux g (body, bodyty', rest, argsl, m)
diff --git a/src/fsharp/absil/illib.fs b/src/fsharp/absil/illib.fs
index 904d5418592..f1ec999e55e 100644
--- a/src/fsharp/absil/illib.fs
+++ b/src/fsharp/absil/illib.fs
@@ -8,6 +8,7 @@ open System.Collections.Concurrent
open System.Diagnostics
open System.IO
open System.Threading
+open System.Threading.Tasks
open System.Runtime.CompilerServices
[]
@@ -86,6 +87,19 @@ module internal PervasiveAutoOpens =
let notFound() = raise (KeyNotFoundException())
+ type Async with
+ static member RunImmediate (computation: Async<'T>, ?cancellationToken ) =
+ let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken
+ let ts = TaskCompletionSource<'T>()
+ let task = ts.Task
+ Async.StartWithContinuations(
+ computation,
+ (fun k -> ts.SetResult k),
+ (fun exn -> ts.SetException exn),
+ (fun _ -> ts.SetCanceled()),
+ cancellationToken)
+ task.Result
+
[]
/// An efficient lazy for inline storage in a class type. Results in fewer thunks.
type InlineDelayInit<'T when 'T : not struct> =
diff --git a/src/fsharp/absil/illib.fsi b/src/fsharp/absil/illib.fsi
index 2a66a699857..fd21e0d038f 100644
--- a/src/fsharp/absil/illib.fsi
+++ b/src/fsharp/absil/illib.fsi
@@ -47,6 +47,10 @@ module internal PervasiveAutoOpens =
member inline EndsWithOrdinal: value:string -> bool
+ type Async with
+ /// Runs the computation synchronously, always starting on the current thread.
+ static member RunImmediate: computation: Async<'T> * ?cancellationToken: CancellationToken -> 'T
+
val foldOn: p:('a -> 'b) -> f:('c -> 'b -> 'd) -> z:'c -> x:'a -> 'd
val notFound: unit -> 'a
diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs
index d7509fee975..2e8a7164019 100644
--- a/src/fsharp/service/FSharpCheckerResults.fs
+++ b/src/fsharp/service/FSharpCheckerResults.fs
@@ -2184,7 +2184,7 @@ type FSharpCheckProjectResults
keepAssemblyContents: bool,
diagnostics: FSharpDiagnostic[],
details:(TcGlobals * TcImports * CcuThunk * ModuleOrNamespaceType * Choice *
- TopAttribs option * IRawFSharpAssemblyData option * ILAssemblyRef *
+ TopAttribs option * ILAssemblyRef *
AccessorDomain * TypedImplFile list option * string[] * FSharpProjectOptions) option) =
let getDetails() =
@@ -2202,12 +2202,12 @@ type FSharpCheckProjectResults
member _.HasCriticalErrors = details.IsNone
member _.AssemblySignature =
- let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, topAttribs, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
FSharpAssemblySignature(tcGlobals, thisCcu, ccuSig, tcImports, topAttribs, ccuSig)
member _.TypedImplementationFiles =
if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies"
- let (tcGlobals, tcImports, thisCcu, _ccuSig, _builderOrSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, _ccuSig, _builderOrSymbolUses, _topAttribs, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
let mimpls =
match tcAssemblyExpr with
| None -> []
@@ -2216,7 +2216,7 @@ type FSharpCheckProjectResults
member info.AssemblyContents =
if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies"
- let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, _topAttribs, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
let mimpls =
match tcAssemblyExpr with
| None -> []
@@ -2225,7 +2225,7 @@ type FSharpCheckProjectResults
member _.GetOptimizedAssemblyContents() =
if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies"
- let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, ccuSig, _builderOrSymbolUses, _topAttribs, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
let mimpls =
match tcAssemblyExpr with
| None -> []
@@ -2244,7 +2244,7 @@ type FSharpCheckProjectResults
// Not, this does not have to be a SyncOp, it can be called from any thread
member _.GetUsesOfSymbol(symbol:FSharpSymbol, ?cancellationToken: CancellationToken) =
- let (tcGlobals, _tcImports, _thisCcu, _ccuSig, builderOrSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, _tcImports, _thisCcu, _ccuSig, builderOrSymbolUses, _topAttribs, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
let results =
match builderOrSymbolUses with
@@ -2275,7 +2275,7 @@ type FSharpCheckProjectResults
// Not, this does not have to be a SyncOp, it can be called from any thread
member _.GetAllUsesOfAllSymbols(?cancellationToken: CancellationToken) =
- let (tcGlobals, tcImports, thisCcu, ccuSig, builderOrSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, ccuSig, builderOrSymbolUses, _topAttribs, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
let cenv = SymbolEnv(tcGlobals, thisCcu, Some ccuSig, tcImports)
let tcSymbolUses =
@@ -2306,22 +2306,18 @@ type FSharpCheckProjectResults
yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]
member _.ProjectContext =
- let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, ad, _tcAssemblyExpr, _dependencyFiles, projectOptions) = getDetails()
+ let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _ilAssemRef, ad, _tcAssemblyExpr, _dependencyFiles, projectOptions) = getDetails()
let assemblies =
tcImports.GetImportedAssemblies()
|> List.map (fun x -> FSharpAssembly(tcGlobals, tcImports, x.FSharpViewOfMetadata))
FSharpProjectContext(thisCcu, assemblies, ad, projectOptions)
- member _.RawFSharpAssemblyData =
- let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
- tcAssemblyData
-
member _.DependencyFiles =
- let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, dependencyFiles, _projectOptions) = getDetails()
+ let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _ilAssemRef, _ad, _tcAssemblyExpr, dependencyFiles, _projectOptions) = getDetails()
dependencyFiles
member _.AssemblyFullName =
- let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
+ let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles, _projectOptions) = getDetails()
ilAssemRef.QualifiedName
override _.ToString() = "FSharpCheckProjectResults(" + projectFileName + ")"
@@ -2391,7 +2387,7 @@ type FsiInteractiveChecker(legacyReferenceResolver,
FSharpCheckProjectResults (filename, Some tcConfig,
keepAssemblyContents, errors,
Some(tcGlobals, tcImports, tcFileInfo.ThisCcu, tcFileInfo.CcuSigForFile,
- (Choice2Of2 tcFileInfo.ScopeSymbolUses), None, None, mkSimpleAssemblyRef "stdin",
+ (Choice2Of2 tcFileInfo.ScopeSymbolUses), None, mkSimpleAssemblyRef "stdin",
tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles,
projectOptions))
diff --git a/src/fsharp/service/FSharpCheckerResults.fsi b/src/fsharp/service/FSharpCheckerResults.fsi
index 1858e4b24db..319a95991bb 100644
--- a/src/fsharp/service/FSharpCheckerResults.fsi
+++ b/src/fsharp/service/FSharpCheckerResults.fsi
@@ -434,8 +434,6 @@ type public FSharpCheckProjectResults =
/// in the documentation for compiler service.
member DependencyFiles: string[]
- member internal RawFSharpAssemblyData : IRawFSharpAssemblyData option
-
// Internal constructor.
internal new :
projectFileName:string *
@@ -448,7 +446,6 @@ type public FSharpCheckProjectResults =
ModuleOrNamespaceType *
Choice *
TopAttribs option *
- IRawFSharpAssemblyData option *
ILAssemblyRef *
AccessorDomain *
TypedImplFile list option *
diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs
index f4267b9d5e6..2db5ed5680d 100644
--- a/src/fsharp/service/IncrementalBuild.fs
+++ b/src/fsharp/service/IncrementalBuild.fs
@@ -897,16 +897,16 @@ module IncrementalBuilderHelpers =
nm = typeof.FullName)
if tcState.CreatesGeneratedProvidedTypes || hasTypeProviderAssemblyAttrib then
- None
+ ProjectAssemblyDataResult.Unavailable true
else
- Some (RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, generatedCcu, outfile, topAttrs, assemblyName, ilAssemRef) :> IRawFSharpAssemblyData)
+ ProjectAssemblyDataResult.Available (RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, generatedCcu, outfile, topAttrs, assemblyName, ilAssemRef) :> IRawFSharpAssemblyData)
with e ->
errorRecoveryNoRange e
- None
+ ProjectAssemblyDataResult.Unavailable true
ilAssemRef, tcAssemblyDataOpt, Some tcAssemblyExpr
with e ->
errorRecoveryNoRange e
- mkSimpleAssemblyRef assemblyName, None, None
+ mkSimpleAssemblyRef assemblyName, ProjectAssemblyDataResult.Unavailable true, None
let diagnostics = errorLogger.GetDiagnostics() :: finalInfo.tcErrorsRev
let! finalBoundModelWithErrors = finalBoundModel.Finish(diagnostics, Some topAttrs)
@@ -995,7 +995,7 @@ type IncrementalBuilderState =
stampedReferencedAssemblies: block
initialBoundModel: GraphNode
boundModels: block>
- finalizedBoundModel: GraphNode<((ILAssemblyRef * IRawFSharpAssemblyData option * TypedImplFile list option * BoundModel) * DateTime)>
+ finalizedBoundModel: GraphNode<((ILAssemblyRef * ProjectAssemblyDataResult * TypedImplFile list option * BoundModel) * DateTime)>
}
[]
diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi
index c8c5c26da6a..9b246582e30 100755
--- a/src/fsharp/service/IncrementalBuild.fsi
+++ b/src/fsharp/service/IncrementalBuild.fsi
@@ -219,12 +219,12 @@ type internal IncrementalBuilder =
/// Get the final typecheck result. If 'generateTypedImplFiles' was set on Create then the TypedAssemblyAfterOptimization will contain implementations.
/// This may be a long-running operation.
- member GetCheckResultsAndImplementationsForProject : unit -> NodeCode
+ member GetCheckResultsAndImplementationsForProject : unit -> NodeCode
/// Get the final typecheck result. If 'generateTypedImplFiles' was set on Create then the TypedAssemblyAfterOptimization will contain implementations.
/// This may be a long-running operation.
/// This will get full type-check info for the project, meaning no partial type-checking.
- member GetFullCheckResultsAndImplementationsForProject : unit -> NodeCode
+ member GetFullCheckResultsAndImplementationsForProject : unit -> NodeCode
/// Get the logical time stamp that is associated with the output of the project if it were gully built immediately
member GetLogicalTimeStampForProject: TimeStampCache -> DateTime
diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs
index 501ad1c4b02..563168f8109 100644
--- a/src/fsharp/service/service.fs
+++ b/src/fsharp/service/service.fs
@@ -279,9 +279,12 @@ type BackgroundCompiler(
match ilReaderOpt with
| Some ilReader ->
let ilModuleDef, ilAsmRefs = ilReader.ILModuleDef, ilReader.ILAssemblyRefs
- return RawFSharpAssemblyData(ilModuleDef, ilAsmRefs) :> IRawFSharpAssemblyData |> Some
+ let data = RawFSharpAssemblyData(ilModuleDef, ilAsmRefs) :> IRawFSharpAssemblyData
+ return ProjectAssemblyDataResult.Available data
| _ ->
- return None
+ // Note 'false' - if a PEReference doesn't find an ILModuleReader then we don't
+ // continue to try to use an on-disk DLL
+ return ProjectAssemblyDataResult.Unavailable false
}
member x.TryGetLogicalTimeStamp(_) = stamp |> Some
member x.FileName = nm }
@@ -293,7 +296,8 @@ type BackgroundCompiler(
node {
let ilReader = getReader()
let ilModuleDef, ilAsmRefs = ilReader.ILModuleDef, ilReader.ILAssemblyRefs
- return RawFSharpAssemblyData(ilModuleDef, ilAsmRefs) :> IRawFSharpAssemblyData |> Some
+ let data = RawFSharpAssemblyData(ilModuleDef, ilAsmRefs) :> IRawFSharpAssemblyData
+ return ProjectAssemblyDataResult.Available data
}
member x.TryGetLogicalTimeStamp(_) = getStamp() |> Some
member x.FileName = nm }
@@ -806,7 +810,7 @@ type BackgroundCompiler(
| None ->
return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, creationDiags, None)
| Some builder ->
- let! (tcProj, ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt) = builder.GetFullCheckResultsAndImplementationsForProject()
+ let! (tcProj, ilAssemRef, _, tcAssemblyExprOpt) = builder.GetFullCheckResultsAndImplementationsForProject()
let errorOptions = tcProj.TcConfig.errorSeverityOptions
let fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation
@@ -828,7 +832,7 @@ type BackgroundCompiler(
keepAssemblyContents,
diagnostics,
Some(tcProj.TcGlobals, tcProj.TcImports, tcState.Ccu, tcState.CcuSig,
- (Choice1Of2 builder), topAttribs, tcAssemblyDataOpt, ilAssemRef,
+ (Choice1Of2 builder), topAttribs, ilAssemRef,
tcEnvAtEnd.AccessRights, tcAssemblyExprOpt,
Array.ofList tcDependencyFiles,
options))
@@ -840,7 +844,7 @@ type BackgroundCompiler(
let! builderOpt,_ = getOrCreateBuilder (options, userOpName)
match builderOpt with
| None ->
- return None
+ return ProjectAssemblyDataResult.Unavailable true
| Some builder ->
let! (_, _, tcAssemblyDataOpt, _) = builder.GetCheckResultsAndImplementationsForProject()
return tcAssemblyDataOpt
@@ -955,31 +959,25 @@ type BackgroundCompiler(
member _.ProjectChecked = projectChecked.Publish
- member _.ClearCachesAsync (_userOpName) =
- async {
- return
- lock gate (fun () ->
- parseCacheLock.AcquireLock (fun ltok ->
- checkFileInProjectCache.Clear(ltok)
- parseFileCache.Clear(ltok))
- incrementalBuildersCache.Clear(AnyCallerThread)
- frameworkTcImportsCache.Clear()
- scriptClosureCache.Clear (AnyCallerThread)
- )
- }
+ member _.ClearCaches() =
+ lock gate (fun () ->
+ parseCacheLock.AcquireLock (fun ltok ->
+ checkFileInProjectCache.Clear(ltok)
+ parseFileCache.Clear(ltok))
+ incrementalBuildersCache.Clear(AnyCallerThread)
+ frameworkTcImportsCache.Clear()
+ scriptClosureCache.Clear (AnyCallerThread)
+ )
- member _.DownsizeCaches(_userOpName) =
- async {
- return
- lock gate (fun () ->
- parseCacheLock.AcquireLock (fun ltok ->
- checkFileInProjectCache.Resize(ltok, newKeepStrongly=1)
- parseFileCache.Resize(ltok, newKeepStrongly=1))
- incrementalBuildersCache.Resize(AnyCallerThread, newKeepStrongly=1, newKeepMax=1)
- frameworkTcImportsCache.Downsize()
- scriptClosureCache.Resize(AnyCallerThread,newKeepStrongly=1, newKeepMax=1)
- )
- }
+ member _.DownsizeCaches() =
+ lock gate (fun () ->
+ parseCacheLock.AcquireLock (fun ltok ->
+ checkFileInProjectCache.Resize(ltok, newKeepStrongly=1)
+ parseFileCache.Resize(ltok, newKeepStrongly=1))
+ incrementalBuildersCache.Resize(AnyCallerThread, newKeepStrongly=1, newKeepMax=1)
+ frameworkTcImportsCache.Downsize()
+ scriptClosureCache.Resize(AnyCallerThread,newKeepStrongly=1, newKeepMax=1)
+ )
member _.FrameworkImportsCache = frameworkTcImportsCache
@@ -1195,29 +1193,24 @@ type FSharpChecker(legacyReferenceResolver,
member ic.InvalidateAll() =
ic.ClearCaches()
- member _.ClearCachesAsync(?userOpName: string) =
+ member ic.ClearCaches() =
let utok = AnyCallerThread
- let userOpName = defaultArg userOpName "Unknown"
braceMatchCache.Clear(utok)
- backgroundCompiler.ClearCachesAsync(userOpName)
-
- member ic.ClearCaches(?userOpName) =
- ic.ClearCachesAsync(?userOpName=userOpName) |> Async.Start // this cache clearance is not synchronous, it will happen when the background op gets run
+ backgroundCompiler.ClearCaches()
member _.CheckMaxMemoryReached() =
if not maxMemoryReached && System.GC.GetTotalMemory(false) > int64 maxMB * 1024L * 1024L then
Trace.TraceWarning("!!!!!!!! MAX MEMORY REACHED, DOWNSIZING F# COMPILER CACHES !!!!!!!!!!!!!!!")
// If the maxMB limit is reached, drastic action is taken
// - reduce strong cache sizes to a minimum
- let userOpName = "MaxMemoryReached"
maxMemoryReached <- true
braceMatchCache.Resize(AnyCallerThread, newKeepStrongly=10)
- backgroundCompiler.DownsizeCaches(userOpName) |> Async.RunSynchronously
+ backgroundCompiler.DownsizeCaches()
maxMemEvent.Trigger( () )
// This is for unit testing only
member ic.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() =
- ic.ClearCachesAsync() |> Async.RunSynchronously
+ ic.ClearCaches()
System.GC.Collect()
System.GC.WaitForPendingFinalizers()
FxResolver.ClearStaticCaches()
@@ -1229,7 +1222,7 @@ type FSharpChecker(legacyReferenceResolver,
backgroundCompiler.InvalidateConfiguration(options, userOpName)
/// Clear the internal cache of the given projects.
- member _.ClearCache(options: FSharpProjectOptions seq, ?userOpName: string) =
+ member _.ClearCache(options: seq, ?userOpName: string) =
let userOpName = defaultArg userOpName "Unknown"
backgroundCompiler.ClearCache(options, userOpName)
diff --git a/src/fsharp/utils/FileSystem.fs b/src/fsharp/utils/FileSystem.fs
index 9346e6ab1a8..51ee480bf4f 100644
--- a/src/fsharp/utils/FileSystem.fs
+++ b/src/fsharp/utils/FileSystem.fs
@@ -353,7 +353,6 @@ module MemoryMappedFileExtensions =
let length = int64 bytes.Length
trymmf length
(fun stream ->
- stream.SetLength(stream.Length + length)
let span = Span(stream.PositionPointer |> NativePtr.toVoidPtr, int length)
bytes.Span.CopyTo(span)
stream.Position <- stream.Position + length
diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf
index d0a4a987163..a36f27f2a05 100644
--- a/src/fsharp/xlf/FSComp.txt.cs.xlf
+++ b/src/fsharp/xlf/FSComp.txt.cs.xlf
@@ -378,8 +378,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Neshoda v interpolovaném řetězci. Interpolované řetězce nemůžou používat specifikátory formátu %, pokud se každému z nich nezadá nějaký výraz, např. %d{{1+1}}.
@@ -622,6 +627,11 @@
Zvažte použití parametru return! namísto return.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Pro odkazy na rozhraní .NET používejte referenční sestavení, pokud jsou k dispozici (ve výchozím nastavení povolené).
diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf
index bd129dcab3c..d7dd65e3e5b 100644
--- a/src/fsharp/xlf/FSComp.txt.de.xlf
+++ b/src/fsharp/xlf/FSComp.txt.de.xlf
@@ -378,8 +378,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Konflikt in interpolierter Zeichenfolge. Interpolierte Zeichenfolgen dürfen keine Formatbezeichner vom Typ "%" verwenden, es sei denn, jeder erhält einen Ausdruck, z. B. "%d{{1+1}}"
@@ -622,6 +627,11 @@
Verwenden Sie ggf. "return!" anstelle von "return".
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Verweisassemblys für .NET Framework-Verweise verwenden, wenn verfügbar (standardmäßig aktiviert).
diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf
index 94172c49822..10b5251ea9d 100644
--- a/src/fsharp/xlf/FSComp.txt.es.xlf
+++ b/src/fsharp/xlf/FSComp.txt.es.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
La cadena interpolada no coincide. Las cadenas interpoladas no pueden usar los especificadores de formato "%", a menos que se les proporcione una expresión individualmente; por ejemplo, "%d{{1+1}}".
@@ -622,6 +627,11 @@
Considere la posibilidad de usar "return!" en lugar de "return".
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Use ensamblados de referencia para las referencias de .NET Framework cuando estén disponibles (habilitado de forma predeterminada).
diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf
index 9029b98de5e..7208751af4a 100644
--- a/src/fsharp/xlf/FSComp.txt.fr.xlf
+++ b/src/fsharp/xlf/FSComp.txt.fr.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Incompatibilité dans la chaîne interpolée. Les chaînes interpolées ne peuvent pas utiliser les spécificateurs de format '%' à moins de recevoir une expression, par exemple '%d{{1+1}}'
@@ -622,6 +627,11 @@
Utilisez 'return!' à la place de 'return'.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Utilisez des assemblys de référence pour les références .NET Framework quand ils sont disponibles (activé par défaut).
diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf
index 0c4cd6fea03..2594f045627 100644
--- a/src/fsharp/xlf/FSComp.txt.it.xlf
+++ b/src/fsharp/xlf/FSComp.txt.it.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Mancata corrispondenza nella stringa interpolata. Nelle stringhe interpolate non è possibile usare gli identificatori di formato '%' a meno che non si indichi un'espressione per ognuno di essi, ad esempio '%d{{1+1}}'
@@ -622,6 +627,11 @@
Provare a usare 'return!' invece di 'return'.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Usa gli assembly di riferimento per i riferimenti a .NET Framework quando disponibili (abilitato per impostazione predefinita).
diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf
index 653250970d6..db3c023a9f7 100644
--- a/src/fsharp/xlf/FSComp.txt.ja.xlf
+++ b/src/fsharp/xlf/FSComp.txt.ja.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
補間された文字列が一致しません。'%d{{1+1}}' などの式が指定されている場合を除き、補間された文字列では '%' 書式指定子を使用できません
@@ -622,6 +627,11 @@
'return' の代わりに 'return!' を使うことを検討してください。
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
使用可能な場合は、.NET Framework リファレンスの参照アセンブリを使用します (既定で有効)。
diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf
index 0fbdbb2a9a6..6cf3d27d191 100644
--- a/src/fsharp/xlf/FSComp.txt.ko.xlf
+++ b/src/fsharp/xlf/FSComp.txt.ko.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
보간 문자열의 불일치. 각 보간 문자열에 식(예: '%d{{1+1}}')이 지정되지 않는 한 '%' 형식 지정자를 사용할 수 없습니다.
@@ -622,6 +627,11 @@
'return'이 아니라 'return!'를 사용하세요.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
기본적으로 활성화되는 참조 어셈블리를 .NET Framework 참조에 사용합니다(사용 가능한 경우).
diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf
index ab5274e1e9c..87219dc337b 100644
--- a/src/fsharp/xlf/FSComp.txt.pl.xlf
+++ b/src/fsharp/xlf/FSComp.txt.pl.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Niezgodność w interpolowanym ciągu. W interpolowanych ciągach nie można używać specyfikatorów formatu „%”, chyba że każdemu z nich odpowiada wyrażenie, na przykład „%d{{1+1}}”.
@@ -622,6 +627,11 @@
Rozważ użycie polecenia „return!” zamiast „return”.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Użyj zestawów odwołań dla odwołań do programu .NET Framework, gdy są dostępne (domyślnie włączone).
diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf
index a3e8c17c143..61daa2e5942 100644
--- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Incompatibilidade na cadeia de caracteres interpolada. As cadeias de caracteres interpoladas não podem usar especificadores de formato '%', a menos que cada um receba uma expressão, por exemplo, '%d{{1+1}}'
@@ -622,6 +627,11 @@
Considere usar 'return!' em vez de 'return'.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Use assemblies de referência para referências do .NET Framework quando disponível (habilitado por padrão).
@@ -4574,7 +4584,7 @@
diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf
index 74829d26b0d..1bdb902b9b3 100644
--- a/src/fsharp/xlf/FSComp.txt.ru.xlf
+++ b/src/fsharp/xlf/FSComp.txt.ru.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Несоответствие в интерполированной строке. В интерполированных строках запрещено использовать описатели формата "%", если только каждому из них не назначено выражение, например "'%d{{1+1}}".
@@ -622,6 +627,11 @@
Рекомендуется использовать "return!" вместо "return".
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Использовать базовые сборки для ссылок на платформу .NET, если базовые сборки доступны (включено по умолчанию).
diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf
index e6d11c8a091..4e0c2312709 100644
--- a/src/fsharp/xlf/FSComp.txt.tr.xlf
+++ b/src/fsharp/xlf/FSComp.txt.tr.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
Düz metin arasına kod eklenmiş dizede uyuşmazlık. Düz metin arasına kod eklenmiş dizeler, her birine '%d{{1+1}}' gibi bir ifade verilmedikçe '%' biçim belirticilerini kullanamaz
@@ -622,6 +627,11 @@
'return' yerine 'return!' kullanmayı deneyin.
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
Kullanılabilir olduğunda, .NET Framework başvuruları için başvuru bütünleştirilmiş kodlarını kullanın (Varsayılan olarak etkindir).
diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf
index dd1f942cbe0..84014d409a3 100644
--- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
在内插字符串中不匹配。内插字符串不会使用 "%" 格式说明符,除非为每个字符串提供像 "'%d{{1+1}}" 这样的表达式
@@ -622,6 +627,11 @@
考虑使用 "return!",而非 "return"。
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
如果可用,请对 .NET Framework 引用使用引用程序集(默认启用)。
diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf
index 98e1a87ca9f..9457b3d32d3 100644
--- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf
@@ -368,8 +368,8 @@
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
- This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
+ This expression has type '{0}' and is only made compatible with type '{1}' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:{2}
@@ -422,6 +422,11 @@
This expression uses an implicit conversion to convert type '{0}' to type '{1}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+ This expression uses the implicit conversion '{0}' to convert type '{1}' to type '{2}'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+
+
Mismatch in interpolated string. Interpolated strings may not use '%' format specifiers unless each is given an expression, e.g. '%d{{1+1}}'
插補字串不相符。除非每個插補字串都有一個運算式,否則不可使用 '%' 格式指定名稱,例如 '%d{{1+1}}'
@@ -622,6 +627,11 @@
請考慮使用 'return!',而不使用 'return'。
+
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+ This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
+
+
Use reference assemblies for .NET framework references when available (Enabled by default).
請在可行的情況下使用適用於 .NET 架構參考的參考組件 (預設會啟用)。
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs
new file mode 100644
index 00000000000..ed112bac76c
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
+
+namespace FSharp.Compiler.ComponentTests.ErrorMessages
+
+#if NETCOREAPP
+open Xunit
+open FSharp.Test.Utilities.Compiler
+
+module ``Unsupported Attributes`` =
+
+ []
+ let ``Warn successfully`` () =
+ """
+open System.Runtime.CompilerServices
+let f (w, [] x : string) = ()
+let [] g () = ()
+type C() =
+ member _.F (w, [] x : string) = ()
+ []
+ member _.G() = ()
+ """
+ |> FSharp
+ |> typecheck
+ |> shouldFail
+ |> withResults [
+ { Error = Warning 202
+ Range = { StartLine = 3
+ StartColumn = 13
+ EndLine = 3
+ EndColumn = 37 }
+ Message =
+ "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect." }
+ { Error = Warning 202
+ Range = { StartLine = 4
+ StartColumn = 7
+ EndLine = 4
+ EndColumn = 24 }
+ Message =
+ "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect." }
+ { Error = Warning 202
+ Range = { StartLine = 6
+ StartColumn = 22
+ EndLine = 6
+ EndColumn = 78 }
+ Message =
+ "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect." }
+ { Error = Warning 202
+ Range = { StartLine = 7
+ StartColumn = 7
+ EndLine = 7
+ EndColumn = 56 }
+ Message =
+ "This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect." }
+ ]
+#endif
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
index e4ec28b52a9..f599a3f9b05 100644
--- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
+++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
@@ -26,6 +26,7 @@
+
diff --git a/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs b/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
index e46d4e88f4f..fdcf8dfda9a 100644
--- a/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
+++ b/tests/FSharp.Compiler.UnitTests/BuildGraphTests.fs
@@ -71,7 +71,7 @@ module BuildGraphTests =
let work = Async.Parallel(Array.init requests (fun _ -> graphNode.GetOrComputeValue() |> Async.AwaitNodeCode))
- Async.RunSynchronously(work)
+ Async.RunImmediate(work)
|> ignore
Assert.shouldBe 1 computationCount
@@ -84,7 +84,7 @@ module BuildGraphTests =
let work = Async.Parallel(Array.init requests (fun _ -> graphNode.GetOrComputeValue() |> Async.AwaitNodeCode))
- let result = Async.RunSynchronously(work)
+ let result = Async.RunImmediate(work)
Assert.shouldNotBeEmpty result
Assert.shouldBe requests result.Length
@@ -116,7 +116,7 @@ module BuildGraphTests =
Assert.shouldBeTrue weak.IsAlive
- Async.RunSynchronously(Async.Parallel(Array.init requests (fun _ -> graphNode.GetOrComputeValue() |> Async.AwaitNodeCode)))
+ Async.RunImmediate(Async.Parallel(Array.init requests (fun _ -> graphNode.GetOrComputeValue() |> Async.AwaitNodeCode)))
|> ignore
GC.Collect(2, GCCollectionMode.Forced, true)
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
index 303df51ecb8..c6718e41863 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs
@@ -691,3 +691,56 @@ type AsyncModule() =
} |> Async.RunSynchronously
Assert.AreEqual(54, counter)
+
+ []
+ member this.``async doesn't do cancel check between do! and try-finally``() =
+ let gate = obj()
+ for i in 0..10 do
+ let procCount = 3
+ use semaphore = new SemaphoreSlim(procCount-1)
+ printfn "Semaphore count available: %i" semaphore.CurrentCount
+ let mutable acquiredCount = 0
+ let mutable releaseCount = 0
+ try
+ List.init procCount (fun index ->
+ async {
+ lock gate <| fun () -> printfn "[%i] Waiting to enter semaphore" index
+ let! cancellationToken = Async.CancellationToken
+
+ // The semaphore lets two threads through at a time
+ do! semaphore.WaitAsync(cancellationToken) |> Async.AwaitTask
+
+ // No implicit cancellation checks should take place between a do! and a try
+ // if there are no other async control constructs present. If there is synchronous code
+ // it runs without cancellation checks
+ //
+ // index 1 will enter the try/finally quickly, call failwith and cancel the other tasks
+ // One of index 2 and index 3 will be stuck here before the try/finally. But having got
+ // this far it should enter the try/finally before cancellation takes effect
+ do
+ lock gate <| fun () -> printfn "[%i] Acquired semaphore" index
+ Interlocked.Increment(&acquiredCount) |> ignore
+ if index <> 0 then
+ lock gate <| fun () -> printfn "[%i] Slowly entering try/finally" index
+ System.Threading.Thread.Sleep(100)
+
+ try
+ lock gate <| fun () -> printfn "[%i] Within try-finally" index
+ if index = 0 then
+ lock gate <| fun () -> printfn "[%i] Error" index
+ // The failure will cause others to cancel
+ failwith "Something bad happened!"
+ finally
+ semaphore.Release() |> ignore
+ // This should always get executed
+ Interlocked.Increment(&releaseCount) |> ignore
+ lock gate <| fun () -> printfn "[%i] Semaphore released" index
+ })
+ |> Async.Parallel
+ |> Async.Ignore
+ |> Async.RunSynchronously
+ with
+ | exn ->
+ lock gate <| fun () -> printfn "Unhandled exception: %s" exn.Message
+ lock gate <| fun () -> printfn "Semaphore count available: %i" semaphore.CurrentCount
+ Assert.AreEqual(acquiredCount, releaseCount)
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs
index 689bcec6d1b..6247da500b7 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs
@@ -21,9 +21,12 @@ type AsyncType() =
let ignoreSynchCtx f =
f ()
+ let waitASec (t:Task) =
+ let result = t.Wait(TimeSpan(hours=0,minutes=0,seconds=1))
+ Assert.True(result, "Task did not finish after waiting for a second.")
[]
- member this.StartWithContinuations() =
+ member _.StartWithContinuations() =
let whatToDo = ref Exit
@@ -75,7 +78,7 @@ type AsyncType() =
()
[]
- member this.AsyncRunSynchronouslyReusesThreadPoolThread() =
+ member _.AsyncRunSynchronouslyReusesThreadPoolThread() =
let action = async { async { () } |> Async.RunSynchronously }
let computation =
[| for i in 1 .. 1000 -> action |]
@@ -90,7 +93,7 @@ type AsyncType() =
[]
[]
[]
- member this.AsyncSleepCancellation1(sleepType) =
+ member _.AsyncSleepCancellation1(sleepType) =
ignoreSynchCtx (fun () ->
let computation =
match sleepType with
@@ -112,7 +115,7 @@ type AsyncType() =
[]
[]
[]
- member this.AsyncSleepCancellation2(sleepType) =
+ member _.AsyncSleepCancellation2(sleepType) =
ignoreSynchCtx (fun () ->
let computation =
match sleepType with
@@ -137,7 +140,7 @@ type AsyncType() =
[]
[]
[]
- member this.AsyncSleepThrowsOnNegativeDueTimes(sleepType) =
+ member _.AsyncSleepThrowsOnNegativeDueTimes(sleepType) =
async {
try
do! match sleepType with
@@ -150,7 +153,7 @@ type AsyncType() =
} |> Async.RunSynchronously
[]
- member this.AsyncSleepInfinitely() =
+ member _.AsyncSleepInfinitely() =
ignoreSynchCtx (fun () ->
let computation = Async.Sleep(System.Threading.Timeout.Infinite)
let result = TaskCompletionSource()
@@ -164,27 +167,17 @@ type AsyncType() =
Assert.AreEqual("Cancel", result)
)
- member private this.WaitASec (t:Task) =
- let result = t.Wait(TimeSpan(hours=0,minutes=0,seconds=1))
- Assert.True(result, "Task did not finish after waiting for a second.")
-
-
[]
- member this.CreateTask () =
+ member _.CreateTask () =
let s = "Hello tasks!"
let a = async { return s }
-#if !NET46
- let t : Task =
-#else
- use t : Task =
-#endif
- Async.StartAsTask a
- this.WaitASec t
+ use t : Task = Async.StartAsTask a
+ waitASec t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)
[]
- member this.StartAsTaskCancellation () =
+ member _.StartAsTaskCancellation () =
let cts = new CancellationTokenSource()
let mutable spinloop = true
let doSpinloop () = while spinloop do ()
@@ -192,12 +185,7 @@ type AsyncType() =
cts.CancelAfter (100)
doSpinloop()
}
-#if !NET46
- let t : Task =
-#else
- use t : Task =
-#endif
- Async.StartAsTask(a, cancellationToken = cts.Token)
+ use t : Task = Async.StartAsTask(a, cancellationToken = cts.Token)
// Should not finish, we don't eagerly mark the task done just because it's been signaled to cancel.
try
@@ -208,7 +196,7 @@ type AsyncType() =
spinloop <- false
try
- this.WaitASec t
+ waitASec t
with :? AggregateException as a ->
match a.InnerException with
| :? TaskCanceledException as t -> ()
@@ -216,7 +204,7 @@ type AsyncType() =
Assert.True (t.IsCompleted, "Task is not completed")
[]
- member this.``AwaitTask ignores Async cancellation`` () =
+ member _.``AwaitTask ignores Async cancellation`` () =
let cts = new CancellationTokenSource()
let tcs = new TaskCompletionSource()
let innerTcs = new TaskCompletionSource()
@@ -233,7 +221,7 @@ type AsyncType() =
innerTcs.SetResult ()
try
- this.WaitASec tcs.Task
+ waitASec tcs.Task
with :? AggregateException as a ->
match a.InnerException with
| :? TaskCanceledException -> ()
@@ -241,7 +229,7 @@ type AsyncType() =
Assert.True (tcs.Task.IsCompleted, "Task is not completed")
[]
- member this.RunSynchronouslyCancellationWithDelayedResult () =
+ member _.RunSynchronouslyCancellationWithDelayedResult () =
let cts = new CancellationTokenSource()
let tcs = TaskCompletionSource()
let _ = cts.Token.Register(fun () -> tcs.SetResult 42)
@@ -260,45 +248,35 @@ type AsyncType() =
Assert.True (cancelled, "Task is not cancelled")
[]
- member this.ExceptionPropagatesToTask () =
+ member _.ExceptionPropagatesToTask () =
let a = async {
do raise (Exception ())
}
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartAsTask a
+ use t = Async.StartAsTask a
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with
e -> exceptionThrown <- true
Assert.True (t.IsFaulted)
Assert.True(exceptionThrown)
[]
- member this.CancellationPropagatesToTask () =
+ member _.CancellationPropagatesToTask () =
let a = async {
while true do ()
}
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartAsTask a
+ use t = Async.StartAsTask a
Async.CancelDefaultToken ()
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with e -> exceptionThrown <- true
Assert.True (exceptionThrown)
Assert.True(t.IsCanceled)
[]
- member this.CancellationPropagatesToGroup () =
+ member _.CancellationPropagatesToGroup () =
let ewh = new ManualResetEvent(false)
let cancelled = ref false
let a = async {
@@ -308,67 +286,47 @@ type AsyncType() =
}
let cts = new CancellationTokenSource()
let token = cts.Token
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartAsTask(a, cancellationToken=token)
+ use t = Async.StartAsTask(a, cancellationToken=token)
// printfn "%A" t.Status
ewh.WaitOne() |> Assert.True
cts.Cancel()
// printfn "%A" t.Status
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with e -> exceptionThrown <- true
Assert.True (exceptionThrown)
Assert.True(t.IsCanceled)
Assert.True(!cancelled)
[]
- member this.CreateImmediateAsTask () =
+ member _.CreateImmediateAsTask () =
let s = "Hello tasks!"
let a = async { return s }
-#if !NET46
- let t : Task =
-#else
- use t : Task =
-#endif
- Async.StartImmediateAsTask a
- this.WaitASec t
+ use t : Task = Async.StartImmediateAsTask a
+ waitASec t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)
[]
- member this.StartImmediateAsTask () =
+ member _.StartImmediateAsTask () =
let s = "Hello tasks!"
let a = async { return s }
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartImmediateAsTask a
- this.WaitASec t
+ use t = Async.StartImmediateAsTask a
+ waitASec t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)
[]
- member this.ExceptionPropagatesToImmediateTask () =
+ member _.ExceptionPropagatesToImmediateTask () =
let a = async {
do raise (Exception ())
}
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartImmediateAsTask a
+ use t = Async.StartImmediateAsTask a
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with
e -> exceptionThrown <- true
Assert.True (t.IsFaulted)
@@ -377,20 +335,15 @@ type AsyncType() =
#if IGNORED
[]
[]
- member this.CancellationPropagatesToImmediateTask () =
+ member _.CancellationPropagatesToImmediateTask () =
let a = async {
while true do ()
}
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Async.StartImmediateAsTask a
+ use t = Async.StartImmediateAsTask a
Async.CancelDefaultToken ()
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with e -> exceptionThrown <- true
Assert.True (exceptionThrown)
Assert.True(t.IsCanceled)
@@ -399,7 +352,7 @@ type AsyncType() =
#if IGNORED
[]
[]
- member this.CancellationPropagatesToGroupImmediate () =
+ member _.CancellationPropagatesToGroupImmediate () =
let ewh = new ManualResetEvent(false)
let cancelled = ref false
let a = async {
@@ -417,7 +370,7 @@ type AsyncType() =
// printfn "%A" t.Status
let mutable exceptionThrown = false
try
- this.WaitASec t
+ waitASec t
with e -> exceptionThrown <- true
Assert.True (exceptionThrown)
Assert.True(t.IsCanceled)
@@ -425,14 +378,9 @@ type AsyncType() =
#endif
[]
- member this.TaskAsyncValue () =
+ member _.TaskAsyncValue () =
let s = "Test"
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Task.Factory.StartNew(Func<_>(fun () -> s))
+ use t = Task.Factory.StartNew(Func<_>(fun () -> s))
let a = async {
let! s1 = Async.AwaitTask(t)
return s = s1
@@ -440,7 +388,7 @@ type AsyncType() =
Async.RunSynchronously(a) |> Assert.True
[]
- member this.AwaitTaskCancellation () =
+ member _.AwaitTaskCancellation () =
let test() = async {
let tcs = new System.Threading.Tasks.TaskCompletionSource()
tcs.SetCanceled()
@@ -453,7 +401,7 @@ type AsyncType() =
Async.RunSynchronously(test()) |> Assert.True
[]
- member this.AwaitCompletedTask() =
+ member _.AwaitCompletedTask() =
let test() = async {
let threadIdBefore = Thread.CurrentThread.ManagedThreadId
do! Async.AwaitTask Task.CompletedTask
@@ -464,7 +412,7 @@ type AsyncType() =
Async.RunSynchronously(test()) |> Assert.True
[]
- member this.AwaitTaskCancellationUntyped () =
+ member _.AwaitTaskCancellationUntyped () =
let test() = async {
let tcs = new System.Threading.Tasks.TaskCompletionSource()
tcs.SetCanceled()
@@ -477,13 +425,8 @@ type AsyncType() =
Async.RunSynchronously(test()) |> Assert.True
[]
- member this.TaskAsyncValueException () =
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Task.Factory.StartNew(Func(fun () -> raise <| Exception()))
+ member _.TaskAsyncValueException () =
+ use t = Task.Factory.StartNew(Func(fun () -> raise <| Exception()))
let a = async {
try
let! v = Async.AwaitTask(t)
@@ -494,16 +437,11 @@ type AsyncType() =
// test is flaky: https://github.com/dotnet/fsharp/issues/11586
//[]
- member this.TaskAsyncValueCancellation () =
+ member _.TaskAsyncValueCancellation () =
use ewh = new ManualResetEvent(false)
let cts = new CancellationTokenSource()
let token = cts.Token
-#if !NET46
- let t : Task=
-#else
- use t : Task=
-#endif
- Task.Factory.StartNew(Func(fun () -> while not token.IsCancellationRequested do ()), token)
+ use t : Task = Task.Factory.StartNew(Func(fun () -> while not token.IsCancellationRequested do ()), token)
let cancelled = ref true
let a =
async {
@@ -521,14 +459,9 @@ type AsyncType() =
ewh.WaitOne(10000) |> ignore
[]
- member this.NonGenericTaskAsyncValue () =
+ member _.NonGenericTaskAsyncValue () =
let hasBeenCalled = ref false
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Task.Factory.StartNew(Action(fun () -> hasBeenCalled := true))
+ use t = Task.Factory.StartNew(Action(fun () -> hasBeenCalled := true))
let a = async {
do! Async.AwaitTask(t)
return true
@@ -537,13 +470,8 @@ type AsyncType() =
(!hasBeenCalled && result) |> Assert.True
[]
- member this.NonGenericTaskAsyncValueException () =
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Task.Factory.StartNew(Action(fun () -> raise <| Exception()))
+ member _.NonGenericTaskAsyncValueException () =
+ use t = Task.Factory.StartNew(Action(fun () -> raise <| Exception()))
let a = async {
try
let! v = Async.AwaitTask(t)
@@ -553,16 +481,11 @@ type AsyncType() =
Async.RunSynchronously(a) |> Assert.True
[]
- member this.NonGenericTaskAsyncValueCancellation () =
+ member _.NonGenericTaskAsyncValueCancellation () =
use ewh = new ManualResetEvent(false)
let cts = new CancellationTokenSource()
let token = cts.Token
-#if !NET46
- let t =
-#else
- use t =
-#endif
- Task.Factory.StartNew(Action(fun () -> while not token.IsCancellationRequested do ()), token)
+ use t = Task.Factory.StartNew(Action(fun () -> while not token.IsCancellationRequested do ()), token)
let a =
async {
try
@@ -579,7 +502,7 @@ type AsyncType() =
ewh.WaitOne(10000) |> ignore
[]
- member this.CancellationExceptionThrown () =
+ member _.CancellationExceptionThrown () =
use ewh = new ManualResetEventSlim(false)
let cts = new CancellationTokenSource()
let token = cts.Token
@@ -594,3 +517,20 @@ type AsyncType() =
cts.Cancel()
ewh.Wait(10000) |> ignore
Assert.False hasThrown
+
+ []
+ member _.NoStackOverflowOnRecursion() =
+
+ let mutable hasThrown = false
+ let rec loop (x: int) = async {
+ do! Task.CompletedTask |> Async.AwaitTask
+ Console.WriteLine (if x = 10000 then failwith "finish" else x)
+ return! loop(x+1)
+ }
+
+ try
+ Async.RunSynchronously (loop 0)
+ hasThrown <- false
+ with Failure "finish" ->
+ hasThrown <- true
+ Assert.True hasThrown
diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs
index c9e0d50582f..5e3001a5145 100644
--- a/tests/FSharp.Test.Utilities/CompilerAssert.fs
+++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs
@@ -132,7 +132,7 @@ type CompilerAssert private () =
options
|> Array.append defaultProjectOptions.OtherOptions
|> Array.append [| "fsc.dll"; inputFilePath; "-o:" + outputFilePath; (if isExe then "--target:exe" else "--target:library"); "--nowin32manifest" |]
- let errors, _ = checker.Compile args |> Async.RunSynchronously
+ let errors, _ = checker.Compile args |> Async.RunImmediate
errors, outputFilePath
static let compileAux isExe options source f : unit =
@@ -397,7 +397,7 @@ type CompilerAssert private () =
let parseResults =
checker.ParseFile("test.fs", SourceText.ofString source, parseOptions)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics)
@@ -410,7 +410,7 @@ type CompilerAssert private () =
let compileErrors, statusCode =
checker.Compile([parseResults.ParseTree], "test", outputFilePath, dependencies, executable = isExe, noframework = true)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(compileErrors, sprintf "Compile errors: %A" compileErrors)
Assert.AreEqual(0, statusCode, sprintf "Nonzero status code: %d" statusCode)
@@ -421,7 +421,7 @@ type CompilerAssert private () =
let parseOptions = { FSharpParsingOptions.Default with SourceFiles = [|"test.fs"|] }
let parseResults =
checker.ParseFile("test.fs", SourceText.ofString source, parseOptions)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics)
@@ -434,7 +434,7 @@ type CompilerAssert private () =
let compileErrors, statusCode, assembly =
checker.CompileToDynamicAssembly([parseResults.ParseTree], assemblyName, dependencies, None, noframework = true)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(compileErrors, sprintf "Compile errors: %A" compileErrors)
Assert.AreEqual(0, statusCode, sprintf "Nonzero status code: %d" statusCode)
@@ -442,7 +442,7 @@ type CompilerAssert private () =
Option.get assembly
static member Pass (source: string) =
- let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, defaultProjectOptions) |> Async.RunSynchronously
+ let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, defaultProjectOptions) |> Async.RunImmediate
Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics)
@@ -455,7 +455,7 @@ type CompilerAssert private () =
static member PassWithOptions options (source: string) =
let options = { defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions}
- let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, options) |> Async.RunSynchronously
+ let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, options) |> Async.RunImmediate
Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics)
@@ -473,7 +473,7 @@ type CompilerAssert private () =
0,
SourceText.ofString (File.ReadAllText absoluteSourceFile),
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions; SourceFiles = [|sourceFile|] })
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(parseResults.Diagnostics, sprintf "Parse errors: %A" parseResults.Diagnostics)
@@ -503,7 +503,7 @@ type CompilerAssert private () =
0,
SourceText.ofString source,
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions; SourceFiles = [|name|] })
- |> Async.RunSynchronously
+ |> Async.RunImmediate
if parseResults.Diagnostics.Length > 0 then
parseResults.Diagnostics
@@ -523,7 +523,7 @@ type CompilerAssert private () =
0,
SourceText.ofString source,
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
- |> Async.RunSynchronously
+ |> Async.RunImmediate
if parseResults.Diagnostics.Length > 0 then
parseResults.Diagnostics
@@ -543,7 +543,7 @@ type CompilerAssert private () =
0,
SourceText.ofString source,
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
- |> Async.RunSynchronously
+ |> Async.RunImmediate
match fileAnswer with
| FSharpCheckFileAnswer.Aborted _ -> Assert.Fail("Type Checker Aborted"); failwith "Type Checker Aborted"
@@ -565,7 +565,7 @@ type CompilerAssert private () =
0,
SourceText.ofString source,
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
- |> Async.RunSynchronously
+ |> Async.RunImmediate
if parseResults.Diagnostics.Length > 0 then
parseResults.Diagnostics
@@ -669,7 +669,7 @@ type CompilerAssert private () =
static member Parse (source: string) =
let sourceFileName = "test.fs"
let parsingOptions = { FSharpParsingOptions.Default with SourceFiles = [| sourceFileName |] }
- checker.ParseFile(sourceFileName, SourceText.ofString source, parsingOptions) |> Async.RunSynchronously
+ checker.ParseFile(sourceFileName, SourceText.ofString source, parsingOptions) |> Async.RunImmediate
static member ParseWithErrors (source: string) expectedParseErrors =
let parseResults = CompilerAssert.Parse source
diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs
index fa02e829b7b..2932dcdeccc 100644
--- a/tests/FSharp.Test.Utilities/Utilities.fs
+++ b/tests/FSharp.Test.Utilities/Utilities.fs
@@ -6,9 +6,10 @@ open System
open System.IO
open System.Reflection
open System.Collections.Immutable
+open System.Diagnostics
+open System.Threading.Tasks
open Microsoft.CodeAnalysis
open Microsoft.CodeAnalysis.CSharp
-open System.Diagnostics
open FSharp.Test.Utilities
open TestFramework
open NUnit.Framework
@@ -17,6 +18,19 @@ open NUnit.Framework
module Utilities =
+ type Async with
+ static member RunImmediate (computation: Async<'T>, ?cancellationToken ) =
+ let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken
+ let ts = TaskCompletionSource<'T>()
+ let task = ts.Task
+ Async.StartWithContinuations(
+ computation,
+ (fun k -> ts.SetResult k),
+ (fun exn -> ts.SetException exn),
+ (fun _ -> ts.SetCanceled()),
+ cancellationToken)
+ task.Result
+
[]
type TargetFramework =
| NetStandard20
diff --git a/tests/benchmarks/CompilerServiceBenchmarks/Program.fs b/tests/benchmarks/CompilerServiceBenchmarks/Program.fs
index 28c42defebf..ced6ad6fcd9 100644
--- a/tests/benchmarks/CompilerServiceBenchmarks/Program.fs
+++ b/tests/benchmarks/CompilerServiceBenchmarks/Program.fs
@@ -1,14 +1,11 @@
open System
open System.IO
open System.Text
-open FSharp.Compiler.ErrorLogger
+open System.Threading.Tasks
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.Diagnostics
-open FSharp.Compiler.Syntax
-open FSharp.Compiler.Symbols
open FSharp.Compiler.EditorServices
open FSharp.Compiler.Text
-open FSharp.Compiler.AbstractIL
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.ILBinaryReader
open Microsoft.CodeAnalysis.Text
@@ -87,6 +84,19 @@ type SourceText with
[]
module Helpers =
+ type Async with
+ static member RunImmediate (computation: Async<'T>, ?cancellationToken ) =
+ let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken
+ let ts = TaskCompletionSource<'T>()
+ let task = ts.Task
+ Async.StartWithContinuations(
+ computation,
+ (fun k -> ts.SetResult k),
+ (fun exn -> ts.SetException exn),
+ (fun _ -> ts.SetCanceled()),
+ cancellationToken)
+ task.Result
+
let createProject name referencedProjects =
let tmpPath = Path.GetTempPath()
let file = Path.Combine(tmpPath, Path.ChangeExtension(name, ".fs"))
@@ -178,10 +188,10 @@ type CompilerService() =
| None ->
let options, _ =
checkerOpt.Value.GetProjectOptionsFromScript("decentlySizedStandAloneFile.fsx", SourceText.ofString decentlySizedStandAloneFile)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
let _, checkResult =
checkerOpt.Value.ParseAndCheckFileInProject("decentlySizedStandAloneFile.fsx", 0, SourceText.ofString decentlySizedStandAloneFile, options)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
decentlySizedStandAloneFileCheckResultOpt <- Some checkResult
| _ -> ()
@@ -191,7 +201,7 @@ type CompilerService() =
| None, _ -> failwith "no checker"
| _, None -> failwith "no source"
| Some(checker), Some(source) ->
- let results = checker.ParseFile("CheckExpressions.fs", source.ToFSharpSourceText(), parsingOptions) |> Async.RunSynchronously
+ let results = checker.ParseFile("CheckExpressions.fs", source.ToFSharpSourceText(), parsingOptions) |> Async.RunImmediate
if results.ParseHadErrors then failwithf "parse had errors: %A" results.Diagnostics
[]
@@ -201,7 +211,7 @@ type CompilerService() =
| Some(checker) ->
checker.InvalidateAll()
checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()
- checker.ParseFile("dummy.fs", SourceText.ofString "dummy", parsingOptions) |> Async.RunSynchronously |> ignore
+ checker.ParseFile("dummy.fs", SourceText.ofString "dummy", parsingOptions) |> Async.RunImmediate |> ignore
ClearAllILModuleReaderCache()
[]
@@ -272,7 +282,7 @@ type CompilerService() =
| Some checker ->
let parseResult, checkResult =
checker.ParseAndCheckFileInProject(file, 0, SourceText.ofString (File.ReadAllText(file)), options)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
if parseResult.Diagnostics.Length > 0 then
failwithf "%A" parseResult.Diagnostics
@@ -343,7 +353,7 @@ type CompilerService() =
| FSharpCheckFileAnswer.Aborted -> failwith "checker aborted"
| FSharpCheckFileAnswer.Succeeded results ->
let sourceLines = decentlySizedStandAloneFile.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None)
- let ranges = SimplifyNames.getSimplifiableNames(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunSynchronously
+ let ranges = SimplifyNames.getSimplifiableNames(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunImmediate
ignore ranges
()
| _ -> failwith "oopsie"
@@ -356,7 +366,7 @@ type CompilerService() =
| FSharpCheckFileAnswer.Aborted -> failwith "checker aborted"
| FSharpCheckFileAnswer.Succeeded results ->
let sourceLines = decentlySizedStandAloneFile.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None)
- let decls = UnusedOpens.getUnusedOpens(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunSynchronously
+ let decls = UnusedOpens.getUnusedOpens(results, fun lineNum -> sourceLines.[Line.toZ lineNum]) |> Async.RunImmediate
ignore decls
()
| _ -> failwith "oopsie"
@@ -368,7 +378,7 @@ type CompilerService() =
match checkResult with
| FSharpCheckFileAnswer.Aborted -> failwith "checker aborted"
| FSharpCheckFileAnswer.Succeeded results ->
- let decls = UnusedDeclarations.getUnusedDeclarations(results, true) |> Async.RunSynchronously
+ let decls = UnusedDeclarations.getUnusedDeclarations(results, true) |> Async.RunImmediate
ignore decls // should be 16
()
| _ -> failwith "oopsie"
diff --git a/tests/benchmarks/MicroPerf/Benchmarks.fs b/tests/benchmarks/MicroPerf/Benchmarks.fs
index cb264e065e3..910ca10736b 100644
--- a/tests/benchmarks/MicroPerf/Benchmarks.fs
+++ b/tests/benchmarks/MicroPerf/Benchmarks.fs
@@ -40,10 +40,29 @@ type Benchmarks() =
member _.FSharp(x: int) =
Code.condition_2(x)
+[]
+[]
+[]
+[]
+type AsyncWhileMemoryBench() =
+
+ []
+ member val Length = 0 with get, set
+
+ []
+ member x.Run() =
+ async {
+ let mutable i = 0
+ while i < x.Length do
+ i <- i + 1
+ return i
+ } |> Async.StartAsTask
+
module Main =
[]
let main argv =
printfn "Running benchmarks..."
- let results = BenchmarkRunner.Run()
+ //let results = BenchmarkRunner.Run()
+ let results = BenchmarkRunner.Run()
0
diff --git a/tests/benchmarks/MicroPerf/CS/MicroPerfCSharp.csproj b/tests/benchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
index 32ae4d1b867..875fdf3236c 100644
--- a/tests/benchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
+++ b/tests/benchmarks/MicroPerf/CS/MicroPerfCSharp.csproj
@@ -6,6 +6,12 @@
8.0
+
+
+
+
+
+
diff --git a/tests/fsharp/Compiler/Service/MultiProjectTests.fs b/tests/fsharp/Compiler/Service/MultiProjectTests.fs
index 9f0bc331786..88a131fad09 100644
--- a/tests/fsharp/Compiler/Service/MultiProjectTests.fs
+++ b/tests/fsharp/Compiler/Service/MultiProjectTests.fs
@@ -63,7 +63,7 @@ let test() =
|> SourceText.ofString
let _, checkAnswer =
CompilerAssert.Checker.ParseAndCheckFileInProject("test.fs", 0, fsText, fsOptions)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
match checkAnswer with
@@ -76,7 +76,7 @@ let test() =
try
let result, _ =
checker.Compile([|"fsc.dll";filePath;$"-o:{ outputFilePath }";"--deterministic+";"--optimize+";"--target:library"|])
- |> Async.RunSynchronously
+ |> Async.RunImmediate
if result.Length > 0 then
failwith "Compilation has errors."
@@ -162,7 +162,7 @@ let x = Script1.x
let checkProjectResults =
checker.ParseAndCheckProject(fsOptions1)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(checkProjectResults.Diagnostics)
@@ -176,7 +176,7 @@ let y = Script1.y
let checkProjectResults =
checker.ParseAndCheckProject(fsOptions1)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsNotEmpty(checkProjectResults.Diagnostics)
@@ -190,7 +190,7 @@ let y = 1
let checkProjectResults =
checker.ParseAndCheckProject(fsOptions1)
- |> Async.RunSynchronously
+ |> Async.RunImmediate
Assert.IsEmpty(checkProjectResults.Diagnostics)
diff --git a/tests/fsharp/core/auto-widen/preview/test.bsl b/tests/fsharp/core/auto-widen/preview/test.bsl
index a323bb59aa4..6da44724119 100644
--- a/tests/fsharp/core/auto-widen/preview/test.bsl
+++ b/tests/fsharp/core/auto-widen/preview/test.bsl
@@ -57,33 +57,33 @@ test.fsx(128,19,128,20): typecheck error FS3386: This expression uses an implici
test.fsx(128,22,128,23): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'double'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(135,18,135,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(135,18,135,19): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:int -> C' to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
test.fsx(140,18,140,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'int64'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(145,18,145,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'decimal'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(145,18,145,19): typecheck error FS3386: This expression uses the implicit conversion 'Decimal.op_Implicit(value: int) : decimal' to convert type 'int' to type 'decimal'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(147,18,147,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'decimal'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(147,18,147,19): typecheck error FS3386: This expression uses the implicit conversion 'Decimal.op_Implicit(value: int) : decimal' to convert type 'int' to type 'decimal'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(149,39,149,41): typecheck error FS3386: This expression uses an implicit conversion to convert type 'string' to type 'Xml.Linq.XNamespace'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(149,39,149,41): typecheck error FS3386: This expression uses the implicit conversion 'Xml.Linq.XNamespace.op_Implicit(namespaceName: string) : Xml.Linq.XNamespace' to convert type 'string' to type 'Xml.Linq.XNamespace'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(154,18,154,20): typecheck error FS3386: This expression uses an implicit conversion to convert type 'string' to type 'Xml.Linq.XNamespace'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(154,18,154,20): typecheck error FS3386: This expression uses the implicit conversion 'Xml.Linq.XNamespace.op_Implicit(namespaceName: string) : Xml.Linq.XNamespace' to convert type 'string' to type 'Xml.Linq.XNamespace'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(159,18,159,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'string' to type 'Xml.Linq.XName'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(159,18,159,21): typecheck error FS3386: This expression uses the implicit conversion 'Xml.Linq.XName.op_Implicit(expandedName: string) : Xml.Linq.XName' to convert type 'string' to type 'Xml.Linq.XName'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(165,18,165,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(165,18,165,19): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:int -> C' to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(172,18,172,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'Y' to type 'X'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(172,18,172,21): typecheck error FS3386: This expression uses the implicit conversion 'static member Y.op_Implicit : y:Y -> X' to convert type 'Y' to type 'X'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(172,18,172,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'Y' to type 'X'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(172,18,172,21): typecheck error FS3386: This expression uses the implicit conversion 'static member Y.op_Implicit : y:Y -> X' to convert type 'Y' to type 'X'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(178,20,178,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(178,20,178,21): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:'T -> C<'T>' to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(180,15,180,16): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(180,15,180,16): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:'T -> C<'T>' to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(186,27,186,28): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'Nullable'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(186,27,186,28): typecheck error FS3386: This expression uses the implicit conversion 'Nullable.op_Implicit(value: int) : Nullable' to convert type 'int' to type 'Nullable'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(188,15,188,16): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'Nullable'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(188,15,188,16): typecheck error FS3386: This expression uses the implicit conversion 'Nullable.op_Implicit(value: int) : Nullable' to convert type 'int' to type 'Nullable'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
test.fsx(313,37,313,38): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'int64'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
@@ -182,29 +182,33 @@ test.fsx(463,18,463,19): typecheck error FS0001: This expression was expected to
but here has type
'int'
-test.fsx(471,18,471,19): typecheck error FS3386: This expression uses an implicit conversion to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(471,18,471,19): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:int -> C' to convert type 'int' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
test.fsx(471,18,471,19): typecheck error FS0044: This construct is deprecated. nope
-test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:
+ static member B.op_Implicit : x:B -> C
+ static member C.op_Implicit : x:B -> C
-test.fsx(482,18,482,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(482,18,482,21): typecheck error FS3386: This expression uses the implicit conversion 'static member B.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'.
+test.fsx(482,18,482,21): typecheck error FS3387: This expression has type 'B' and is only made compatible with type 'C' through an ambiguous implicit conversion. Consider using an explicit call to 'op_Implicit'. The applicable implicit conversions are:
+ static member B.op_Implicit : x:B -> C
+ static member C.op_Implicit : x:B -> C
-test.fsx(482,18,482,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(482,18,482,21): typecheck error FS3386: This expression uses the implicit conversion 'static member B.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(507,18,507,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(507,18,507,21): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(507,18,507,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(507,18,507,21): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(519,18,519,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(519,18,519,21): typecheck error FS3386: This expression uses the implicit conversion 'static member B.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(519,18,519,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(519,18,519,21): typecheck error FS3386: This expression uses the implicit conversion 'static member B.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(538,18,538,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(538,18,538,21): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
-test.fsx(538,18,538,21): typecheck error FS3386: This expression uses an implicit conversion to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
+test.fsx(538,18,538,21): typecheck error FS3386: This expression uses the implicit conversion 'static member C.op_Implicit : x:B -> C' to convert type 'B' to type 'C'. Warnings are enabled for implicit conversions. Consider using an explicit conversion or disabling this warning.
test.fsx(543,30,543,31): typecheck error FS0001: This expression was expected to have type
'float32'
@@ -221,4 +225,4 @@ test.fsx(544,14,544,21): typecheck error FS0039: The type 'float64' is not defin
float
float`1
float32
- float32`1
\ No newline at end of file
+ float32`1
diff --git a/tests/fsharp/typecheck/sigs/neg117.bsl b/tests/fsharp/typecheck/sigs/neg117.bsl
index 2c8fbee14c0..9ad81d0003f 100644
--- a/tests/fsharp/typecheck/sigs/neg117.bsl
+++ b/tests/fsharp/typecheck/sigs/neg117.bsl
@@ -1,5 +1,5 @@
-neg117.fs(74,51,74,121): ilxgen error FS0041: No overloads match for method 'Transform'.
+neg117.fs(79,18,79,59): ilxgen error FS0041: No overloads match for method 'Transform'.
Known return type: ('a -> Neg117.TargetA.M1 Microsoft.FSharp.Core.[])
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd b/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd
index ea97cebadcb..0e3c4acf219 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd
@@ -1,17 +1,15 @@
REM == %1 --> assembly
ildasm /TEXT /LINENUM /NOBAR "%~nx1" >"%~n1.il"
-IF %ERRORLEVEL% NEQ 0 exit /b 1
+IF NOT ERRORLEVEL 0 exit 1
echo %~dp0..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il"
%~dp0..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il"
-IF %ERRORLEVEL% EQU 0 exit /b 0
-
if /i "%TEST_UPDATE_BSL%" == "1" (
echo copy /y "%~n1.il" "%~n1.il.bsl"
copy /y "%~n1.il" "%~n1.il.bsl"
)
-exit /b 1
+exit /b %ERRORLEVEL%
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.il.bsl
index 9787389574a..ca9de145cae 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.il.bsl
@@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 4:7:0:0
+ .ver 5:0:0:0
}
.assembly DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth
{
@@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000000 Length: 0x0000027A
+ // Offset: 0x00000000 Length: 0x0000028D
}
.mresource public FSharpOptimizationData.DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000280 Length: 0x000000BA
+ // Offset: 0x00000298 Length: 0x000000BA
}
.module DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.exe
-// MVID: {5EAD3E33-1475-D984-A745-0383333EAD5E}
+// MVID: {60E47018-1475-D984-A745-03831870E460}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x00B10000
+// Image base: 0x07120000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -58,15 +58,11 @@
.method assembly static void Invoke(object x,
int32 _arg1) cil managed
{
- // Code size 3 (0x3)
- .maxstack 5
- .locals init ([0] int32 V_0)
+ // Code size 1 (0x1)
+ .maxstack 8
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\dev\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs'
- IL_0000: ldarg.1
- IL_0001: stloc.0
- .line 6,6 : 80,82 ''
- IL_0002: ret
+ .line 6,6 : 80,82 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs'
+ IL_0000: ret
} // end of method F@6::Invoke
} // end of class F@6
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_Array_FSInterface_NoExtMeth.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_Array_FSInterface_NoExtMeth.il.bsl
index d290e0a4db4..49e25d8ea32 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_Array_FSInterface_NoExtMeth.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_Array_FSInterface_NoExtMeth.il.bsl
@@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 4:7:0:0
+ .ver 5:0:0:0
}
.assembly DoNotBoxStruct_Array_FSInterface_NoExtMeth
{
@@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.DoNotBoxStruct_Array_FSInterface_NoExtMeth
{
- // Offset: 0x00000000 Length: 0x00000261
+ // Offset: 0x00000000 Length: 0x00000273
}
.mresource public FSharpOptimizationData.DoNotBoxStruct_Array_FSInterface_NoExtMeth
{
- // Offset: 0x00000268 Length: 0x000000AC
+ // Offset: 0x00000278 Length: 0x000000AC
}
.module DoNotBoxStruct_Array_FSInterface_NoExtMeth.exe
-// MVID: {5EAD3E33-8127-3EE3-A745-0383333EAD5E}
+// MVID: {60E47018-8127-3EE3-A745-03831870E460}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x00AF0000
+// Image base: 0x054A0000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -58,15 +58,11 @@
.method assembly static void Invoke(object x,
int32 _arg1) cil managed
{
- // Code size 3 (0x3)
- .maxstack 5
- .locals init ([0] int32 V_0)
+ // Code size 1 (0x1)
+ .maxstack 8
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\dev\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_Array_FSInterface_NoExtMeth.fs'
- IL_0000: ldarg.1
- IL_0001: stloc.0
- .line 6,6 : 74,76 ''
- IL_0002: ret
+ .line 6,6 : 74,76 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_Array_FSInterface_NoExtMeth.fs'
+ IL_0000: ret
} // end of method F@6::Invoke
} // end of class F@6
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.il.bsl
index 141bc712cf0..5112dc687d5 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.il.bsl
@@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 4:7:0:0
+ .ver 5:0:0:0
}
.assembly DoNotBoxStruct_MDArray_FSInterface_NoExtMeth
{
@@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.DoNotBoxStruct_MDArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000000 Length: 0x00000268
+ // Offset: 0x00000000 Length: 0x0000027A
}
.mresource public FSharpOptimizationData.DoNotBoxStruct_MDArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000270 Length: 0x000000B0
+ // Offset: 0x00000280 Length: 0x000000B0
}
.module DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.exe
-// MVID: {5EAD3E33-A67D-867A-A745-0383333EAD5E}
+// MVID: {60E47018-A67D-867A-A745-03831870E460}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x06A00000
+// Image base: 0x056F0000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -58,15 +58,11 @@
.method assembly static void Invoke(object x,
int32 _arg1) cil managed
{
- // Code size 3 (0x3)
- .maxstack 5
- .locals init ([0] int32 V_0)
+ // Code size 1 (0x1)
+ .maxstack 8
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\dev\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.fs'
- IL_0000: ldarg.1
- IL_0001: stloc.0
- .line 6,6 : 77,79 ''
- IL_0002: ret
+ .line 6,6 : 77,79 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_MDArray_FSInterface_NoExtMeth.fs'
+ IL_0000: ret
} // end of method F@6::Invoke
} // end of class F@6
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.il.bsl
index 959a5180d76..191a24a1018 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/DoNotBoxStruct/DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.il.bsl
@@ -13,7 +13,7 @@
.assembly extern FSharp.Core
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 4:7:0:0
+ .ver 5:0:0:0
}
.assembly DoNotBoxStruct_NoArray_FSInterface_NoExtMeth
{
@@ -29,20 +29,20 @@
}
.mresource public FSharpSignatureData.DoNotBoxStruct_NoArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000000 Length: 0x00000258
+ // Offset: 0x00000000 Length: 0x0000026A
}
.mresource public FSharpOptimizationData.DoNotBoxStruct_NoArray_FSInterface_NoExtMeth
{
- // Offset: 0x00000260 Length: 0x000000B0
+ // Offset: 0x00000270 Length: 0x000000B0
}
.module DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.exe
-// MVID: {5EAD3E33-CD0A-F713-A745-0383333EAD5E}
+// MVID: {60E47018-CD0A-F713-A745-03831870E460}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x05780000
+// Image base: 0x06A30000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -58,15 +58,11 @@
.method assembly static void Invoke(object x,
int32 _arg1) cil managed
{
- // Code size 3 (0x3)
- .maxstack 5
- .locals init ([0] int32 V_0)
+ // Code size 1 (0x1)
+ .maxstack 8
.language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\dev\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.fs'
- IL_0000: ldarg.1
- IL_0001: stloc.0
- .line 6,6 : 68,70 ''
- IL_0002: ret
+ .line 6,6 : 68,70 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\DoNotBoxStruct\\DoNotBoxStruct_NoArray_FSInterface_NoExtMeth.fs'
+ IL_0000: ret
} // end of method F@6::Invoke
} // end of class F@6
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl
index 38346254e8f..e5bad87d725 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl
@@ -50,13 +50,13 @@
// Offset: 0x00000408 Length: 0x00000129
}
.module Linq101Grouping01.exe
-// MVID: {60D46F1F-FB79-E5BF-A745-03831F6FD460}
+// MVID: {60B78A59-FB79-E5BF-A745-0383598AB760}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x05800000
+// Image base: 0x06730000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -371,7 +371,7 @@
{
// Code size 8 (0x8)
.maxstack 8
- .line 25,25 : 23,28 ''
+ .line 25,25 : 24,25 ''
IL_0000: ldarg.1
IL_0001: ldc.i4.0
IL_0002: callvirt instance char [netstandard]System.String::get_Chars(int32)
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl
index baba5ea96e7..02331dbae8c 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl
@@ -45,13 +45,13 @@
// Offset: 0x00000390 Length: 0x0000011E
}
.module Linq101SetOperators01.exe
-// MVID: {60D46F1F-4EE5-349F-A745-03831F6FD460}
+// MVID: {60B78A59-4EE5-349F-A745-0383598AB760}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
-// Image base: 0x04FA0000
+// Image base: 0x06940000
// =============== CLASS MEMBERS DECLARATION ===================
@@ -846,7 +846,7 @@
IL_0057: ldfld class [mscorlib]System.Collections.Generic.IEnumerator`1 Linq101SetOperators01/productFirstChars@33::'enum'
IL_005c: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1::get_Current()
IL_0061: stloc.0
- .line 33,33 : 16,33 ''
+ .line 33,33 : 29,30 ''
IL_0062: ldarg.0
IL_0063: ldc.i4.2
IL_0064: stfld int32 Linq101SetOperators01/productFirstChars@33::pc
@@ -1196,7 +1196,7 @@
IL_0057: ldfld class [mscorlib]System.Collections.Generic.IEnumerator`1 Linq101SetOperators01/customerFirstChars@39::'enum'
IL_005c: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1::get_Current()
IL_0061: stloc.0
- .line 39,39 : 16,33 ''
+ .line 39,39 : 29,30 ''
IL_0062: ldarg.0
IL_0063: ldc.i4.2
IL_0064: stfld int32 Linq101SetOperators01/customerFirstChars@39::pc
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl
index e4ab112f177..bf83c61d107 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl
@@ -1,1673 +1,4 @@
-// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0
+// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
-
-
-// Metadata version: v4.0.30319
-.assembly extern mscorlib
-{
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
- .ver 4:0:0:0
-}
-.assembly extern FSharp.Core
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 5:0:0:0
-}
-.assembly TopLevelModule
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
- int32,
- int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )
-
- // --- The following custom attribute is added automatically, do not uncomment -------
- // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 )
-
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-.mresource public FSharpSignatureData.TopLevelModule
-{
- // Offset: 0x00000000 Length: 0x0000113D
-}
-.mresource public FSharpOptimizationData.TopLevelModule
-{
- // Offset: 0x00001148 Length: 0x000003FD
-}
-.module TopLevelModule.dll
-// MVID: {60D4892F-37F5-C118-A745-03832F89D460}
-.imagebase 0x00400000
-.file alignment 0x00000200
-.stackreserve 0x00100000
-.subsystem 0x0003 // WINDOWS_CUI
-.corflags 0x00000001 // ILONLY
-// Image base: 0x06F60000
-
-
-// =============== CLASS MEMBERS DECLARATION ===================
-
-.class public abstract auto ansi sealed ABC
- extends [mscorlib]System.Object
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
- .class auto autochar serializable sealed nested public beforefieldinit Expr
- extends [mscorlib]System.Object
- implements class [mscorlib]System.IEquatable`1,
- [mscorlib]System.Collections.IStructuralEquatable,
- class [mscorlib]System.IComparable`1,
- [mscorlib]System.IComparable,
- [mscorlib]System.Collections.IStructuralComparable
- {
- .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
- 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
- .field assembly initonly int32 item
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method public static class ABC/Expr
- NewNum(int32 item) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: newobj instance void ABC/Expr::.ctor(int32)
- IL_0006: ret
- } // end of method Expr::NewNum
-
- .method assembly specialname rtspecialname
- instance void .ctor(int32 item) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 ABC/Expr::item
- IL_000d: ret
- } // end of method Expr::.ctor
-
- .method public hidebysig instance int32
- get_Item() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 ABC/Expr::item
- IL_0006: ret
- } // end of method Expr::get_Item
-
- .method public hidebysig instance int32
- get_Tag() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: pop
- IL_0002: ldc.i4.0
- IL_0003: ret
- } // end of method Expr::get_Tag
-
- .method assembly hidebysig specialname
- instance object __DebugDisplay() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+0.8A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::__DebugDisplay
-
- .method public strict virtual instance string
- ToString() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/Expr>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::ToString
-
- .method public hidebysig virtual final
- instance int32 CompareTo(class ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 64 (0x40)
- .maxstack 4
- .locals init ([0] class ABC/Expr V_0,
- [1] class ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IComparer V_2,
- [3] int32 V_3,
- [4] int32 V_4)
- .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\SerializableAttribute\\ToplevelModule.fs'
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0036
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0034
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
- IL_0017: stloc.2
- IL_0018: ldloc.0
- IL_0019: ldfld int32 ABC/Expr::item
- IL_001e: stloc.3
- IL_001f: ldloc.1
- IL_0020: ldfld int32 ABC/Expr::item
- IL_0025: stloc.s V_4
- IL_0027: ldloc.3
- IL_0028: ldloc.s V_4
- IL_002a: bge.s IL_002e
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldc.i4.m1
- IL_002d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002e: ldloc.3
- IL_002f: ldloc.s V_4
- IL_0031: cgt
- IL_0033: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0034: ldc.i4.1
- IL_0035: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldarg.1
- IL_0037: ldnull
- IL_0038: cgt.un
- IL_003a: brfalse.s IL_003e
-
- .line 100001,100001 : 0,0 ''
- IL_003c: ldc.i4.m1
- IL_003d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003e: ldc.i4.0
- IL_003f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 13 (0xd)
- .maxstack 8
- .line 6,6 : 14,18 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: unbox.any ABC/Expr
- IL_0007: callvirt instance int32 ABC/Expr::CompareTo(class ABC/Expr)
- IL_000c: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj,
- class [mscorlib]System.Collections.IComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 80 (0x50)
- .maxstack 4
- .locals init ([0] class ABC/Expr V_0,
- [1] class ABC/Expr V_1,
- [2] class ABC/Expr V_2,
- [3] class [mscorlib]System.Collections.IComparer V_3,
- [4] int32 V_4,
- [5] int32 V_5)
- .line 6,6 : 14,18 ''
- IL_0000: ldarg.1
- IL_0001: unbox.any ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldarg.0
- IL_0008: ldnull
- IL_0009: cgt.un
- IL_000b: brfalse.s IL_0041
-
- .line 100001,100001 : 0,0 ''
- IL_000d: ldarg.1
- IL_000e: unbox.any ABC/Expr
- IL_0013: ldnull
- IL_0014: cgt.un
- IL_0016: brfalse.s IL_003f
-
- .line 100001,100001 : 0,0 ''
- IL_0018: ldarg.0
- IL_0019: pop
- .line 100001,100001 : 0,0 ''
- IL_001a: ldarg.0
- IL_001b: stloc.1
- IL_001c: ldloc.0
- IL_001d: stloc.2
- IL_001e: ldarg.2
- IL_001f: stloc.3
- IL_0020: ldloc.1
- IL_0021: ldfld int32 ABC/Expr::item
- IL_0026: stloc.s V_4
- IL_0028: ldloc.2
- IL_0029: ldfld int32 ABC/Expr::item
- IL_002e: stloc.s V_5
- IL_0030: ldloc.s V_4
- IL_0032: ldloc.s V_5
- IL_0034: bge.s IL_0038
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldc.i4.m1
- IL_0037: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0038: ldloc.s V_4
- IL_003a: ldloc.s V_5
- IL_003c: cgt
- IL_003e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003f: ldc.i4.1
- IL_0040: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0041: ldarg.1
- IL_0042: unbox.any ABC/Expr
- IL_0047: ldnull
- IL_0048: cgt.un
- IL_004a: brfalse.s IL_004e
-
- .line 100001,100001 : 0,0 ''
- IL_004c: ldc.i4.m1
- IL_004d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_004e: ldc.i4.0
- IL_004f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 41 (0x29)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0027
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldarg.0
- IL_0009: pop
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: stloc.1
- IL_000c: ldc.i4.0
- IL_000d: stloc.0
- IL_000e: ldc.i4 0x9e3779b9
- IL_0013: ldarg.1
- IL_0014: stloc.2
- IL_0015: ldloc.1
- IL_0016: ldfld int32 ABC/Expr::item
- IL_001b: ldloc.0
- IL_001c: ldc.i4.6
- IL_001d: shl
- IL_001e: ldloc.0
- IL_001f: ldc.i4.2
- IL_0020: shr
- IL_0021: add
- IL_0022: add
- IL_0023: add
- IL_0024: stloc.0
- IL_0025: ldloc.0
- IL_0026: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0027: ldc.i4.0
- IL_0028: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance int32 GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 6,6 : 14,18 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance bool Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 52 (0x34)
- .maxstack 4
- .locals init ([0] class ABC/Expr V_0,
- [1] class ABC/Expr V_1,
- [2] class ABC/Expr V_2,
- [3] class ABC/Expr V_3,
- [4] class [mscorlib]System.Collections.IEqualityComparer V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_002c
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst ABC/Expr
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_002a
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldarg.0
- IL_0013: pop
- .line 100001,100001 : 0,0 ''
- IL_0014: ldarg.0
- IL_0015: stloc.2
- IL_0016: ldloc.1
- IL_0017: stloc.3
- IL_0018: ldarg.2
- IL_0019: stloc.s V_4
- IL_001b: ldloc.2
- IL_001c: ldfld int32 ABC/Expr::item
- IL_0021: ldloc.3
- IL_0022: ldfld int32 ABC/Expr::item
- IL_0027: ceq
- IL_0029: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002a: ldc.i4.0
- IL_002b: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldarg.1
- IL_002d: ldnull
- IL_002e: cgt.un
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(class ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 43 (0x2b)
- .maxstack 4
- .locals init ([0] class ABC/Expr V_0,
- [1] class ABC/Expr V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0023
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0021
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: ldfld int32 ABC/Expr::item
- IL_0018: ldloc.1
- IL_0019: ldfld int32 ABC/Expr::item
- IL_001e: ceq
- IL_0020: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0021: ldc.i4.0
- IL_0022: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0023: ldarg.1
- IL_0024: ldnull
- IL_0025: cgt.un
- IL_0027: ldc.i4.0
- IL_0028: ceq
- IL_002a: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class ABC/Expr V_0)
- .line 6,6 : 14,18 ''
- IL_0000: ldarg.1
- IL_0001: isinst ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool ABC/Expr::Equals(class ABC/Expr)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method Expr::Equals
-
- .property instance int32 Tag()
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .get instance int32 ABC/Expr::get_Tag()
- } // end of property Expr::Tag
- .property instance int32 Item()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .get instance int32 ABC/Expr::get_Item()
- } // end of property Expr::Item
- } // end of class Expr
-
- .class auto ansi serializable nested public beforefieldinit MyExn
- extends [mscorlib]System.Exception
- implements [mscorlib]System.Collections.IStructuralEquatable
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
- .field assembly int32 Data0@
- .method public specialname rtspecialname
- instance void .ctor(int32 data0) cil managed
- {
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 ABC/MyExn::Data0@
- IL_000d: ret
- } // end of method MyExn::.ctor
-
- .method public specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ret
- } // end of method MyExn::.ctor
-
- .method family specialname rtspecialname
- instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed
- {
- // Code size 9 (0x9)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: ldarg.2
- IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
- IL_0008: ret
- } // end of method MyExn::.ctor
-
- .method public hidebysig specialname
- instance int32 get_Data0() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 ABC/MyExn::Data0@
- IL_0006: ret
- } // end of method MyExn::get_Data0
-
- .method public hidebysig virtual instance int32
- GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 40 (0x28)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Collections.IEqualityComparer V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0026
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldc.i4 0x9e3779b9
- IL_000d: ldarg.1
- IL_000e: stloc.1
- IL_000f: ldarg.0
- IL_0010: castclass ABC/MyExn
- IL_0015: call instance int32 ABC/MyExn::get_Data0()
- IL_001a: ldloc.0
- IL_001b: ldc.i4.6
- IL_001c: shl
- IL_001d: ldloc.0
- IL_001e: ldc.i4.2
- IL_001f: shr
- IL_0020: add
- IL_0021: add
- IL_0022: add
- IL_0023: stloc.0
- IL_0024: ldloc.0
- IL_0025: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0026: ldc.i4.0
- IL_0027: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance int32
- GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 7,7 : 19,24 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance bool
- Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 67 (0x43)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_003b
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst [mscorlib]System.Exception
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_0039
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0018: brtrue.s IL_001c
-
- IL_001a: br.s IL_0037
-
- .line 100001,100001 : 0,0 ''
- IL_001c: ldarg.2
- IL_001d: stloc.2
- IL_001e: ldarg.0
- IL_001f: castclass ABC/MyExn
- IL_0024: call instance int32 ABC/MyExn::get_Data0()
- IL_0029: ldloc.1
- IL_002a: castclass ABC/MyExn
- IL_002f: call instance int32 ABC/MyExn::get_Data0()
- IL_0034: ceq
- IL_0036: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0037: ldc.i4.0
- IL_0038: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0039: ldc.i4.0
- IL_003a: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003b: ldarg.1
- IL_003c: ldnull
- IL_003d: cgt.un
- IL_003f: ldc.i4.0
- IL_0040: ceq
- IL_0042: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig instance bool
- Equals(class [mscorlib]System.Exception obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 59 (0x3b)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0033
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0031
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.1
- IL_000d: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0012: brtrue.s IL_0016
-
- IL_0014: br.s IL_002f
-
- .line 100001,100001 : 0,0 ''
- IL_0016: ldarg.0
- IL_0017: castclass ABC/MyExn
- IL_001c: call instance int32 ABC/MyExn::get_Data0()
- IL_0021: ldarg.1
- IL_0022: castclass ABC/MyExn
- IL_0027: call instance int32 ABC/MyExn::get_Data0()
- IL_002c: ceq
- IL_002e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002f: ldc.i4.0
- IL_0030: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0031: ldc.i4.0
- IL_0032: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0033: ldarg.1
- IL_0034: ldnull
- IL_0035: cgt.un
- IL_0037: ldc.i4.0
- IL_0038: ceq
- IL_003a: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig virtual instance bool
- Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0)
- .line 7,7 : 19,24 ''
- IL_0000: ldarg.1
- IL_0001: isinst [mscorlib]System.Exception
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool ABC/MyExn::Equals(class [mscorlib]System.Exception)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method MyExn::Equals
-
- .property instance int32 Data0()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
- .get instance int32 ABC/MyExn::get_Data0()
- } // end of property MyExn::Data0
- } // end of class MyExn
-
- .class auto ansi serializable nested public A
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
- .field assembly string x
- .method public specialname rtspecialname
- instance void .ctor(string x) cil managed
- {
- // Code size 16 (0x10)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: pop
- .line 8,8 : 16,17 ''
- IL_0008: ldarg.0
- IL_0009: ldarg.1
- IL_000a: stfld string ABC/A::x
- .line 8,8 : 14,15 ''
- IL_000f: ret
- } // end of method A::.ctor
-
- .method public hidebysig specialname
- instance string get_X() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- .line 8,8 : 42,43 ''
- IL_0000: ldarg.0
- IL_0001: ldfld string ABC/A::x
- IL_0006: ret
- } // end of method A::get_X
-
- .property instance string X()
- {
- .get instance string ABC/A::get_X()
- } // end of property A::X
- } // end of class A
-
- .class abstract auto ansi sealed nested public ABC
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
- .class auto autochar serializable sealed nested public beforefieldinit Expr
- extends [mscorlib]System.Object
- implements class [mscorlib]System.IEquatable`1,
- [mscorlib]System.Collections.IStructuralEquatable,
- class [mscorlib]System.IComparable`1,
- [mscorlib]System.IComparable,
- [mscorlib]System.Collections.IStructuralComparable
- {
- .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
- 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
- .field assembly initonly int32 item
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method public static class ABC/ABC/Expr
- NewNum(int32 item) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: newobj instance void ABC/ABC/Expr::.ctor(int32)
- IL_0006: ret
- } // end of method Expr::NewNum
-
- .method assembly specialname rtspecialname
- instance void .ctor(int32 item) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 ABC/ABC/Expr::item
- IL_000d: ret
- } // end of method Expr::.ctor
-
- .method public hidebysig instance int32
- get_Item() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 ABC/ABC/Expr::item
- IL_0006: ret
- } // end of method Expr::get_Item
-
- .method public hidebysig instance int32
- get_Tag() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: pop
- IL_0002: ldc.i4.0
- IL_0003: ret
- } // end of method Expr::get_Tag
-
- .method assembly hidebysig specialname
- instance object __DebugDisplay() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+0.8A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::__DebugDisplay
-
- .method public strict virtual instance string
- ToString() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class ABC/ABC/Expr>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::ToString
-
- .method public hidebysig virtual final
- instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 64 (0x40)
- .maxstack 4
- .locals init ([0] class ABC/ABC/Expr V_0,
- [1] class ABC/ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IComparer V_2,
- [3] int32 V_3,
- [4] int32 V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0036
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0034
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
- IL_0017: stloc.2
- IL_0018: ldloc.0
- IL_0019: ldfld int32 ABC/ABC/Expr::item
- IL_001e: stloc.3
- IL_001f: ldloc.1
- IL_0020: ldfld int32 ABC/ABC/Expr::item
- IL_0025: stloc.s V_4
- IL_0027: ldloc.3
- IL_0028: ldloc.s V_4
- IL_002a: bge.s IL_002e
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldc.i4.m1
- IL_002d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002e: ldloc.3
- IL_002f: ldloc.s V_4
- IL_0031: cgt
- IL_0033: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0034: ldc.i4.1
- IL_0035: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldarg.1
- IL_0037: ldnull
- IL_0038: cgt.un
- IL_003a: brfalse.s IL_003e
-
- .line 100001,100001 : 0,0 ''
- IL_003c: ldc.i4.m1
- IL_003d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003e: ldc.i4.0
- IL_003f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 13 (0xd)
- .maxstack 8
- .line 16,16 : 18,22 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: unbox.any ABC/ABC/Expr
- IL_0007: callvirt instance int32 ABC/ABC/Expr::CompareTo(class ABC/ABC/Expr)
- IL_000c: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj,
- class [mscorlib]System.Collections.IComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 80 (0x50)
- .maxstack 4
- .locals init ([0] class ABC/ABC/Expr V_0,
- [1] class ABC/ABC/Expr V_1,
- [2] class ABC/ABC/Expr V_2,
- [3] class [mscorlib]System.Collections.IComparer V_3,
- [4] int32 V_4,
- [5] int32 V_5)
- .line 16,16 : 18,22 ''
- IL_0000: ldarg.1
- IL_0001: unbox.any ABC/ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldarg.0
- IL_0008: ldnull
- IL_0009: cgt.un
- IL_000b: brfalse.s IL_0041
-
- .line 100001,100001 : 0,0 ''
- IL_000d: ldarg.1
- IL_000e: unbox.any ABC/ABC/Expr
- IL_0013: ldnull
- IL_0014: cgt.un
- IL_0016: brfalse.s IL_003f
-
- .line 100001,100001 : 0,0 ''
- IL_0018: ldarg.0
- IL_0019: pop
- .line 100001,100001 : 0,0 ''
- IL_001a: ldarg.0
- IL_001b: stloc.1
- IL_001c: ldloc.0
- IL_001d: stloc.2
- IL_001e: ldarg.2
- IL_001f: stloc.3
- IL_0020: ldloc.1
- IL_0021: ldfld int32 ABC/ABC/Expr::item
- IL_0026: stloc.s V_4
- IL_0028: ldloc.2
- IL_0029: ldfld int32 ABC/ABC/Expr::item
- IL_002e: stloc.s V_5
- IL_0030: ldloc.s V_4
- IL_0032: ldloc.s V_5
- IL_0034: bge.s IL_0038
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldc.i4.m1
- IL_0037: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0038: ldloc.s V_4
- IL_003a: ldloc.s V_5
- IL_003c: cgt
- IL_003e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003f: ldc.i4.1
- IL_0040: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0041: ldarg.1
- IL_0042: unbox.any ABC/ABC/Expr
- IL_0047: ldnull
- IL_0048: cgt.un
- IL_004a: brfalse.s IL_004e
-
- .line 100001,100001 : 0,0 ''
- IL_004c: ldc.i4.m1
- IL_004d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_004e: ldc.i4.0
- IL_004f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 41 (0x29)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class ABC/ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0027
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldarg.0
- IL_0009: pop
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: stloc.1
- IL_000c: ldc.i4.0
- IL_000d: stloc.0
- IL_000e: ldc.i4 0x9e3779b9
- IL_0013: ldarg.1
- IL_0014: stloc.2
- IL_0015: ldloc.1
- IL_0016: ldfld int32 ABC/ABC/Expr::item
- IL_001b: ldloc.0
- IL_001c: ldc.i4.6
- IL_001d: shl
- IL_001e: ldloc.0
- IL_001f: ldc.i4.2
- IL_0020: shr
- IL_0021: add
- IL_0022: add
- IL_0023: add
- IL_0024: stloc.0
- IL_0025: ldloc.0
- IL_0026: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0027: ldc.i4.0
- IL_0028: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance int32 GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 16,16 : 18,22 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 ABC/ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance bool Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 52 (0x34)
- .maxstack 4
- .locals init ([0] class ABC/ABC/Expr V_0,
- [1] class ABC/ABC/Expr V_1,
- [2] class ABC/ABC/Expr V_2,
- [3] class ABC/ABC/Expr V_3,
- [4] class [mscorlib]System.Collections.IEqualityComparer V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_002c
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst ABC/ABC/Expr
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_002a
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldarg.0
- IL_0013: pop
- .line 100001,100001 : 0,0 ''
- IL_0014: ldarg.0
- IL_0015: stloc.2
- IL_0016: ldloc.1
- IL_0017: stloc.3
- IL_0018: ldarg.2
- IL_0019: stloc.s V_4
- IL_001b: ldloc.2
- IL_001c: ldfld int32 ABC/ABC/Expr::item
- IL_0021: ldloc.3
- IL_0022: ldfld int32 ABC/ABC/Expr::item
- IL_0027: ceq
- IL_0029: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002a: ldc.i4.0
- IL_002b: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldarg.1
- IL_002d: ldnull
- IL_002e: cgt.un
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(class ABC/ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 43 (0x2b)
- .maxstack 4
- .locals init ([0] class ABC/ABC/Expr V_0,
- [1] class ABC/ABC/Expr V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0023
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0021
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: ldfld int32 ABC/ABC/Expr::item
- IL_0018: ldloc.1
- IL_0019: ldfld int32 ABC/ABC/Expr::item
- IL_001e: ceq
- IL_0020: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0021: ldc.i4.0
- IL_0022: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0023: ldarg.1
- IL_0024: ldnull
- IL_0025: cgt.un
- IL_0027: ldc.i4.0
- IL_0028: ceq
- IL_002a: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class ABC/ABC/Expr V_0)
- .line 16,16 : 18,22 ''
- IL_0000: ldarg.1
- IL_0001: isinst ABC/ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool ABC/ABC/Expr::Equals(class ABC/ABC/Expr)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method Expr::Equals
-
- .property instance int32 Tag()
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .get instance int32 ABC/ABC/Expr::get_Tag()
- } // end of property Expr::Tag
- .property instance int32 Item()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .get instance int32 ABC/ABC/Expr::get_Item()
- } // end of property Expr::Item
- } // end of class Expr
-
- .class auto ansi serializable nested public beforefieldinit MyExn
- extends [mscorlib]System.Exception
- implements [mscorlib]System.Collections.IStructuralEquatable
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
- .field assembly int32 Data0@
- .method public specialname rtspecialname
- instance void .ctor(int32 data0) cil managed
- {
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 ABC/ABC/MyExn::Data0@
- IL_000d: ret
- } // end of method MyExn::.ctor
-
- .method public specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ret
- } // end of method MyExn::.ctor
-
- .method family specialname rtspecialname
- instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed
- {
- // Code size 9 (0x9)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: ldarg.2
- IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
- IL_0008: ret
- } // end of method MyExn::.ctor
-
- .method public hidebysig specialname
- instance int32 get_Data0() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 ABC/ABC/MyExn::Data0@
- IL_0006: ret
- } // end of method MyExn::get_Data0
-
- .method public hidebysig virtual instance int32
- GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 40 (0x28)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Collections.IEqualityComparer V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0026
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldc.i4 0x9e3779b9
- IL_000d: ldarg.1
- IL_000e: stloc.1
- IL_000f: ldarg.0
- IL_0010: castclass ABC/ABC/MyExn
- IL_0015: call instance int32 ABC/ABC/MyExn::get_Data0()
- IL_001a: ldloc.0
- IL_001b: ldc.i4.6
- IL_001c: shl
- IL_001d: ldloc.0
- IL_001e: ldc.i4.2
- IL_001f: shr
- IL_0020: add
- IL_0021: add
- IL_0022: add
- IL_0023: stloc.0
- IL_0024: ldloc.0
- IL_0025: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0026: ldc.i4.0
- IL_0027: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance int32
- GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 17,17 : 23,28 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 ABC/ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance bool
- Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 67 (0x43)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_003b
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst [mscorlib]System.Exception
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_0039
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0018: brtrue.s IL_001c
-
- IL_001a: br.s IL_0037
-
- .line 100001,100001 : 0,0 ''
- IL_001c: ldarg.2
- IL_001d: stloc.2
- IL_001e: ldarg.0
- IL_001f: castclass ABC/ABC/MyExn
- IL_0024: call instance int32 ABC/ABC/MyExn::get_Data0()
- IL_0029: ldloc.1
- IL_002a: castclass ABC/ABC/MyExn
- IL_002f: call instance int32 ABC/ABC/MyExn::get_Data0()
- IL_0034: ceq
- IL_0036: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0037: ldc.i4.0
- IL_0038: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0039: ldc.i4.0
- IL_003a: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003b: ldarg.1
- IL_003c: ldnull
- IL_003d: cgt.un
- IL_003f: ldc.i4.0
- IL_0040: ceq
- IL_0042: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig instance bool
- Equals(class [mscorlib]System.Exception obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 59 (0x3b)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0033
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0031
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.1
- IL_000d: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0012: brtrue.s IL_0016
-
- IL_0014: br.s IL_002f
-
- .line 100001,100001 : 0,0 ''
- IL_0016: ldarg.0
- IL_0017: castclass ABC/ABC/MyExn
- IL_001c: call instance int32 ABC/ABC/MyExn::get_Data0()
- IL_0021: ldarg.1
- IL_0022: castclass ABC/ABC/MyExn
- IL_0027: call instance int32 ABC/ABC/MyExn::get_Data0()
- IL_002c: ceq
- IL_002e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002f: ldc.i4.0
- IL_0030: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0031: ldc.i4.0
- IL_0032: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0033: ldarg.1
- IL_0034: ldnull
- IL_0035: cgt.un
- IL_0037: ldc.i4.0
- IL_0038: ceq
- IL_003a: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig virtual instance bool
- Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0)
- .line 17,17 : 23,28 ''
- IL_0000: ldarg.1
- IL_0001: isinst [mscorlib]System.Exception
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool ABC/ABC/MyExn::Equals(class [mscorlib]System.Exception)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method MyExn::Equals
-
- .property instance int32 Data0()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
- .get instance int32 ABC/ABC/MyExn::get_Data0()
- } // end of property MyExn::Data0
- } // end of class MyExn
-
- .class auto ansi serializable nested public A
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
- .field assembly string x
- .method public specialname rtspecialname
- instance void .ctor(string x) cil managed
- {
- // Code size 16 (0x10)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: pop
- .line 18,18 : 20,21 ''
- IL_0008: ldarg.0
- IL_0009: ldarg.1
- IL_000a: stfld string ABC/ABC/A::x
- .line 18,18 : 18,19 ''
- IL_000f: ret
- } // end of method A::.ctor
-
- .method public hidebysig specialname
- instance string get_X() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- .line 18,18 : 46,47 ''
- IL_0000: ldarg.0
- IL_0001: ldfld string ABC/ABC/A::x
- IL_0006: ret
- } // end of method A::get_X
-
- .property instance string X()
- {
- .get instance string ABC/ABC/A::get_X()
- } // end of property A::X
- } // end of class A
-
- .method public static int32 'add'(int32 x,
- int32 y) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- .line 21,21 : 27,32 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: add
- IL_0003: ret
- } // end of method ABC::'add'
-
- .method public specialname static string
- get_greeting() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 6 (0x6)
- .maxstack 8
- IL_0000: ldstr "hello"
- IL_0005: ret
- } // end of method ABC::get_greeting
-
- .property string greeting()
- {
- .get string ABC/ABC::get_greeting()
- } // end of property ABC::greeting
- } // end of class ABC
-
- .method public static int32 'add'(int32 x,
- int32 y) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- .line 11,11 : 23,28 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: add
- IL_0003: ret
- } // end of method ABC::'add'
-
- .method public specialname static string
- get_greeting() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 6 (0x6)
- .maxstack 8
- IL_0000: ldstr "hello"
- IL_0005: ret
- } // end of method ABC::get_greeting
-
- .property string greeting()
- {
- .get string ABC::get_greeting()
- } // end of property ABC::greeting
-} // end of class ABC
-
-.class private abstract auto ansi sealed ''.$ABC
- extends [mscorlib]System.Object
-{
- .field static assembly int32 init@
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method private specialname rtspecialname static
- void .cctor() cil managed
- {
- // Code size 13 (0xd)
- .maxstack 3
- .locals init ([0] string greeting,
- [1] string V_1)
- .line 12,12 : 9,31 ''
- IL_0000: call string ABC::get_greeting()
- IL_0005: stloc.0
- .line 22,22 : 13,35 ''
- IL_0006: call string ABC/ABC::get_greeting()
- IL_000b: stloc.1
- IL_000c: ret
- } // end of method $ABC::.cctor
-
-} // end of class ''.$ABC
-
-
-// =============================================================
-
-// *********** DISASSEMBLY COMPLETE ***********************
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl
new file mode 100644
index 00000000000..771eaa3d503
--- /dev/null
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl
@@ -0,0 +1,1737 @@
+
+// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.81.0
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+
+
+// Metadata version: v4.0.30319
+.assembly extern retargetable mscorlib
+{
+ .publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
+ .ver 2:0:5:0
+}
+.assembly extern FSharp.Core
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
+ .ver 3:47:41:0
+}
+.assembly ToplevelModuleP
+{
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
+ int32,
+ int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )
+
+ // --- The following custom attribute is added automatically, do not uncomment -------
+ // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 00 01 00 00 00 00 )
+
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.mresource public FSharpSignatureData.ToplevelModuleP
+{
+ // Offset: 0x00000000 Length: 0x0000114F
+}
+.mresource public FSharpOptimizationData.ToplevelModuleP
+{
+ // Offset: 0x00001158 Length: 0x000003FE
+}
+.module ToplevelModuleP.dll
+// MVID: {576266E1-5A3A-8E4D-A745-0383E1666257}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WINDOWS_CUI
+.corflags 0x00000001 // ILONLY
+// Image base: 0x00A70000
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+
+.class public abstract auto ansi sealed ABC
+ extends [mscorlib]System.Object
+{
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
+ .class auto autochar sealed nested public beforefieldinit Expr
+ extends [mscorlib]System.Object
+ implements class [mscorlib]System.IEquatable`1,
+ [mscorlib]System.Collections.IStructuralEquatable,
+ class [mscorlib]System.IComparable`1,
+ [mscorlib]System.IComparable,
+ [mscorlib]System.Collections.IStructuralComparable
+ {
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
+ 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
+ .field assembly initonly int32 item
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .method public static class ABC/Expr
+ NewNum(int32 item) cil managed
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: newobj instance void ABC/Expr::.ctor(int32)
+ IL_0006: ret
+ } // end of method Expr::NewNum
+
+ .method assembly specialname rtspecialname
+ instance void .ctor(int32 item) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: ldarg.1
+ IL_0008: stfld int32 ABC/Expr::item
+ IL_000d: ret
+ } // end of method Expr::.ctor
+
+ .method public hidebysig instance int32
+ get_Item() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldfld int32 ABC/Expr::item
+ IL_0006: ret
+ } // end of method Expr::get_Item
+
+ .method public hidebysig instance int32
+ get_Tag() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 4 (0x4)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: pop
+ IL_0002: ldc.i4.0
+ IL_0003: ret
+ } // end of method Expr::get_Tag
+
+ .method assembly hidebysig specialname
+ instance object __DebugDisplay() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%+0.8A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
+ IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
+ IL_000f: ldarg.0
+ IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
+ IL_0015: ret
+ } // end of method Expr::__DebugDisplay
+
+ .method public strict virtual instance string
+ ToString() cil managed
+ {
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
+ IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
+ IL_000f: ldarg.0
+ IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
+ IL_0015: ret
+ } // end of method Expr::ToString
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(class ABC/Expr obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 81 (0x51)
+ .maxstack 4
+ .locals init (class ABC/Expr V_0,
+ class ABC/Expr V_1,
+ class [mscorlib]System.Collections.IComparer V_2,
+ int32 V_3,
+ int32 V_4)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0043
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_0041
+
+ IL_0015: ldarg.0
+ IL_0016: pop
+ IL_0017: ldarg.0
+ IL_0018: stloc.0
+ IL_0019: ldarg.1
+ IL_001a: stloc.1
+ IL_001b: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
+ IL_0020: stloc.2
+ IL_0021: ldloc.0
+ IL_0022: ldfld int32 ABC/Expr::item
+ IL_0027: stloc.3
+ IL_0028: ldloc.1
+ IL_0029: ldfld int32 ABC/Expr::item
+ IL_002e: stloc.s V_4
+ IL_0030: ldloc.3
+ IL_0031: ldloc.s V_4
+ IL_0033: bge.s IL_0037
+
+ IL_0035: br.s IL_0039
+
+ IL_0037: br.s IL_003b
+
+ IL_0039: ldc.i4.m1
+ IL_003a: ret
+
+ IL_003b: ldloc.3
+ IL_003c: ldloc.s V_4
+ IL_003e: cgt
+ IL_0040: ret
+
+ IL_0041: ldc.i4.1
+ IL_0042: ret
+
+ IL_0043: ldarg.1
+ IL_0044: ldnull
+ IL_0045: cgt.un
+ IL_0047: brfalse.s IL_004b
+
+ IL_0049: br.s IL_004d
+
+ IL_004b: br.s IL_004f
+
+ IL_004d: ldc.i4.m1
+ IL_004e: ret
+
+ IL_004f: ldc.i4.0
+ IL_0050: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 14 (0xe)
+ .maxstack 8
+ .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
+ .line 6,6 : 14,18 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\SerializableAttribute\\ToplevelModule.fs'
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldarg.1
+ IL_0003: unbox.any ABC/Expr
+ IL_0008: callvirt instance int32 ABC/Expr::CompareTo(class ABC/Expr)
+ IL_000d: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(object obj,
+ class [mscorlib]System.Collections.IComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 97 (0x61)
+ .maxstack 4
+ .locals init ([0] class ABC/Expr V_0,
+ [1] class ABC/Expr V_1,
+ [2] class ABC/Expr V_2,
+ [3] class [mscorlib]System.Collections.IComparer V_3,
+ [4] int32 V_4,
+ [5] int32 V_5)
+ .line 6,6 : 14,18
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: unbox.any ABC/Expr
+ IL_0007: stloc.0
+ IL_0008: ldarg.0
+ IL_0009: ldnull
+ IL_000a: cgt.un
+ IL_000c: brfalse.s IL_0010
+
+ IL_000e: br.s IL_0012
+
+ IL_0010: br.s IL_004e
+
+ .line 100001,100001 : 0,0
+ IL_0012: ldarg.1
+ IL_0013: unbox.any ABC/Expr
+ IL_0018: ldnull
+ IL_0019: cgt.un
+ IL_001b: brfalse.s IL_001f
+
+ IL_001d: br.s IL_0021
+
+ IL_001f: br.s IL_004c
+
+ .line 100001,100001 : 0,0
+ IL_0021: ldarg.0
+ IL_0022: pop
+ .line 100001,100001 : 0,0
+ IL_0023: ldarg.0
+ IL_0024: stloc.1
+ IL_0025: ldloc.0
+ IL_0026: stloc.2
+ IL_0027: ldarg.2
+ IL_0028: stloc.3
+ IL_0029: ldloc.1
+ IL_002a: ldfld int32 ABC/Expr::item
+ IL_002f: stloc.s V_4
+ IL_0031: ldloc.2
+ IL_0032: ldfld int32 ABC/Expr::item
+ IL_0037: stloc.s V_5
+ IL_0039: ldloc.s V_4
+ IL_003b: ldloc.s V_5
+ IL_003d: bge.s IL_0041
+
+ IL_003f: br.s IL_0043
+
+ IL_0041: br.s IL_0045
+
+ .line 100001,100001 : 0,0
+ IL_0043: ldc.i4.m1
+ IL_0044: ret
+
+ .line 100001,100001 : 0,0
+ IL_0045: ldloc.s V_4
+ IL_0047: ldloc.s V_5
+ IL_0049: cgt
+ IL_004b: ret
+
+ .line 100001,100001 : 0,0
+ IL_004c: ldc.i4.1
+ IL_004d: ret
+
+ .line 100001,100001 : 0,0
+ IL_004e: ldarg.1
+ IL_004f: unbox.any ABC/Expr
+ IL_0054: ldnull
+ IL_0055: cgt.un
+ IL_0057: brfalse.s IL_005b
+
+ IL_0059: br.s IL_005d
+
+ IL_005b: br.s IL_005f
+
+ .line 100001,100001 : 0,0
+ IL_005d: ldc.i4.m1
+ IL_005e: ret
+
+ .line 100001,100001 : 0,0
+ IL_005f: ldc.i4.0
+ IL_0060: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 46 (0x2e)
+ .maxstack 7
+ .locals init (int32 V_0,
+ class ABC/Expr V_1,
+ class [mscorlib]System.Collections.IEqualityComparer V_2)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002c
+
+ IL_000b: ldc.i4.0
+ IL_000c: stloc.0
+ IL_000d: ldarg.0
+ IL_000e: pop
+ IL_000f: ldarg.0
+ IL_0010: stloc.1
+ IL_0011: ldc.i4.0
+ IL_0012: stloc.0
+ IL_0013: ldc.i4 0x9e3779b9
+ IL_0018: ldarg.1
+ IL_0019: stloc.2
+ IL_001a: ldloc.1
+ IL_001b: ldfld int32 ABC/Expr::item
+ IL_0020: ldloc.0
+ IL_0021: ldc.i4.6
+ IL_0022: shl
+ IL_0023: ldloc.0
+ IL_0024: ldc.i4.2
+ IL_0025: shr
+ IL_0026: add
+ IL_0027: add
+ IL_0028: add
+ IL_0029: stloc.0
+ IL_002a: ldloc.0
+ IL_002b: ret
+
+ IL_002c: ldc.i4.0
+ IL_002d: ret
+ } // end of method Expr::GetHashCode
+
+ .method public hidebysig virtual final
+ instance int32 GetHashCode() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 13 (0xd)
+ .maxstack 8
+ .line 6,6 : 14,18
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
+ IL_0007: callvirt instance int32 ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
+ IL_000c: ret
+ } // end of method Expr::GetHashCode
+
+ .method public hidebysig virtual final
+ instance bool Equals(object obj,
+ class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 61 (0x3d)
+ .maxstack 4
+ .locals init (class ABC/Expr V_0,
+ class ABC/Expr V_1,
+ class ABC/Expr V_2,
+ class ABC/Expr V_3,
+ class [mscorlib]System.Collections.IEqualityComparer V_4)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0035
+
+ IL_000b: ldarg.1
+ IL_000c: isinst ABC/Expr
+ IL_0011: stloc.0
+ IL_0012: ldloc.0
+ IL_0013: brfalse.s IL_0017
+
+ IL_0015: br.s IL_0019
+
+ IL_0017: br.s IL_0033
+
+ IL_0019: ldloc.0
+ IL_001a: stloc.1
+ IL_001b: ldarg.0
+ IL_001c: pop
+ IL_001d: ldarg.0
+ IL_001e: stloc.2
+ IL_001f: ldloc.1
+ IL_0020: stloc.3
+ IL_0021: ldarg.2
+ IL_0022: stloc.s V_4
+ IL_0024: ldloc.2
+ IL_0025: ldfld int32 ABC/Expr::item
+ IL_002a: ldloc.3
+ IL_002b: ldfld int32 ABC/Expr::item
+ IL_0030: ceq
+ IL_0032: ret
+
+ IL_0033: ldc.i4.0
+ IL_0034: ret
+
+ IL_0035: ldarg.1
+ IL_0036: ldnull
+ IL_0037: cgt.un
+ IL_0039: ldc.i4.0
+ IL_003a: ceq
+ IL_003c: ret
+ } // end of method Expr::Equals
+
+ .method public hidebysig virtual final
+ instance bool Equals(class ABC/Expr obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 52 (0x34)
+ .maxstack 4
+ .locals init (class ABC/Expr V_0,
+ class ABC/Expr V_1)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002c
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_002a
+
+ IL_0015: ldarg.0
+ IL_0016: pop
+ IL_0017: ldarg.0
+ IL_0018: stloc.0
+ IL_0019: ldarg.1
+ IL_001a: stloc.1
+ IL_001b: ldloc.0
+ IL_001c: ldfld int32 ABC/Expr::item
+ IL_0021: ldloc.1
+ IL_0022: ldfld int32 ABC/Expr::item
+ IL_0027: ceq
+ IL_0029: ret
+
+ IL_002a: ldc.i4.0
+ IL_002b: ret
+
+ IL_002c: ldarg.1
+ IL_002d: ldnull
+ IL_002e: cgt.un
+ IL_0030: ldc.i4.0
+ IL_0031: ceq
+ IL_0033: ret
+ } // end of method Expr::Equals
+
+ .method public hidebysig virtual final
+ instance bool Equals(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 25 (0x19)
+ .maxstack 4
+ .locals init (class ABC/Expr V_0)
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: isinst ABC/Expr
+ IL_0007: stloc.0
+ IL_0008: ldloc.0
+ IL_0009: brfalse.s IL_000d
+
+ IL_000b: br.s IL_000f
+
+ IL_000d: br.s IL_0017
+
+ IL_000f: ldarg.0
+ IL_0010: ldloc.0
+ IL_0011: callvirt instance bool ABC/Expr::Equals(class ABC/Expr)
+ IL_0016: ret
+
+ IL_0017: ldc.i4.0
+ IL_0018: ret
+ } // end of method Expr::Equals
+
+ .property instance int32 Tag()
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .get instance int32 ABC/Expr::get_Tag()
+ } // end of property Expr::Tag
+ .property instance int32 Item()
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32,
+ int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .get instance int32 ABC/Expr::get_Item()
+ } // end of property Expr::Item
+ } // end of class Expr
+
+ .class auto ansi nested public beforefieldinit MyExn
+ extends [mscorlib]System.Exception
+ implements [mscorlib]System.Collections.IStructuralEquatable
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
+ .field assembly int32 Data0@
+ .method public specialname rtspecialname
+ instance void .ctor(int32 data0) cil managed
+ {
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Exception::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: ldarg.1
+ IL_0008: stfld int32 ABC/MyExn::Data0@
+ IL_000d: ret
+ } // end of method MyExn::.ctor
+
+ .method public specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Exception::.ctor()
+ IL_0006: ret
+ } // end of method MyExn::.ctor
+
+ .method public hidebysig specialname
+ instance int32 get_Data0() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldfld int32 ABC/MyExn::Data0@
+ IL_0006: ret
+ } // end of method MyExn::get_Data0
+
+ .method public hidebysig virtual instance int32
+ GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 45 (0x2d)
+ .maxstack 7
+ .locals init (int32 V_0,
+ class [mscorlib]System.Collections.IEqualityComparer V_1)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002b
+
+ IL_000b: ldc.i4.0
+ IL_000c: stloc.0
+ IL_000d: ldc.i4 0x9e3779b9
+ IL_0012: ldarg.1
+ IL_0013: stloc.1
+ IL_0014: ldarg.0
+ IL_0015: castclass ABC/MyExn
+ IL_001a: call instance int32 ABC/MyExn::get_Data0()
+ IL_001f: ldloc.0
+ IL_0020: ldc.i4.6
+ IL_0021: shl
+ IL_0022: ldloc.0
+ IL_0023: ldc.i4.2
+ IL_0024: shr
+ IL_0025: add
+ IL_0026: add
+ IL_0027: add
+ IL_0028: stloc.0
+ IL_0029: ldloc.0
+ IL_002a: ret
+
+ IL_002b: ldc.i4.0
+ IL_002c: ret
+ } // end of method MyExn::GetHashCode
+
+ .method public hidebysig virtual instance int32
+ GetHashCode() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 13 (0xd)
+ .maxstack 8
+ .line 7,7 : 19,24
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
+ IL_0007: callvirt instance int32 ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
+ IL_000c: ret
+ } // end of method MyExn::GetHashCode
+
+ .method public hidebysig virtual instance bool
+ Equals(object obj,
+ class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 76 (0x4c)
+ .maxstack 4
+ .locals init (class [mscorlib]System.Exception V_0,
+ class [mscorlib]System.Exception V_1,
+ class [mscorlib]System.Collections.IEqualityComparer V_2)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0044
+
+ IL_000b: ldarg.1
+ IL_000c: isinst [mscorlib]System.Exception
+ IL_0011: stloc.0
+ IL_0012: ldloc.0
+ IL_0013: brfalse.s IL_0017
+
+ IL_0015: br.s IL_0019
+
+ IL_0017: br.s IL_0042
+
+ IL_0019: ldloc.0
+ IL_001a: stloc.1
+ IL_001b: ldloc.0
+ IL_001c: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
+ IL_0021: brtrue.s IL_0025
+
+ IL_0023: br.s IL_0040
+
+ IL_0025: ldarg.2
+ IL_0026: stloc.2
+ IL_0027: ldarg.0
+ IL_0028: castclass ABC/MyExn
+ IL_002d: call instance int32 ABC/MyExn::get_Data0()
+ IL_0032: ldloc.1
+ IL_0033: castclass ABC/MyExn
+ IL_0038: call instance int32 ABC/MyExn::get_Data0()
+ IL_003d: ceq
+ IL_003f: ret
+
+ IL_0040: ldc.i4.0
+ IL_0041: ret
+
+ IL_0042: ldc.i4.0
+ IL_0043: ret
+
+ IL_0044: ldarg.1
+ IL_0045: ldnull
+ IL_0046: cgt.un
+ IL_0048: ldc.i4.0
+ IL_0049: ceq
+ IL_004b: ret
+ } // end of method MyExn::Equals
+
+ .method public hidebysig instance bool
+ Equals(class [mscorlib]System.Exception obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 68 (0x44)
+ .maxstack 4
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_003c
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_003a
+
+ IL_0015: ldarg.1
+ IL_0016: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
+ IL_001b: brtrue.s IL_001f
+
+ IL_001d: br.s IL_0038
+
+ IL_001f: ldarg.0
+ IL_0020: castclass ABC/MyExn
+ IL_0025: call instance int32 ABC/MyExn::get_Data0()
+ IL_002a: ldarg.1
+ IL_002b: castclass ABC/MyExn
+ IL_0030: call instance int32 ABC/MyExn::get_Data0()
+ IL_0035: ceq
+ IL_0037: ret
+
+ IL_0038: ldc.i4.0
+ IL_0039: ret
+
+ IL_003a: ldc.i4.0
+ IL_003b: ret
+
+ IL_003c: ldarg.1
+ IL_003d: ldnull
+ IL_003e: cgt.un
+ IL_0040: ldc.i4.0
+ IL_0041: ceq
+ IL_0043: ret
+ } // end of method MyExn::Equals
+
+ .method public hidebysig virtual instance bool
+ Equals(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 25 (0x19)
+ .maxstack 4
+ .locals init (class [mscorlib]System.Exception V_0)
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: isinst [mscorlib]System.Exception
+ IL_0007: stloc.0
+ IL_0008: ldloc.0
+ IL_0009: brfalse.s IL_000d
+
+ IL_000b: br.s IL_000f
+
+ IL_000d: br.s IL_0017
+
+ IL_000f: ldarg.0
+ IL_0010: ldloc.0
+ IL_0011: callvirt instance bool ABC/MyExn::Equals(class [mscorlib]System.Exception)
+ IL_0016: ret
+
+ IL_0017: ldc.i4.0
+ IL_0018: ret
+ } // end of method MyExn::Equals
+
+ .property instance int32 Data0()
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
+ .get instance int32 ABC/MyExn::get_Data0()
+ } // end of property MyExn::Data0
+ } // end of class MyExn
+
+ .class auto ansi nested public A
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
+ .field assembly string x
+ .method public specialname rtspecialname
+ instance void .ctor(string x) cil managed
+ {
+ // Code size 17 (0x11)
+ .maxstack 8
+ .line 8,8 : 16,17
+ IL_0000: ldarg.0
+ IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: pop
+ IL_0008: nop
+ IL_0009: ldarg.0
+ IL_000a: ldarg.1
+ IL_000b: stfld string ABC/A::x
+ .line 8,8 : 14,15
+ IL_0010: ret
+ } // end of method A::.ctor
+
+ .method public hidebysig specialname
+ instance string get_X() cil managed
+ {
+ // Code size 8 (0x8)
+ .maxstack 8
+ .line 8,8 : 42,43
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldfld string ABC/A::x
+ IL_0007: ret
+ } // end of method A::get_X
+
+ .property instance string X()
+ {
+ .get instance string ABC/A::get_X()
+ } // end of property A::X
+ } // end of class A
+
+ .class abstract auto ansi sealed nested public ABC
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
+ .class auto autochar sealed nested public beforefieldinit Expr
+ extends [mscorlib]System.Object
+ implements class [mscorlib]System.IEquatable`1,
+ [mscorlib]System.Collections.IStructuralEquatable,
+ class [mscorlib]System.IComparable`1,
+ [mscorlib]System.IComparable,
+ [mscorlib]System.Collections.IStructuralComparable
+ {
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
+ 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
+ .field assembly initonly int32 item
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .method public static class ABC/ABC/Expr
+ NewNum(int32 item) cil managed
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: newobj instance void ABC/ABC/Expr::.ctor(int32)
+ IL_0006: ret
+ } // end of method Expr::NewNum
+
+ .method assembly specialname rtspecialname
+ instance void .ctor(int32 item) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: ldarg.1
+ IL_0008: stfld int32 ABC/ABC/Expr::item
+ IL_000d: ret
+ } // end of method Expr::.ctor
+
+ .method public hidebysig instance int32
+ get_Item() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldfld int32 ABC/ABC/Expr::item
+ IL_0006: ret
+ } // end of method Expr::get_Item
+
+ .method public hidebysig instance int32
+ get_Tag() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 4 (0x4)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: pop
+ IL_0002: ldc.i4.0
+ IL_0003: ret
+ } // end of method Expr::get_Tag
+
+ .method assembly hidebysig specialname
+ instance object __DebugDisplay() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%+0.8A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
+ IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
+ IL_000f: ldarg.0
+ IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
+ IL_0015: ret
+ } // end of method Expr::__DebugDisplay
+
+ .method public strict virtual instance string
+ ToString() cil managed
+ {
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
+ IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
+ IL_000f: ldarg.0
+ IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
+ IL_0015: ret
+ } // end of method Expr::ToString
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(class ABC/ABC/Expr obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 81 (0x51)
+ .maxstack 4
+ .locals init (class ABC/ABC/Expr V_0,
+ class ABC/ABC/Expr V_1,
+ class [mscorlib]System.Collections.IComparer V_2,
+ int32 V_3,
+ int32 V_4)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0043
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_0041
+
+ IL_0015: ldarg.0
+ IL_0016: pop
+ IL_0017: ldarg.0
+ IL_0018: stloc.0
+ IL_0019: ldarg.1
+ IL_001a: stloc.1
+ IL_001b: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
+ IL_0020: stloc.2
+ IL_0021: ldloc.0
+ IL_0022: ldfld int32 ABC/ABC/Expr::item
+ IL_0027: stloc.3
+ IL_0028: ldloc.1
+ IL_0029: ldfld int32 ABC/ABC/Expr::item
+ IL_002e: stloc.s V_4
+ IL_0030: ldloc.3
+ IL_0031: ldloc.s V_4
+ IL_0033: bge.s IL_0037
+
+ IL_0035: br.s IL_0039
+
+ IL_0037: br.s IL_003b
+
+ IL_0039: ldc.i4.m1
+ IL_003a: ret
+
+ IL_003b: ldloc.3
+ IL_003c: ldloc.s V_4
+ IL_003e: cgt
+ IL_0040: ret
+
+ IL_0041: ldc.i4.1
+ IL_0042: ret
+
+ IL_0043: ldarg.1
+ IL_0044: ldnull
+ IL_0045: cgt.un
+ IL_0047: brfalse.s IL_004b
+
+ IL_0049: br.s IL_004d
+
+ IL_004b: br.s IL_004f
+
+ IL_004d: ldc.i4.m1
+ IL_004e: ret
+
+ IL_004f: ldc.i4.0
+ IL_0050: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 14 (0xe)
+ .maxstack 8
+ .line 16,16 : 18,22
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldarg.1
+ IL_0003: unbox.any ABC/ABC/Expr
+ IL_0008: callvirt instance int32 ABC/ABC/Expr::CompareTo(class ABC/ABC/Expr)
+ IL_000d: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 CompareTo(object obj,
+ class [mscorlib]System.Collections.IComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 97 (0x61)
+ .maxstack 4
+ .locals init ([0] class ABC/ABC/Expr V_0,
+ [1] class ABC/ABC/Expr V_1,
+ [2] class ABC/ABC/Expr V_2,
+ [3] class [mscorlib]System.Collections.IComparer V_3,
+ [4] int32 V_4,
+ [5] int32 V_5)
+ .line 16,16 : 18,22
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: unbox.any ABC/ABC/Expr
+ IL_0007: stloc.0
+ IL_0008: ldarg.0
+ IL_0009: ldnull
+ IL_000a: cgt.un
+ IL_000c: brfalse.s IL_0010
+
+ IL_000e: br.s IL_0012
+
+ IL_0010: br.s IL_004e
+
+ .line 100001,100001 : 0,0
+ IL_0012: ldarg.1
+ IL_0013: unbox.any ABC/ABC/Expr
+ IL_0018: ldnull
+ IL_0019: cgt.un
+ IL_001b: brfalse.s IL_001f
+
+ IL_001d: br.s IL_0021
+
+ IL_001f: br.s IL_004c
+
+ .line 100001,100001 : 0,0
+ IL_0021: ldarg.0
+ IL_0022: pop
+ .line 100001,100001 : 0,0
+ IL_0023: ldarg.0
+ IL_0024: stloc.1
+ IL_0025: ldloc.0
+ IL_0026: stloc.2
+ IL_0027: ldarg.2
+ IL_0028: stloc.3
+ IL_0029: ldloc.1
+ IL_002a: ldfld int32 ABC/ABC/Expr::item
+ IL_002f: stloc.s V_4
+ IL_0031: ldloc.2
+ IL_0032: ldfld int32 ABC/ABC/Expr::item
+ IL_0037: stloc.s V_5
+ IL_0039: ldloc.s V_4
+ IL_003b: ldloc.s V_5
+ IL_003d: bge.s IL_0041
+
+ IL_003f: br.s IL_0043
+
+ IL_0041: br.s IL_0045
+
+ .line 100001,100001 : 0,0
+ IL_0043: ldc.i4.m1
+ IL_0044: ret
+
+ .line 100001,100001 : 0,0
+ IL_0045: ldloc.s V_4
+ IL_0047: ldloc.s V_5
+ IL_0049: cgt
+ IL_004b: ret
+
+ .line 100001,100001 : 0,0
+ IL_004c: ldc.i4.1
+ IL_004d: ret
+
+ .line 100001,100001 : 0,0
+ IL_004e: ldarg.1
+ IL_004f: unbox.any ABC/ABC/Expr
+ IL_0054: ldnull
+ IL_0055: cgt.un
+ IL_0057: brfalse.s IL_005b
+
+ IL_0059: br.s IL_005d
+
+ IL_005b: br.s IL_005f
+
+ .line 100001,100001 : 0,0
+ IL_005d: ldc.i4.m1
+ IL_005e: ret
+
+ .line 100001,100001 : 0,0
+ IL_005f: ldc.i4.0
+ IL_0060: ret
+ } // end of method Expr::CompareTo
+
+ .method public hidebysig virtual final
+ instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 46 (0x2e)
+ .maxstack 7
+ .locals init (int32 V_0,
+ class ABC/ABC/Expr V_1,
+ class [mscorlib]System.Collections.IEqualityComparer V_2)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002c
+
+ IL_000b: ldc.i4.0
+ IL_000c: stloc.0
+ IL_000d: ldarg.0
+ IL_000e: pop
+ IL_000f: ldarg.0
+ IL_0010: stloc.1
+ IL_0011: ldc.i4.0
+ IL_0012: stloc.0
+ IL_0013: ldc.i4 0x9e3779b9
+ IL_0018: ldarg.1
+ IL_0019: stloc.2
+ IL_001a: ldloc.1
+ IL_001b: ldfld int32 ABC/ABC/Expr::item
+ IL_0020: ldloc.0
+ IL_0021: ldc.i4.6
+ IL_0022: shl
+ IL_0023: ldloc.0
+ IL_0024: ldc.i4.2
+ IL_0025: shr
+ IL_0026: add
+ IL_0027: add
+ IL_0028: add
+ IL_0029: stloc.0
+ IL_002a: ldloc.0
+ IL_002b: ret
+
+ IL_002c: ldc.i4.0
+ IL_002d: ret
+ } // end of method Expr::GetHashCode
+
+ .method public hidebysig virtual final
+ instance int32 GetHashCode() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 13 (0xd)
+ .maxstack 8
+ .line 16,16 : 18,22
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
+ IL_0007: callvirt instance int32 ABC/ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
+ IL_000c: ret
+ } // end of method Expr::GetHashCode
+
+ .method public hidebysig virtual final
+ instance bool Equals(object obj,
+ class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 61 (0x3d)
+ .maxstack 4
+ .locals init (class ABC/ABC/Expr V_0,
+ class ABC/ABC/Expr V_1,
+ class ABC/ABC/Expr V_2,
+ class ABC/ABC/Expr V_3,
+ class [mscorlib]System.Collections.IEqualityComparer V_4)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0035
+
+ IL_000b: ldarg.1
+ IL_000c: isinst ABC/ABC/Expr
+ IL_0011: stloc.0
+ IL_0012: ldloc.0
+ IL_0013: brfalse.s IL_0017
+
+ IL_0015: br.s IL_0019
+
+ IL_0017: br.s IL_0033
+
+ IL_0019: ldloc.0
+ IL_001a: stloc.1
+ IL_001b: ldarg.0
+ IL_001c: pop
+ IL_001d: ldarg.0
+ IL_001e: stloc.2
+ IL_001f: ldloc.1
+ IL_0020: stloc.3
+ IL_0021: ldarg.2
+ IL_0022: stloc.s V_4
+ IL_0024: ldloc.2
+ IL_0025: ldfld int32 ABC/ABC/Expr::item
+ IL_002a: ldloc.3
+ IL_002b: ldfld int32 ABC/ABC/Expr::item
+ IL_0030: ceq
+ IL_0032: ret
+
+ IL_0033: ldc.i4.0
+ IL_0034: ret
+
+ IL_0035: ldarg.1
+ IL_0036: ldnull
+ IL_0037: cgt.un
+ IL_0039: ldc.i4.0
+ IL_003a: ceq
+ IL_003c: ret
+ } // end of method Expr::Equals
+
+ .method public hidebysig virtual final
+ instance bool Equals(class ABC/ABC/Expr obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 52 (0x34)
+ .maxstack 4
+ .locals init (class ABC/ABC/Expr V_0,
+ class ABC/ABC/Expr V_1)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002c
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_002a
+
+ IL_0015: ldarg.0
+ IL_0016: pop
+ IL_0017: ldarg.0
+ IL_0018: stloc.0
+ IL_0019: ldarg.1
+ IL_001a: stloc.1
+ IL_001b: ldloc.0
+ IL_001c: ldfld int32 ABC/ABC/Expr::item
+ IL_0021: ldloc.1
+ IL_0022: ldfld int32 ABC/ABC/Expr::item
+ IL_0027: ceq
+ IL_0029: ret
+
+ IL_002a: ldc.i4.0
+ IL_002b: ret
+
+ IL_002c: ldarg.1
+ IL_002d: ldnull
+ IL_002e: cgt.un
+ IL_0030: ldc.i4.0
+ IL_0031: ceq
+ IL_0033: ret
+ } // end of method Expr::Equals
+
+ .method public hidebysig virtual final
+ instance bool Equals(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 25 (0x19)
+ .maxstack 4
+ .locals init (class ABC/ABC/Expr V_0)
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: isinst ABC/ABC/Expr
+ IL_0007: stloc.0
+ IL_0008: ldloc.0
+ IL_0009: brfalse.s IL_000d
+
+ IL_000b: br.s IL_000f
+
+ IL_000d: br.s IL_0017
+
+ IL_000f: ldarg.0
+ IL_0010: ldloc.0
+ IL_0011: callvirt instance bool ABC/ABC/Expr::Equals(class ABC/ABC/Expr)
+ IL_0016: ret
+
+ IL_0017: ldc.i4.0
+ IL_0018: ret
+ } // end of method Expr::Equals
+
+ .property instance int32 Tag()
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .get instance int32 ABC/ABC/Expr::get_Tag()
+ } // end of property Expr::Tag
+ .property instance int32 Item()
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32,
+ int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .get instance int32 ABC/ABC/Expr::get_Item()
+ } // end of property Expr::Item
+ } // end of class Expr
+
+ .class auto ansi nested public beforefieldinit MyExn
+ extends [mscorlib]System.Exception
+ implements [mscorlib]System.Collections.IStructuralEquatable
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
+ .field assembly int32 Data0@
+ .method public specialname rtspecialname
+ instance void .ctor(int32 data0) cil managed
+ {
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Exception::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: ldarg.1
+ IL_0008: stfld int32 ABC/ABC/MyExn::Data0@
+ IL_000d: ret
+ } // end of method MyExn::.ctor
+
+ .method public specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Exception::.ctor()
+ IL_0006: ret
+ } // end of method MyExn::.ctor
+
+ .method public hidebysig specialname
+ instance int32 get_Data0() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldfld int32 ABC/ABC/MyExn::Data0@
+ IL_0006: ret
+ } // end of method MyExn::get_Data0
+
+ .method public hidebysig virtual instance int32
+ GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 45 (0x2d)
+ .maxstack 7
+ .locals init (int32 V_0,
+ class [mscorlib]System.Collections.IEqualityComparer V_1)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_002b
+
+ IL_000b: ldc.i4.0
+ IL_000c: stloc.0
+ IL_000d: ldc.i4 0x9e3779b9
+ IL_0012: ldarg.1
+ IL_0013: stloc.1
+ IL_0014: ldarg.0
+ IL_0015: castclass ABC/ABC/MyExn
+ IL_001a: call instance int32 ABC/ABC/MyExn::get_Data0()
+ IL_001f: ldloc.0
+ IL_0020: ldc.i4.6
+ IL_0021: shl
+ IL_0022: ldloc.0
+ IL_0023: ldc.i4.2
+ IL_0024: shr
+ IL_0025: add
+ IL_0026: add
+ IL_0027: add
+ IL_0028: stloc.0
+ IL_0029: ldloc.0
+ IL_002a: ret
+
+ IL_002b: ldc.i4.0
+ IL_002c: ret
+ } // end of method MyExn::GetHashCode
+
+ .method public hidebysig virtual instance int32
+ GetHashCode() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 13 (0xd)
+ .maxstack 8
+ .line 17,17 : 23,28
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
+ IL_0007: callvirt instance int32 ABC/ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
+ IL_000c: ret
+ } // end of method MyExn::GetHashCode
+
+ .method public hidebysig virtual instance bool
+ Equals(object obj,
+ class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 76 (0x4c)
+ .maxstack 4
+ .locals init (class [mscorlib]System.Exception V_0,
+ class [mscorlib]System.Exception V_1,
+ class [mscorlib]System.Collections.IEqualityComparer V_2)
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_0044
+
+ IL_000b: ldarg.1
+ IL_000c: isinst [mscorlib]System.Exception
+ IL_0011: stloc.0
+ IL_0012: ldloc.0
+ IL_0013: brfalse.s IL_0017
+
+ IL_0015: br.s IL_0019
+
+ IL_0017: br.s IL_0042
+
+ IL_0019: ldloc.0
+ IL_001a: stloc.1
+ IL_001b: ldloc.0
+ IL_001c: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
+ IL_0021: brtrue.s IL_0025
+
+ IL_0023: br.s IL_0040
+
+ IL_0025: ldarg.2
+ IL_0026: stloc.2
+ IL_0027: ldarg.0
+ IL_0028: castclass ABC/ABC/MyExn
+ IL_002d: call instance int32 ABC/ABC/MyExn::get_Data0()
+ IL_0032: ldloc.1
+ IL_0033: castclass ABC/ABC/MyExn
+ IL_0038: call instance int32 ABC/ABC/MyExn::get_Data0()
+ IL_003d: ceq
+ IL_003f: ret
+
+ IL_0040: ldc.i4.0
+ IL_0041: ret
+
+ IL_0042: ldc.i4.0
+ IL_0043: ret
+
+ IL_0044: ldarg.1
+ IL_0045: ldnull
+ IL_0046: cgt.un
+ IL_0048: ldc.i4.0
+ IL_0049: ceq
+ IL_004b: ret
+ } // end of method MyExn::Equals
+
+ .method public hidebysig instance bool
+ Equals(class [mscorlib]System.Exception obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 68 (0x44)
+ .maxstack 4
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldnull
+ IL_0003: cgt.un
+ IL_0005: brfalse.s IL_0009
+
+ IL_0007: br.s IL_000b
+
+ IL_0009: br.s IL_003c
+
+ IL_000b: ldarg.1
+ IL_000c: ldnull
+ IL_000d: cgt.un
+ IL_000f: brfalse.s IL_0013
+
+ IL_0011: br.s IL_0015
+
+ IL_0013: br.s IL_003a
+
+ IL_0015: ldarg.1
+ IL_0016: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
+ IL_001b: brtrue.s IL_001f
+
+ IL_001d: br.s IL_0038
+
+ IL_001f: ldarg.0
+ IL_0020: castclass ABC/ABC/MyExn
+ IL_0025: call instance int32 ABC/ABC/MyExn::get_Data0()
+ IL_002a: ldarg.1
+ IL_002b: castclass ABC/ABC/MyExn
+ IL_0030: call instance int32 ABC/ABC/MyExn::get_Data0()
+ IL_0035: ceq
+ IL_0037: ret
+
+ IL_0038: ldc.i4.0
+ IL_0039: ret
+
+ IL_003a: ldc.i4.0
+ IL_003b: ret
+
+ IL_003c: ldarg.1
+ IL_003d: ldnull
+ IL_003e: cgt.un
+ IL_0040: ldc.i4.0
+ IL_0041: ceq
+ IL_0043: ret
+ } // end of method MyExn::Equals
+
+ .method public hidebysig virtual instance bool
+ Equals(object obj) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 25 (0x19)
+ .maxstack 4
+ .locals init (class [mscorlib]System.Exception V_0)
+ IL_0000: nop
+ IL_0001: ldarg.1
+ IL_0002: isinst [mscorlib]System.Exception
+ IL_0007: stloc.0
+ IL_0008: ldloc.0
+ IL_0009: brfalse.s IL_000d
+
+ IL_000b: br.s IL_000f
+
+ IL_000d: br.s IL_0017
+
+ IL_000f: ldarg.0
+ IL_0010: ldloc.0
+ IL_0011: callvirt instance bool ABC/ABC/MyExn::Equals(class [mscorlib]System.Exception)
+ IL_0016: ret
+
+ IL_0017: ldc.i4.0
+ IL_0018: ret
+ } // end of method MyExn::Equals
+
+ .property instance int32 Data0()
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
+ .get instance int32 ABC/ABC/MyExn::get_Data0()
+ } // end of property MyExn::Data0
+ } // end of class MyExn
+
+ .class auto ansi nested public A
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
+ .field assembly string x
+ .method public specialname rtspecialname
+ instance void .ctor(string x) cil managed
+ {
+ // Code size 17 (0x11)
+ .maxstack 8
+ .line 18,18 : 20,21
+ IL_0000: ldarg.0
+ IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: pop
+ IL_0008: nop
+ IL_0009: ldarg.0
+ IL_000a: ldarg.1
+ IL_000b: stfld string ABC/ABC/A::x
+ .line 18,18 : 18,19
+ IL_0010: ret
+ } // end of method A::.ctor
+
+ .method public hidebysig specialname
+ instance string get_X() cil managed
+ {
+ // Code size 8 (0x8)
+ .maxstack 8
+ .line 18,18 : 46,47
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldfld string ABC/ABC/A::x
+ IL_0007: ret
+ } // end of method A::get_X
+
+ .property instance string X()
+ {
+ .get instance string ABC/ABC/A::get_X()
+ } // end of property A::X
+ } // end of class A
+
+ .method public static int32 'add'(int32 x,
+ int32 y) cil managed
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
+ // Code size 5 (0x5)
+ .maxstack 8
+ .line 21,21 : 27,32
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldarg.1
+ IL_0003: add
+ IL_0004: ret
+ } // end of method ABC::'add'
+
+ .method public specialname static string
+ get_greeting() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: nop
+ IL_0001: ldstr "hello"
+ IL_0006: ret
+ } // end of method ABC::get_greeting
+
+ .property string greeting()
+ {
+ .get string ABC/ABC::get_greeting()
+ } // end of property ABC::greeting
+ } // end of class ABC
+
+ .method public static int32 'add'(int32 x,
+ int32 y) cil managed
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
+ // Code size 5 (0x5)
+ .maxstack 8
+ .line 11,11 : 23,28
+ IL_0000: nop
+ IL_0001: ldarg.0
+ IL_0002: ldarg.1
+ IL_0003: add
+ IL_0004: ret
+ } // end of method ABC::'add'
+
+ .method public specialname static string
+ get_greeting() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: nop
+ IL_0001: ldstr "hello"
+ IL_0006: ret
+ } // end of method ABC::get_greeting
+
+ .property string greeting()
+ {
+ .get string ABC::get_greeting()
+ } // end of property ABC::greeting
+} // end of class ABC
+
+.class private abstract auto ansi sealed ''.$ABC
+ extends [mscorlib]System.Object
+{
+ .field static assembly int32 init@
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .method private specialname rtspecialname static
+ void .cctor() cil managed
+ {
+ // Code size 14 (0xe)
+ .maxstack 3
+ .locals init ([0] string greeting,
+ [1] string V_1)
+ .line 12,12 : 9,31 ''
+ IL_0000: nop
+ IL_0001: call string ABC::get_greeting()
+ IL_0006: stloc.0
+ .line 22,22 : 13,35 ''
+ IL_0007: call string ABC/ABC::get_greeting()
+ IL_000c: stloc.1
+ IL_000d: ret
+ } // end of method $ABC::.cctor
+} // end of class ''.$ABC
+
+
+// =============================================================
+
+// *********** DISASSEMBLY COMPLETE ***********************
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl
index 32f8ac85d82..bf83c61d107 100644
--- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl
@@ -1,2435 +1,4 @@
-// Microsoft (R) .NET Framework IL Disassembler. Version 4.8.3928.0
+// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. All rights reserved.
-
-
-// Metadata version: v4.0.30319
-.assembly extern mscorlib
-{
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
- .ver 4:0:0:0
-}
-.assembly extern FSharp.Core
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
- .ver 5:0:0:0
-}
-.assembly ToplevelNamespace
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
- int32,
- int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )
-
- // --- The following custom attribute is added automatically, do not uncomment -------
- // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 )
-
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-.mresource public FSharpSignatureData.ToplevelNamespace
-{
- // Offset: 0x00000000 Length: 0x00001848
-}
-.mresource public FSharpOptimizationData.ToplevelNamespace
-{
- // Offset: 0x00001850 Length: 0x0000055C
-}
-.module ToplevelNamespace.dll
-// MVID: {60D48932-218B-729A-A745-03833289D460}
-.imagebase 0x00400000
-.file alignment 0x00000200
-.stackreserve 0x00100000
-.subsystem 0x0003 // WINDOWS_CUI
-.corflags 0x00000001 // ILONLY
-// Image base: 0x04F20000
-
-
-// =============== CLASS MEMBERS DECLARATION ===================
-
-.class public auto autochar serializable sealed beforefieldinit XYZ.Expr
- extends [mscorlib]System.Object
- implements class [mscorlib]System.IEquatable`1,
- [mscorlib]System.Collections.IStructuralEquatable,
- class [mscorlib]System.IComparable`1,
- [mscorlib]System.IComparable,
- [mscorlib]System.Collections.IStructuralComparable
-{
- .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
- 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
- .field assembly initonly int32 item
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method public static class XYZ.Expr NewNum(int32 item) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: newobj instance void XYZ.Expr::.ctor(int32)
- IL_0006: ret
- } // end of method Expr::NewNum
-
- .method assembly specialname rtspecialname
- instance void .ctor(int32 item) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.Expr::item
- IL_000d: ret
- } // end of method Expr::.ctor
-
- .method public hidebysig instance int32
- get_Item() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.Expr::item
- IL_0006: ret
- } // end of method Expr::get_Item
-
- .method public hidebysig instance int32
- get_Tag() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: pop
- IL_0002: ldc.i4.0
- IL_0003: ret
- } // end of method Expr::get_Tag
-
- .method assembly hidebysig specialname
- instance object __DebugDisplay() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+0.8A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::__DebugDisplay
-
- .method public strict virtual instance string
- ToString() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.Expr>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::ToString
-
- .method public hidebysig virtual final
- instance int32 CompareTo(class XYZ.Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 64 (0x40)
- .maxstack 4
- .locals init ([0] class XYZ.Expr V_0,
- [1] class XYZ.Expr V_1,
- [2] class [mscorlib]System.Collections.IComparer V_2,
- [3] int32 V_3,
- [4] int32 V_4)
- .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'
- .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\fsharp\\tests\\fsharpqa\\source\\CodeGen\\EmittedIL\\SerializableAttribute\\ToplevelNamespace.fs'
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0036
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0034
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
- IL_0017: stloc.2
- IL_0018: ldloc.0
- IL_0019: ldfld int32 XYZ.Expr::item
- IL_001e: stloc.3
- IL_001f: ldloc.1
- IL_0020: ldfld int32 XYZ.Expr::item
- IL_0025: stloc.s V_4
- IL_0027: ldloc.3
- IL_0028: ldloc.s V_4
- IL_002a: bge.s IL_002e
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldc.i4.m1
- IL_002d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002e: ldloc.3
- IL_002f: ldloc.s V_4
- IL_0031: cgt
- IL_0033: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0034: ldc.i4.1
- IL_0035: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldarg.1
- IL_0037: ldnull
- IL_0038: cgt.un
- IL_003a: brfalse.s IL_003e
-
- .line 100001,100001 : 0,0 ''
- IL_003c: ldc.i4.m1
- IL_003d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003e: ldc.i4.0
- IL_003f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 13 (0xd)
- .maxstack 8
- .line 7,7 : 10,14 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: unbox.any XYZ.Expr
- IL_0007: callvirt instance int32 XYZ.Expr::CompareTo(class XYZ.Expr)
- IL_000c: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj,
- class [mscorlib]System.Collections.IComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 80 (0x50)
- .maxstack 4
- .locals init ([0] class XYZ.Expr V_0,
- [1] class XYZ.Expr V_1,
- [2] class XYZ.Expr V_2,
- [3] class [mscorlib]System.Collections.IComparer V_3,
- [4] int32 V_4,
- [5] int32 V_5)
- .line 7,7 : 10,14 ''
- IL_0000: ldarg.1
- IL_0001: unbox.any XYZ.Expr
- IL_0006: stloc.0
- IL_0007: ldarg.0
- IL_0008: ldnull
- IL_0009: cgt.un
- IL_000b: brfalse.s IL_0041
-
- .line 100001,100001 : 0,0 ''
- IL_000d: ldarg.1
- IL_000e: unbox.any XYZ.Expr
- IL_0013: ldnull
- IL_0014: cgt.un
- IL_0016: brfalse.s IL_003f
-
- .line 100001,100001 : 0,0 ''
- IL_0018: ldarg.0
- IL_0019: pop
- .line 100001,100001 : 0,0 ''
- IL_001a: ldarg.0
- IL_001b: stloc.1
- IL_001c: ldloc.0
- IL_001d: stloc.2
- IL_001e: ldarg.2
- IL_001f: stloc.3
- IL_0020: ldloc.1
- IL_0021: ldfld int32 XYZ.Expr::item
- IL_0026: stloc.s V_4
- IL_0028: ldloc.2
- IL_0029: ldfld int32 XYZ.Expr::item
- IL_002e: stloc.s V_5
- IL_0030: ldloc.s V_4
- IL_0032: ldloc.s V_5
- IL_0034: bge.s IL_0038
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldc.i4.m1
- IL_0037: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0038: ldloc.s V_4
- IL_003a: ldloc.s V_5
- IL_003c: cgt
- IL_003e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003f: ldc.i4.1
- IL_0040: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0041: ldarg.1
- IL_0042: unbox.any XYZ.Expr
- IL_0047: ldnull
- IL_0048: cgt.un
- IL_004a: brfalse.s IL_004e
-
- .line 100001,100001 : 0,0 ''
- IL_004c: ldc.i4.m1
- IL_004d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_004e: ldc.i4.0
- IL_004f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 41 (0x29)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class XYZ.Expr V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0027
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldarg.0
- IL_0009: pop
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: stloc.1
- IL_000c: ldc.i4.0
- IL_000d: stloc.0
- IL_000e: ldc.i4 0x9e3779b9
- IL_0013: ldarg.1
- IL_0014: stloc.2
- IL_0015: ldloc.1
- IL_0016: ldfld int32 XYZ.Expr::item
- IL_001b: ldloc.0
- IL_001c: ldc.i4.6
- IL_001d: shl
- IL_001e: ldloc.0
- IL_001f: ldc.i4.2
- IL_0020: shr
- IL_0021: add
- IL_0022: add
- IL_0023: add
- IL_0024: stloc.0
- IL_0025: ldloc.0
- IL_0026: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0027: ldc.i4.0
- IL_0028: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance int32 GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 7,7 : 10,14 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance bool Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 52 (0x34)
- .maxstack 4
- .locals init ([0] class XYZ.Expr V_0,
- [1] class XYZ.Expr V_1,
- [2] class XYZ.Expr V_2,
- [3] class XYZ.Expr V_3,
- [4] class [mscorlib]System.Collections.IEqualityComparer V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_002c
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst XYZ.Expr
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_002a
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldarg.0
- IL_0013: pop
- .line 100001,100001 : 0,0 ''
- IL_0014: ldarg.0
- IL_0015: stloc.2
- IL_0016: ldloc.1
- IL_0017: stloc.3
- IL_0018: ldarg.2
- IL_0019: stloc.s V_4
- IL_001b: ldloc.2
- IL_001c: ldfld int32 XYZ.Expr::item
- IL_0021: ldloc.3
- IL_0022: ldfld int32 XYZ.Expr::item
- IL_0027: ceq
- IL_0029: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002a: ldc.i4.0
- IL_002b: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldarg.1
- IL_002d: ldnull
- IL_002e: cgt.un
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(class XYZ.Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 43 (0x2b)
- .maxstack 4
- .locals init ([0] class XYZ.Expr V_0,
- [1] class XYZ.Expr V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0023
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0021
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: ldfld int32 XYZ.Expr::item
- IL_0018: ldloc.1
- IL_0019: ldfld int32 XYZ.Expr::item
- IL_001e: ceq
- IL_0020: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0021: ldc.i4.0
- IL_0022: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0023: ldarg.1
- IL_0024: ldnull
- IL_0025: cgt.un
- IL_0027: ldc.i4.0
- IL_0028: ceq
- IL_002a: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class XYZ.Expr V_0)
- .line 7,7 : 10,14 ''
- IL_0000: ldarg.1
- IL_0001: isinst XYZ.Expr
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.Expr::Equals(class XYZ.Expr)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method Expr::Equals
-
- .property instance int32 Tag()
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.Expr::get_Tag()
- } // end of property Expr::Tag
- .property instance int32 Item()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .get instance int32 XYZ.Expr::get_Item()
- } // end of property Expr::Item
-} // end of class XYZ.Expr
-
-.class public auto ansi serializable beforefieldinit XYZ.MyExn
- extends [mscorlib]System.Exception
- implements [mscorlib]System.Collections.IStructuralEquatable
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
- .field assembly int32 Data0@
- .method public specialname rtspecialname
- instance void .ctor(int32 data0) cil managed
- {
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.MyExn::Data0@
- IL_000d: ret
- } // end of method MyExn::.ctor
-
- .method public specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ret
- } // end of method MyExn::.ctor
-
- .method family specialname rtspecialname
- instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed
- {
- // Code size 9 (0x9)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: ldarg.2
- IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
- IL_0008: ret
- } // end of method MyExn::.ctor
-
- .method public hidebysig specialname instance int32
- get_Data0() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.MyExn::Data0@
- IL_0006: ret
- } // end of method MyExn::get_Data0
-
- .method public hidebysig virtual instance int32
- GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 40 (0x28)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Collections.IEqualityComparer V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0026
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldc.i4 0x9e3779b9
- IL_000d: ldarg.1
- IL_000e: stloc.1
- IL_000f: ldarg.0
- IL_0010: castclass XYZ.MyExn
- IL_0015: call instance int32 XYZ.MyExn::get_Data0()
- IL_001a: ldloc.0
- IL_001b: ldc.i4.6
- IL_001c: shl
- IL_001d: ldloc.0
- IL_001e: ldc.i4.2
- IL_001f: shr
- IL_0020: add
- IL_0021: add
- IL_0022: add
- IL_0023: stloc.0
- IL_0024: ldloc.0
- IL_0025: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0026: ldc.i4.0
- IL_0027: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance int32
- GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 8,8 : 15,20 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance bool
- Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 67 (0x43)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_003b
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst [mscorlib]System.Exception
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_0039
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0018: brtrue.s IL_001c
-
- IL_001a: br.s IL_0037
-
- .line 100001,100001 : 0,0 ''
- IL_001c: ldarg.2
- IL_001d: stloc.2
- IL_001e: ldarg.0
- IL_001f: castclass XYZ.MyExn
- IL_0024: call instance int32 XYZ.MyExn::get_Data0()
- IL_0029: ldloc.1
- IL_002a: castclass XYZ.MyExn
- IL_002f: call instance int32 XYZ.MyExn::get_Data0()
- IL_0034: ceq
- IL_0036: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0037: ldc.i4.0
- IL_0038: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0039: ldc.i4.0
- IL_003a: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003b: ldarg.1
- IL_003c: ldnull
- IL_003d: cgt.un
- IL_003f: ldc.i4.0
- IL_0040: ceq
- IL_0042: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig instance bool
- Equals(class [mscorlib]System.Exception obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 59 (0x3b)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0033
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0031
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.1
- IL_000d: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0012: brtrue.s IL_0016
-
- IL_0014: br.s IL_002f
-
- .line 100001,100001 : 0,0 ''
- IL_0016: ldarg.0
- IL_0017: castclass XYZ.MyExn
- IL_001c: call instance int32 XYZ.MyExn::get_Data0()
- IL_0021: ldarg.1
- IL_0022: castclass XYZ.MyExn
- IL_0027: call instance int32 XYZ.MyExn::get_Data0()
- IL_002c: ceq
- IL_002e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002f: ldc.i4.0
- IL_0030: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0031: ldc.i4.0
- IL_0032: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0033: ldarg.1
- IL_0034: ldnull
- IL_0035: cgt.un
- IL_0037: ldc.i4.0
- IL_0038: ceq
- IL_003a: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig virtual instance bool
- Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0)
- .line 8,8 : 15,20 ''
- IL_0000: ldarg.1
- IL_0001: isinst [mscorlib]System.Exception
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.MyExn::Equals(class [mscorlib]System.Exception)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method MyExn::Equals
-
- .property instance int32 Data0()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.MyExn::get_Data0()
- } // end of property MyExn::Data0
-} // end of class XYZ.MyExn
-
-.class public auto ansi serializable XYZ.A
- extends [mscorlib]System.Object
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
- .field assembly string x
- .method public specialname rtspecialname
- instance void .ctor(string x) cil managed
- {
- // Code size 16 (0x10)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: pop
- .line 9,9 : 12,13 ''
- IL_0008: ldarg.0
- IL_0009: ldarg.1
- IL_000a: stfld string XYZ.A::x
- .line 9,9 : 10,11 ''
- IL_000f: ret
- } // end of method A::.ctor
-
- .method public hidebysig specialname instance string
- get_X() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- .line 9,9 : 38,39 ''
- IL_0000: ldarg.0
- IL_0001: ldfld string XYZ.A::x
- IL_0006: ret
- } // end of method A::get_X
-
- .property instance string X()
- {
- .get instance string XYZ.A::get_X()
- } // end of property A::X
-} // end of class XYZ.A
-
-.class public abstract auto ansi sealed XYZ.ABC
- extends [mscorlib]System.Object
-{
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
- .class auto autochar serializable sealed nested public beforefieldinit Expr
- extends [mscorlib]System.Object
- implements class [mscorlib]System.IEquatable`1,
- [mscorlib]System.Collections.IStructuralEquatable,
- class [mscorlib]System.IComparable`1,
- [mscorlib]System.IComparable,
- [mscorlib]System.Collections.IStructuralComparable
- {
- .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
- 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
- .field assembly initonly int32 item
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method public static class XYZ.ABC/Expr
- NewNum(int32 item) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: newobj instance void XYZ.ABC/Expr::.ctor(int32)
- IL_0006: ret
- } // end of method Expr::NewNum
-
- .method assembly specialname rtspecialname
- instance void .ctor(int32 item) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.ABC/Expr::item
- IL_000d: ret
- } // end of method Expr::.ctor
-
- .method public hidebysig instance int32
- get_Item() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.ABC/Expr::item
- IL_0006: ret
- } // end of method Expr::get_Item
-
- .method public hidebysig instance int32
- get_Tag() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: pop
- IL_0002: ldc.i4.0
- IL_0003: ret
- } // end of method Expr::get_Tag
-
- .method assembly hidebysig specialname
- instance object __DebugDisplay() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+0.8A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::__DebugDisplay
-
- .method public strict virtual instance string
- ToString() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/Expr>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::ToString
-
- .method public hidebysig virtual final
- instance int32 CompareTo(class XYZ.ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 64 (0x40)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/Expr V_0,
- [1] class XYZ.ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IComparer V_2,
- [3] int32 V_3,
- [4] int32 V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0036
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0034
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
- IL_0017: stloc.2
- IL_0018: ldloc.0
- IL_0019: ldfld int32 XYZ.ABC/Expr::item
- IL_001e: stloc.3
- IL_001f: ldloc.1
- IL_0020: ldfld int32 XYZ.ABC/Expr::item
- IL_0025: stloc.s V_4
- IL_0027: ldloc.3
- IL_0028: ldloc.s V_4
- IL_002a: bge.s IL_002e
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldc.i4.m1
- IL_002d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002e: ldloc.3
- IL_002f: ldloc.s V_4
- IL_0031: cgt
- IL_0033: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0034: ldc.i4.1
- IL_0035: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldarg.1
- IL_0037: ldnull
- IL_0038: cgt.un
- IL_003a: brfalse.s IL_003e
-
- .line 100001,100001 : 0,0 ''
- IL_003c: ldc.i4.m1
- IL_003d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003e: ldc.i4.0
- IL_003f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 13 (0xd)
- .maxstack 8
- .line 13,13 : 14,18 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: unbox.any XYZ.ABC/Expr
- IL_0007: callvirt instance int32 XYZ.ABC/Expr::CompareTo(class XYZ.ABC/Expr)
- IL_000c: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj,
- class [mscorlib]System.Collections.IComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 80 (0x50)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/Expr V_0,
- [1] class XYZ.ABC/Expr V_1,
- [2] class XYZ.ABC/Expr V_2,
- [3] class [mscorlib]System.Collections.IComparer V_3,
- [4] int32 V_4,
- [5] int32 V_5)
- .line 13,13 : 14,18 ''
- IL_0000: ldarg.1
- IL_0001: unbox.any XYZ.ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldarg.0
- IL_0008: ldnull
- IL_0009: cgt.un
- IL_000b: brfalse.s IL_0041
-
- .line 100001,100001 : 0,0 ''
- IL_000d: ldarg.1
- IL_000e: unbox.any XYZ.ABC/Expr
- IL_0013: ldnull
- IL_0014: cgt.un
- IL_0016: brfalse.s IL_003f
-
- .line 100001,100001 : 0,0 ''
- IL_0018: ldarg.0
- IL_0019: pop
- .line 100001,100001 : 0,0 ''
- IL_001a: ldarg.0
- IL_001b: stloc.1
- IL_001c: ldloc.0
- IL_001d: stloc.2
- IL_001e: ldarg.2
- IL_001f: stloc.3
- IL_0020: ldloc.1
- IL_0021: ldfld int32 XYZ.ABC/Expr::item
- IL_0026: stloc.s V_4
- IL_0028: ldloc.2
- IL_0029: ldfld int32 XYZ.ABC/Expr::item
- IL_002e: stloc.s V_5
- IL_0030: ldloc.s V_4
- IL_0032: ldloc.s V_5
- IL_0034: bge.s IL_0038
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldc.i4.m1
- IL_0037: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0038: ldloc.s V_4
- IL_003a: ldloc.s V_5
- IL_003c: cgt
- IL_003e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003f: ldc.i4.1
- IL_0040: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0041: ldarg.1
- IL_0042: unbox.any XYZ.ABC/Expr
- IL_0047: ldnull
- IL_0048: cgt.un
- IL_004a: brfalse.s IL_004e
-
- .line 100001,100001 : 0,0 ''
- IL_004c: ldc.i4.m1
- IL_004d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_004e: ldc.i4.0
- IL_004f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 41 (0x29)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class XYZ.ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0027
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldarg.0
- IL_0009: pop
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: stloc.1
- IL_000c: ldc.i4.0
- IL_000d: stloc.0
- IL_000e: ldc.i4 0x9e3779b9
- IL_0013: ldarg.1
- IL_0014: stloc.2
- IL_0015: ldloc.1
- IL_0016: ldfld int32 XYZ.ABC/Expr::item
- IL_001b: ldloc.0
- IL_001c: ldc.i4.6
- IL_001d: shl
- IL_001e: ldloc.0
- IL_001f: ldc.i4.2
- IL_0020: shr
- IL_0021: add
- IL_0022: add
- IL_0023: add
- IL_0024: stloc.0
- IL_0025: ldloc.0
- IL_0026: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0027: ldc.i4.0
- IL_0028: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance int32 GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 13,13 : 14,18 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance bool Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 52 (0x34)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/Expr V_0,
- [1] class XYZ.ABC/Expr V_1,
- [2] class XYZ.ABC/Expr V_2,
- [3] class XYZ.ABC/Expr V_3,
- [4] class [mscorlib]System.Collections.IEqualityComparer V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_002c
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst XYZ.ABC/Expr
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_002a
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldarg.0
- IL_0013: pop
- .line 100001,100001 : 0,0 ''
- IL_0014: ldarg.0
- IL_0015: stloc.2
- IL_0016: ldloc.1
- IL_0017: stloc.3
- IL_0018: ldarg.2
- IL_0019: stloc.s V_4
- IL_001b: ldloc.2
- IL_001c: ldfld int32 XYZ.ABC/Expr::item
- IL_0021: ldloc.3
- IL_0022: ldfld int32 XYZ.ABC/Expr::item
- IL_0027: ceq
- IL_0029: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002a: ldc.i4.0
- IL_002b: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldarg.1
- IL_002d: ldnull
- IL_002e: cgt.un
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(class XYZ.ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 43 (0x2b)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/Expr V_0,
- [1] class XYZ.ABC/Expr V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0023
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0021
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: ldfld int32 XYZ.ABC/Expr::item
- IL_0018: ldloc.1
- IL_0019: ldfld int32 XYZ.ABC/Expr::item
- IL_001e: ceq
- IL_0020: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0021: ldc.i4.0
- IL_0022: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0023: ldarg.1
- IL_0024: ldnull
- IL_0025: cgt.un
- IL_0027: ldc.i4.0
- IL_0028: ceq
- IL_002a: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/Expr V_0)
- .line 13,13 : 14,18 ''
- IL_0000: ldarg.1
- IL_0001: isinst XYZ.ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.ABC/Expr::Equals(class XYZ.ABC/Expr)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method Expr::Equals
-
- .property instance int32 Tag()
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.ABC/Expr::get_Tag()
- } // end of property Expr::Tag
- .property instance int32 Item()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .get instance int32 XYZ.ABC/Expr::get_Item()
- } // end of property Expr::Item
- } // end of class Expr
-
- .class auto ansi serializable nested public beforefieldinit MyExn
- extends [mscorlib]System.Exception
- implements [mscorlib]System.Collections.IStructuralEquatable
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
- .field assembly int32 Data0@
- .method public specialname rtspecialname
- instance void .ctor(int32 data0) cil managed
- {
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.ABC/MyExn::Data0@
- IL_000d: ret
- } // end of method MyExn::.ctor
-
- .method public specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ret
- } // end of method MyExn::.ctor
-
- .method family specialname rtspecialname
- instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed
- {
- // Code size 9 (0x9)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: ldarg.2
- IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
- IL_0008: ret
- } // end of method MyExn::.ctor
-
- .method public hidebysig specialname
- instance int32 get_Data0() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.ABC/MyExn::Data0@
- IL_0006: ret
- } // end of method MyExn::get_Data0
-
- .method public hidebysig virtual instance int32
- GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 40 (0x28)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Collections.IEqualityComparer V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0026
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldc.i4 0x9e3779b9
- IL_000d: ldarg.1
- IL_000e: stloc.1
- IL_000f: ldarg.0
- IL_0010: castclass XYZ.ABC/MyExn
- IL_0015: call instance int32 XYZ.ABC/MyExn::get_Data0()
- IL_001a: ldloc.0
- IL_001b: ldc.i4.6
- IL_001c: shl
- IL_001d: ldloc.0
- IL_001e: ldc.i4.2
- IL_001f: shr
- IL_0020: add
- IL_0021: add
- IL_0022: add
- IL_0023: stloc.0
- IL_0024: ldloc.0
- IL_0025: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0026: ldc.i4.0
- IL_0027: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance int32
- GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 14,14 : 19,24 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance bool
- Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 67 (0x43)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_003b
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst [mscorlib]System.Exception
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_0039
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0018: brtrue.s IL_001c
-
- IL_001a: br.s IL_0037
-
- .line 100001,100001 : 0,0 ''
- IL_001c: ldarg.2
- IL_001d: stloc.2
- IL_001e: ldarg.0
- IL_001f: castclass XYZ.ABC/MyExn
- IL_0024: call instance int32 XYZ.ABC/MyExn::get_Data0()
- IL_0029: ldloc.1
- IL_002a: castclass XYZ.ABC/MyExn
- IL_002f: call instance int32 XYZ.ABC/MyExn::get_Data0()
- IL_0034: ceq
- IL_0036: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0037: ldc.i4.0
- IL_0038: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0039: ldc.i4.0
- IL_003a: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003b: ldarg.1
- IL_003c: ldnull
- IL_003d: cgt.un
- IL_003f: ldc.i4.0
- IL_0040: ceq
- IL_0042: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig instance bool
- Equals(class [mscorlib]System.Exception obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 59 (0x3b)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0033
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0031
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.1
- IL_000d: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0012: brtrue.s IL_0016
-
- IL_0014: br.s IL_002f
-
- .line 100001,100001 : 0,0 ''
- IL_0016: ldarg.0
- IL_0017: castclass XYZ.ABC/MyExn
- IL_001c: call instance int32 XYZ.ABC/MyExn::get_Data0()
- IL_0021: ldarg.1
- IL_0022: castclass XYZ.ABC/MyExn
- IL_0027: call instance int32 XYZ.ABC/MyExn::get_Data0()
- IL_002c: ceq
- IL_002e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002f: ldc.i4.0
- IL_0030: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0031: ldc.i4.0
- IL_0032: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0033: ldarg.1
- IL_0034: ldnull
- IL_0035: cgt.un
- IL_0037: ldc.i4.0
- IL_0038: ceq
- IL_003a: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig virtual instance bool
- Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0)
- .line 14,14 : 19,24 ''
- IL_0000: ldarg.1
- IL_0001: isinst [mscorlib]System.Exception
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.ABC/MyExn::Equals(class [mscorlib]System.Exception)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method MyExn::Equals
-
- .property instance int32 Data0()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.ABC/MyExn::get_Data0()
- } // end of property MyExn::Data0
- } // end of class MyExn
-
- .class auto ansi serializable nested public A
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
- .field assembly string x
- .method public specialname rtspecialname
- instance void .ctor(string x) cil managed
- {
- // Code size 16 (0x10)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: pop
- .line 15,15 : 16,17 ''
- IL_0008: ldarg.0
- IL_0009: ldarg.1
- IL_000a: stfld string XYZ.ABC/A::x
- .line 15,15 : 14,15 ''
- IL_000f: ret
- } // end of method A::.ctor
-
- .method public hidebysig specialname
- instance string get_X() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- .line 15,15 : 42,43 ''
- IL_0000: ldarg.0
- IL_0001: ldfld string XYZ.ABC/A::x
- IL_0006: ret
- } // end of method A::get_X
-
- .property instance string X()
- {
- .get instance string XYZ.ABC/A::get_X()
- } // end of property A::X
- } // end of class A
-
- .class abstract auto ansi sealed nested public ABC
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 )
- .class auto autochar serializable sealed nested public beforefieldinit Expr
- extends [mscorlib]System.Object
- implements class [mscorlib]System.IEquatable`1,
- [mscorlib]System.Collections.IStructuralEquatable,
- class [mscorlib]System.IComparable`1,
- [mscorlib]System.IComparable,
- [mscorlib]System.Collections.IStructuralComparable
- {
- .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
- 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
- .field assembly initonly int32 item
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method public static class XYZ.ABC/ABC/Expr
- NewNum(int32 item) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: newobj instance void XYZ.ABC/ABC/Expr::.ctor(int32)
- IL_0006: ret
- } // end of method Expr::NewNum
-
- .method assembly specialname rtspecialname
- instance void .ctor(int32 item) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.ABC/ABC/Expr::item
- IL_000d: ret
- } // end of method Expr::.ctor
-
- .method public hidebysig instance int32
- get_Item() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0006: ret
- } // end of method Expr::get_Item
-
- .method public hidebysig instance int32
- get_Tag() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: pop
- IL_0002: ldc.i4.0
- IL_0003: ret
- } // end of method Expr::get_Tag
-
- .method assembly hidebysig specialname
- instance object __DebugDisplay() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+0.8A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::__DebugDisplay
-
- .method public strict virtual instance string
- ToString() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 22 (0x16)
- .maxstack 8
- IL_0000: ldstr "%+A"
- IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class XYZ.ABC/ABC/Expr>::.ctor(string)
- IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
- IL_000f: ldarg.0
- IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
- IL_0015: ret
- } // end of method Expr::ToString
-
- .method public hidebysig virtual final
- instance int32 CompareTo(class XYZ.ABC/ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 64 (0x40)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/ABC/Expr V_0,
- [1] class XYZ.ABC/ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IComparer V_2,
- [3] int32 V_3,
- [4] int32 V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0036
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0034
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: call class [mscorlib]System.Collections.IComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericComparer()
- IL_0017: stloc.2
- IL_0018: ldloc.0
- IL_0019: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_001e: stloc.3
- IL_001f: ldloc.1
- IL_0020: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0025: stloc.s V_4
- IL_0027: ldloc.3
- IL_0028: ldloc.s V_4
- IL_002a: bge.s IL_002e
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldc.i4.m1
- IL_002d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002e: ldloc.3
- IL_002f: ldloc.s V_4
- IL_0031: cgt
- IL_0033: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0034: ldc.i4.1
- IL_0035: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldarg.1
- IL_0037: ldnull
- IL_0038: cgt.un
- IL_003a: brfalse.s IL_003e
-
- .line 100001,100001 : 0,0 ''
- IL_003c: ldc.i4.m1
- IL_003d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003e: ldc.i4.0
- IL_003f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 13 (0xd)
- .maxstack 8
- .line 23,23 : 18,22 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: unbox.any XYZ.ABC/ABC/Expr
- IL_0007: callvirt instance int32 XYZ.ABC/ABC/Expr::CompareTo(class XYZ.ABC/ABC/Expr)
- IL_000c: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 CompareTo(object obj,
- class [mscorlib]System.Collections.IComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 80 (0x50)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/ABC/Expr V_0,
- [1] class XYZ.ABC/ABC/Expr V_1,
- [2] class XYZ.ABC/ABC/Expr V_2,
- [3] class [mscorlib]System.Collections.IComparer V_3,
- [4] int32 V_4,
- [5] int32 V_5)
- .line 23,23 : 18,22 ''
- IL_0000: ldarg.1
- IL_0001: unbox.any XYZ.ABC/ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldarg.0
- IL_0008: ldnull
- IL_0009: cgt.un
- IL_000b: brfalse.s IL_0041
-
- .line 100001,100001 : 0,0 ''
- IL_000d: ldarg.1
- IL_000e: unbox.any XYZ.ABC/ABC/Expr
- IL_0013: ldnull
- IL_0014: cgt.un
- IL_0016: brfalse.s IL_003f
-
- .line 100001,100001 : 0,0 ''
- IL_0018: ldarg.0
- IL_0019: pop
- .line 100001,100001 : 0,0 ''
- IL_001a: ldarg.0
- IL_001b: stloc.1
- IL_001c: ldloc.0
- IL_001d: stloc.2
- IL_001e: ldarg.2
- IL_001f: stloc.3
- IL_0020: ldloc.1
- IL_0021: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0026: stloc.s V_4
- IL_0028: ldloc.2
- IL_0029: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_002e: stloc.s V_5
- IL_0030: ldloc.s V_4
- IL_0032: ldloc.s V_5
- IL_0034: bge.s IL_0038
-
- .line 100001,100001 : 0,0 ''
- IL_0036: ldc.i4.m1
- IL_0037: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0038: ldloc.s V_4
- IL_003a: ldloc.s V_5
- IL_003c: cgt
- IL_003e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003f: ldc.i4.1
- IL_0040: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0041: ldarg.1
- IL_0042: unbox.any XYZ.ABC/ABC/Expr
- IL_0047: ldnull
- IL_0048: cgt.un
- IL_004a: brfalse.s IL_004e
-
- .line 100001,100001 : 0,0 ''
- IL_004c: ldc.i4.m1
- IL_004d: ret
-
- .line 100001,100001 : 0,0 ''
- IL_004e: ldc.i4.0
- IL_004f: ret
- } // end of method Expr::CompareTo
-
- .method public hidebysig virtual final
- instance int32 GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 41 (0x29)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class XYZ.ABC/ABC/Expr V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0027
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldarg.0
- IL_0009: pop
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: stloc.1
- IL_000c: ldc.i4.0
- IL_000d: stloc.0
- IL_000e: ldc.i4 0x9e3779b9
- IL_0013: ldarg.1
- IL_0014: stloc.2
- IL_0015: ldloc.1
- IL_0016: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_001b: ldloc.0
- IL_001c: ldc.i4.6
- IL_001d: shl
- IL_001e: ldloc.0
- IL_001f: ldc.i4.2
- IL_0020: shr
- IL_0021: add
- IL_0022: add
- IL_0023: add
- IL_0024: stloc.0
- IL_0025: ldloc.0
- IL_0026: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0027: ldc.i4.0
- IL_0028: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance int32 GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 23,23 : 18,22 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.ABC/ABC/Expr::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method Expr::GetHashCode
-
- .method public hidebysig virtual final
- instance bool Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 52 (0x34)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/ABC/Expr V_0,
- [1] class XYZ.ABC/ABC/Expr V_1,
- [2] class XYZ.ABC/ABC/Expr V_2,
- [3] class XYZ.ABC/ABC/Expr V_3,
- [4] class [mscorlib]System.Collections.IEqualityComparer V_4)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_002c
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst XYZ.ABC/ABC/Expr
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_002a
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldarg.0
- IL_0013: pop
- .line 100001,100001 : 0,0 ''
- IL_0014: ldarg.0
- IL_0015: stloc.2
- IL_0016: ldloc.1
- IL_0017: stloc.3
- IL_0018: ldarg.2
- IL_0019: stloc.s V_4
- IL_001b: ldloc.2
- IL_001c: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0021: ldloc.3
- IL_0022: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0027: ceq
- IL_0029: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002a: ldc.i4.0
- IL_002b: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002c: ldarg.1
- IL_002d: ldnull
- IL_002e: cgt.un
- IL_0030: ldc.i4.0
- IL_0031: ceq
- IL_0033: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(class XYZ.ABC/ABC/Expr obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 43 (0x2b)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/ABC/Expr V_0,
- [1] class XYZ.ABC/ABC/Expr V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0023
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0021
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.0
- IL_000d: pop
- .line 100001,100001 : 0,0 ''
- IL_000e: ldarg.0
- IL_000f: stloc.0
- IL_0010: ldarg.1
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_0018: ldloc.1
- IL_0019: ldfld int32 XYZ.ABC/ABC/Expr::item
- IL_001e: ceq
- IL_0020: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0021: ldc.i4.0
- IL_0022: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0023: ldarg.1
- IL_0024: ldnull
- IL_0025: cgt.un
- IL_0027: ldc.i4.0
- IL_0028: ceq
- IL_002a: ret
- } // end of method Expr::Equals
-
- .method public hidebysig virtual final
- instance bool Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class XYZ.ABC/ABC/Expr V_0)
- .line 23,23 : 18,22 ''
- IL_0000: ldarg.1
- IL_0001: isinst XYZ.ABC/ABC/Expr
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.ABC/ABC/Expr::Equals(class XYZ.ABC/ABC/Expr)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method Expr::Equals
-
- .property instance int32 Tag()
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.ABC/ABC/Expr::get_Tag()
- } // end of property Expr::Tag
- .property instance int32 Item()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .get instance int32 XYZ.ABC/ABC/Expr::get_Item()
- } // end of property Expr::Item
- } // end of class Expr
-
- .class auto ansi serializable nested public beforefieldinit MyExn
- extends [mscorlib]System.Exception
- implements [mscorlib]System.Collections.IStructuralEquatable
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 05 00 00 00 00 00 )
- .field assembly int32 Data0@
- .method public specialname rtspecialname
- instance void .ctor(int32 data0) cil managed
- {
- // Code size 14 (0xe)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ldarg.0
- IL_0007: ldarg.1
- IL_0008: stfld int32 XYZ.ABC/ABC/MyExn::Data0@
- IL_000d: ret
- } // end of method MyExn::.ctor
-
- .method public specialname rtspecialname
- instance void .ctor() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Exception::.ctor()
- IL_0006: ret
- } // end of method MyExn::.ctor
-
- .method family specialname rtspecialname
- instance void .ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo info,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext context) cil managed
- {
- // Code size 9 (0x9)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: ldarg.2
- IL_0003: call instance void [mscorlib]System.Exception::.ctor(class [mscorlib]System.Runtime.Serialization.SerializationInfo,
- valuetype [mscorlib]System.Runtime.Serialization.StreamingContext)
- IL_0008: ret
- } // end of method MyExn::.ctor
-
- .method public hidebysig specialname
- instance int32 get_Data0() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- IL_0000: ldarg.0
- IL_0001: ldfld int32 XYZ.ABC/ABC/MyExn::Data0@
- IL_0006: ret
- } // end of method MyExn::get_Data0
-
- .method public hidebysig virtual instance int32
- GetHashCode(class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 40 (0x28)
- .maxstack 7
- .locals init ([0] int32 V_0,
- [1] class [mscorlib]System.Collections.IEqualityComparer V_1)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0026
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldc.i4.0
- IL_0007: stloc.0
- IL_0008: ldc.i4 0x9e3779b9
- IL_000d: ldarg.1
- IL_000e: stloc.1
- IL_000f: ldarg.0
- IL_0010: castclass XYZ.ABC/ABC/MyExn
- IL_0015: call instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- IL_001a: ldloc.0
- IL_001b: ldc.i4.6
- IL_001c: shl
- IL_001d: ldloc.0
- IL_001e: ldc.i4.2
- IL_001f: shr
- IL_0020: add
- IL_0021: add
- IL_0022: add
- IL_0023: stloc.0
- IL_0024: ldloc.0
- IL_0025: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0026: ldc.i4.0
- IL_0027: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance int32
- GetHashCode() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 12 (0xc)
- .maxstack 8
- .line 24,24 : 23,28 ''
- IL_0000: ldarg.0
- IL_0001: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer()
- IL_0006: callvirt instance int32 XYZ.ABC/ABC/MyExn::GetHashCode(class [mscorlib]System.Collections.IEqualityComparer)
- IL_000b: ret
- } // end of method MyExn::GetHashCode
-
- .method public hidebysig virtual instance bool
- Equals(object obj,
- class [mscorlib]System.Collections.IEqualityComparer comp) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 67 (0x43)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0,
- [1] class [mscorlib]System.Exception V_1,
- [2] class [mscorlib]System.Collections.IEqualityComparer V_2)
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_003b
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: isinst [mscorlib]System.Exception
- IL_000c: stloc.0
- IL_000d: ldloc.0
- IL_000e: brfalse.s IL_0039
-
- .line 100001,100001 : 0,0 ''
- IL_0010: ldloc.0
- IL_0011: stloc.1
- IL_0012: ldloc.0
- IL_0013: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0018: brtrue.s IL_001c
-
- IL_001a: br.s IL_0037
-
- .line 100001,100001 : 0,0 ''
- IL_001c: ldarg.2
- IL_001d: stloc.2
- IL_001e: ldarg.0
- IL_001f: castclass XYZ.ABC/ABC/MyExn
- IL_0024: call instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- IL_0029: ldloc.1
- IL_002a: castclass XYZ.ABC/ABC/MyExn
- IL_002f: call instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- IL_0034: ceq
- IL_0036: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0037: ldc.i4.0
- IL_0038: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0039: ldc.i4.0
- IL_003a: ret
-
- .line 100001,100001 : 0,0 ''
- IL_003b: ldarg.1
- IL_003c: ldnull
- IL_003d: cgt.un
- IL_003f: ldc.i4.0
- IL_0040: ceq
- IL_0042: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig instance bool
- Equals(class [mscorlib]System.Exception obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 59 (0x3b)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: ldnull
- IL_0002: cgt.un
- IL_0004: brfalse.s IL_0033
-
- .line 100001,100001 : 0,0 ''
- IL_0006: ldarg.1
- IL_0007: ldnull
- IL_0008: cgt.un
- IL_000a: brfalse.s IL_0031
-
- .line 100001,100001 : 0,0 ''
- IL_000c: ldarg.1
- IL_000d: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::TypeTestGeneric(object)
- IL_0012: brtrue.s IL_0016
-
- IL_0014: br.s IL_002f
-
- .line 100001,100001 : 0,0 ''
- IL_0016: ldarg.0
- IL_0017: castclass XYZ.ABC/ABC/MyExn
- IL_001c: call instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- IL_0021: ldarg.1
- IL_0022: castclass XYZ.ABC/ABC/MyExn
- IL_0027: call instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- IL_002c: ceq
- IL_002e: ret
-
- .line 100001,100001 : 0,0 ''
- IL_002f: ldc.i4.0
- IL_0030: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0031: ldc.i4.0
- IL_0032: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0033: ldarg.1
- IL_0034: ldnull
- IL_0035: cgt.un
- IL_0037: ldc.i4.0
- IL_0038: ceq
- IL_003a: ret
- } // end of method MyExn::Equals
-
- .method public hidebysig virtual instance bool
- Equals(object obj) cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 20 (0x14)
- .maxstack 4
- .locals init ([0] class [mscorlib]System.Exception V_0)
- .line 24,24 : 23,28 ''
- IL_0000: ldarg.1
- IL_0001: isinst [mscorlib]System.Exception
- IL_0006: stloc.0
- IL_0007: ldloc.0
- IL_0008: brfalse.s IL_0012
-
- .line 100001,100001 : 0,0 ''
- IL_000a: ldarg.0
- IL_000b: ldloc.0
- IL_000c: callvirt instance bool XYZ.ABC/ABC/MyExn::Equals(class [mscorlib]System.Exception)
- IL_0011: ret
-
- .line 100001,100001 : 0,0 ''
- IL_0012: ldc.i4.0
- IL_0013: ret
- } // end of method MyExn::Equals
-
- .property instance int32 Data0()
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
- int32) = ( 01 00 04 00 00 00 00 00 00 00 00 00 )
- .get instance int32 XYZ.ABC/ABC/MyExn::get_Data0()
- } // end of property MyExn::Data0
- } // end of class MyExn
-
- .class auto ansi serializable nested public A
- extends [mscorlib]System.Object
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 )
- .field assembly string x
- .method public specialname rtspecialname
- instance void .ctor(string x) cil managed
- {
- // Code size 16 (0x10)
- .maxstack 8
- .line 100001,100001 : 0,0 ''
- IL_0000: ldarg.0
- IL_0001: callvirt instance void [mscorlib]System.Object::.ctor()
- IL_0006: ldarg.0
- IL_0007: pop
- .line 25,25 : 20,21 ''
- IL_0008: ldarg.0
- IL_0009: ldarg.1
- IL_000a: stfld string XYZ.ABC/ABC/A::x
- .line 25,25 : 18,19 ''
- IL_000f: ret
- } // end of method A::.ctor
-
- .method public hidebysig specialname
- instance string get_X() cil managed
- {
- // Code size 7 (0x7)
- .maxstack 8
- .line 25,25 : 46,47 ''
- IL_0000: ldarg.0
- IL_0001: ldfld string XYZ.ABC/ABC/A::x
- IL_0006: ret
- } // end of method A::get_X
-
- .property instance string X()
- {
- .get instance string XYZ.ABC/ABC/A::get_X()
- } // end of property A::X
- } // end of class A
-
- .method public static int32 'add'(int32 x,
- int32 y) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- .line 28,28 : 27,32 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: add
- IL_0003: ret
- } // end of method ABC::'add'
-
- .method public specialname static string
- get_greeting() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 6 (0x6)
- .maxstack 8
- IL_0000: ldstr "hello"
- IL_0005: ret
- } // end of method ABC::get_greeting
-
- .property string greeting()
- {
- .get string XYZ.ABC/ABC::get_greeting()
- } // end of property ABC::greeting
- } // end of class ABC
-
- .method public static int32 'add'(int32 x,
- int32 y) cil managed
- {
- .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 )
- // Code size 4 (0x4)
- .maxstack 8
- .line 18,18 : 23,28 ''
- IL_0000: ldarg.0
- IL_0001: ldarg.1
- IL_0002: add
- IL_0003: ret
- } // end of method ABC::'add'
-
- .method public specialname static string
- get_greeting() cil managed
- {
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- // Code size 6 (0x6)
- .maxstack 8
- IL_0000: ldstr "hello"
- IL_0005: ret
- } // end of method ABC::get_greeting
-
- .property string greeting()
- {
- .get string XYZ.ABC::get_greeting()
- } // end of property ABC::greeting
-} // end of class XYZ.ABC
-
-.class private abstract auto ansi sealed ''.$ToplevelNamespace
- extends [mscorlib]System.Object
-{
- .field static assembly int32 init@
- .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
- .method private specialname rtspecialname static
- void .cctor() cil managed
- {
- // Code size 13 (0xd)
- .maxstack 3
- .locals init ([0] string greeting,
- [1] string V_1)
- .line 19,19 : 9,31 ''
- IL_0000: call string XYZ.ABC::get_greeting()
- IL_0005: stloc.0
- .line 29,29 : 13,35 ''
- IL_0006: call string XYZ.ABC/ABC::get_greeting()
- IL_000b: stloc.1
- IL_000c: ret
- } // end of method $ToplevelNamespace::.cctor
-
-} // end of class ''.$ToplevelNamespace
-
-
-// =============================================================
-
-// *********** DISASSEMBLY COMPLETE ***********************
diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl
new file mode 100644
index 00000000000..78d8c5dba0c
--- /dev/null
+++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl
@@ -0,0 +1,2529 @@
+
+// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.81.0
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+
+
+// Metadata version: v4.0.30319
+.assembly extern retargetable mscorlib
+{
+ .publickeytoken = (7C EC 85 D7 BE A7 79 8E ) // |.....y.
+ .ver 2:0:5:0
+}
+.assembly extern FSharp.Core
+{
+ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....:
+ .ver 3:47:41:0
+}
+.assembly ToplevelNamespaceP
+{
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
+ int32,
+ int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )
+
+ // --- The following custom attribute is added automatically, do not uncomment -------
+ // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 00 01 00 00 00 00 )
+
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.mresource public FSharpSignatureData.ToplevelNamespaceP
+{
+ // Offset: 0x00000000 Length: 0x0000185A
+}
+.mresource public FSharpOptimizationData.ToplevelNamespaceP
+{
+ // Offset: 0x00001860 Length: 0x0000055D
+}
+.module ToplevelNamespaceP.dll
+// MVID: {576266E4-88D9-D7FD-A745-0383E4666257}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WINDOWS_CUI
+.corflags 0x00000001 // ILONLY
+// Image base: 0x01450000
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+
+.class public auto autochar sealed beforefieldinit XYZ.Expr
+ extends [mscorlib]System.Object
+ implements class [mscorlib]System.IEquatable`1,
+ [mscorlib]System.Collections.IStructuralEquatable,
+ class [mscorlib]System.IComparable`1,
+ [mscorlib]System.IComparable,
+ [mscorlib]System.Collections.IStructuralComparable
+{
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C // ...{__DebugDispl
+ 61 79 28 29 2C 6E 71 7D 00 00 ) // ay(),nq}..
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 )
+ .field assembly initonly int32 item
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ .method public static class XYZ.Expr NewNum(int32 item) cil managed
+ {
+ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags,
+ int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: newobj instance void XYZ.Expr::.ctor(int32)
+ IL_0006: ret
+ } // end of method Expr::NewNum
+
+ .method assembly specialname rtspecialname
+ instance void .ctor(int32 item) cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 14 (0xe)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ldarg.0
+ IL_0007: ldarg.1
+ IL_0008: stfld int32 XYZ.Expr::item
+ IL_000d: ret
+ } // end of method Expr::.ctor
+
+ .method public hidebysig instance int32
+ get_Item() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: ldfld int32 XYZ.Expr::item
+ IL_0006: ret
+ } // end of method Expr::get_Item
+
+ .method public hidebysig instance int32
+ get_Tag() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 4 (0x4)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: pop
+ IL_0002: ldc.i4.0
+ IL_0003: ret
+ } // end of method Expr::get_Tag
+
+ .method assembly hidebysig specialname
+ instance object __DebugDisplay() cil managed
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%+0.8A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string)
+ IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4)
+ IL_000f: ldarg.0
+ IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0)
+ IL_0015: ret
+ } // end of method Expr::__DebugDisplay
+
+ .method public strict virtual instance string
+ ToString() cil managed
+ {
+ // Code size 22 (0x16)
+ .maxstack 8
+ IL_0000: ldstr "%A"
+ IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5