From 00f025c7eaaffb1e00c6e0c13a2467e4d79ca97f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 8 Jul 2024 09:44:56 -0700 Subject: [PATCH] Defaultrealsig (#17385) Co-authored-by: Petr Co-authored-by: Vlad Zarytovskii --- .../.FSharp.Compiler.Service/9.0.100.md | 4 +- docs/release-notes/.FSharp.Core/9.0.100.md | 3 +- src/Compiler/Driver/CompilerConfig.fs | 2 +- src/FSharp.Build/Fsc.fs | 2 +- .../EmittedIL/DelegateAndFuncOptimizations.fs | 42 +- .../Compiler/CodeGen/EmittedIL/Mutation.fs | 236 +++++----- .../CodeGen/EmittedIL/StaticMember.fs | 337 +++++++++++--- .../CodeGen/EmittedIL/TaskGeneratedCode.fs | 430 +++++++++++------- tests/fsharp/single-test.fs | 2 +- tests/fsharp/tests.fs | 48 +- .../FSharp.Editor.Tests/QuickInfoTests.fs | 6 +- .../Tests.LanguageService.QuickInfo.fs | 2 +- vsintegration/tests/UnitTests/Tests.Build.fs | 70 +-- 13 files changed, 741 insertions(+), 443 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 165f50a443a..bbe39d04166 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -3,7 +3,7 @@ ### Added ### Changed -* Change compiler default setting for compressedMetada ([Issue #17379](/~https://github.com/dotnet/fsharp/issues/17379), [PR #17383](/~https://github.com/dotnet/fsharp/pull/17383)) +* Change compiler default setting realsig+ when building assemblies ([Issue #17384](/~https://github.com/dotnet/fsharp/issues/17384), [PR #17378](/~https://github.com/dotnet/fsharp/pull/17385)) +* Change compiler default setting for compressedMetadata ([Issue #17379](/~https://github.com/dotnet/fsharp/issues/17379), [PR #17383](/~https://github.com/dotnet/fsharp/pull/17383)) ### Breaking Changes - diff --git a/docs/release-notes/.FSharp.Core/9.0.100.md b/docs/release-notes/.FSharp.Core/9.0.100.md index 165f50a443a..7050bf1a666 100644 --- a/docs/release-notes/.FSharp.Core/9.0.100.md +++ b/docs/release-notes/.FSharp.Core/9.0.100.md @@ -3,7 +3,8 @@ ### Added ### Changed -* Change compiler default setting for compressedMetada ([Issue #17379](/~https://github.com/dotnet/fsharp/issues/17379), [PR #17383](/~https://github.com/dotnet/fsharp/pull/17383)) +* Change compiler default setting realsig+ when building assemblies ([Issue #17384](/~https://github.com/dotnet/fsharp/issues/17384), [PR #17378](/~https://github.com/dotnet/fsharp/pull/17385)) +* Change compiler default setting for compressedMetadata ([Issue #17379](/~https://github.com/dotnet/fsharp/issues/17379), [PR #17383](/~https://github.com/dotnet/fsharp/pull/17383)) ### Breaking Changes diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 287a4d8b027..ba16b854298 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -822,7 +822,7 @@ type TcConfigBuilder = DumpGraph = false } dumpSignatureData = false - realsig = false + realsig = true strictIndentation = None } diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 2add29050ec..6682208c0ac 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -56,7 +56,7 @@ type public Fsc() as this = let mutable preferredUILang: string MaybeNull = null let mutable publicSign: bool = false let mutable provideCommandLineArgs: bool = false - let mutable realsig: bool = false + let mutable realsig: bool = true let mutable references: ITaskItem[] = [||] let mutable referencePath: string MaybeNull = null let mutable refOnly: bool = false diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs index 00966cab905..789603bf0d2 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DelegateAndFuncOptimizations.fs @@ -506,24 +506,30 @@ let ApplyComputedDelegate(c: int) = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static int32 ApplyComputedDelegate(int32 c) cil managed -{ - - .maxstack 4 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_0) - IL_0000: ldstr "hello" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) - IL_000a: stloc.0 - IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() - IL_0010: ldloc.0 - IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, - class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0016: pop - IL_0017: ldarg.0 - IL_0018: call int32 ReduceComputedDelegate::f@7(int32) - IL_001d: ldc.i4.3 - IL_001e: add - IL_001f: ret + .method public static int32 ApplyComputedDelegate(int32 c) cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_1) + IL_0000: ldsfld class ReduceComputedDelegate/f@7 ReduceComputedDelegate/f@7::@_instance + IL_0005: stloc.0 + IL_0006: ldstr "hello" + IL_000b: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_0010: stloc.1 + IL_0011: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0016: ldloc.1 + IL_0017: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_001c: pop + IL_001d: ldloc.0 + IL_001e: ldarg.0 + IL_001f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0024: ldc.i4.3 + IL_0025: add + IL_0026: ret + } + } """ ])) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs index 2f7eb6de700..f2b84edbf7b 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/Mutation.fs @@ -56,41 +56,38 @@ x.ToString() """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.TimeSpan get_x() cil managed + .method public specialname static valuetype [runtime]System.TimeSpan get_x() cil managed { - + .maxstack 8 - IL_0000: ldsfld valuetype [mscorlib]System.TimeSpan ''.$Mutation02::x@3 + IL_0000: ldsfld valuetype [runtime]System.TimeSpan Mutation02::x@3 IL_0005: ret - } - """ - """ - .property valuetype [mscorlib]System.TimeSpan - x() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get valuetype [mscorlib]System.TimeSpan Mutation02::get_x() - } + } """ """ -void .cctor() cil managed + .method assembly specialname static void staticInitialization@() cil managed { - - .maxstack 4 - .locals init (valuetype [runtime]System.TimeSpan V_0, - valuetype [runtime]System.TimeSpan V_1) + + .maxstack 3 + .locals init (valuetype [runtime]System.TimeSpan V_0) IL_0000: ldsfld valuetype [runtime]System.TimeSpan [runtime]System.TimeSpan::MinValue - IL_0005: dup - IL_0006: stsfld valuetype [runtime]System.TimeSpan ''.$Mutation02::x@3 - IL_000b: stloc.0 - IL_000c: call valuetype [runtime]System.TimeSpan Mutation02::get_x() - IL_0011: stloc.1 - IL_0012: ldloca.s V_1 - IL_0014: constrained. [runtime]System.TimeSpan - IL_001a: callvirt instance string [runtime]System.Object::ToString() - IL_001f: pop - IL_0020: ret - } + IL_0005: stsfld valuetype [runtime]System.TimeSpan Mutation02::x@3 + IL_000a: call valuetype [runtime]System.TimeSpan Mutation02::get_x() + IL_000f: stloc.0 + IL_0010: ldloca.s V_0 + IL_0012: constrained. [runtime]System.TimeSpan + IL_0018: callvirt instance string [runtime]System.Object::ToString() + IL_001d: pop + IL_001e: ret + } + """ + """ + .property valuetype [runtime]System.TimeSpan + x() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get valuetype [runtime]System.TimeSpan Mutation02::get_x() + } """ ])) @@ -105,40 +102,37 @@ x.Day """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.DateTime get_x() cil managed + .method public specialname static valuetype [runtime]System.DateTime get_x() cil managed { - + .maxstack 8 - IL_0000: ldsfld valuetype [mscorlib]System.DateTime ''.$Mutation03::x@3 + IL_0000: ldsfld valuetype [runtime]System.DateTime Mutation03::x@3 IL_0005: ret - } + } """ """ - .property valuetype [mscorlib]System.DateTime + .property valuetype [runtime]System.DateTime x() { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get valuetype [mscorlib]System.DateTime Mutation03::get_x() - } + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get valuetype [runtime]System.DateTime Mutation03::get_x() + } """ """ - void .cctor() cil managed + .method assembly specialname static void staticInitialization@() cil managed { - - .maxstack 4 - .locals init (valuetype [runtime]System.DateTime V_0, - valuetype [runtime]System.DateTime V_1) + + .maxstack 3 + .locals init (valuetype [runtime]System.DateTime V_0) IL_0000: call valuetype [runtime]System.DateTime [runtime]System.DateTime::get_Now() - IL_0005: dup - IL_0006: stsfld valuetype [runtime]System.DateTime ''.$Mutation03::x@3 - IL_000b: stloc.0 - IL_000c: call valuetype [runtime]System.DateTime Mutation03::get_x() - IL_0011: stloc.1 - IL_0012: ldloca.s V_1 - IL_0014: call instance int32 [runtime]System.DateTime::get_Day() - IL_0019: pop - IL_001a: ret - } + IL_0005: stsfld valuetype [runtime]System.DateTime Mutation03::x@3 + IL_000a: call valuetype [runtime]System.DateTime Mutation03::get_x() + IL_000f: stloc.0 + IL_0010: ldloca.s V_0 + IL_0012: call instance int32 [runtime]System.DateTime::get_Day() + IL_0017: pop + IL_0018: ret + } """ ])) @@ -153,41 +147,38 @@ x.ToString() """, (fun verifier -> verifier.VerifyIL [ """ - .method public specialname static valuetype [mscorlib]System.Decimal get_x() cil managed + .method public specialname static valuetype [runtime]System.Decimal get_x() cil managed { - + .maxstack 8 - IL_0000: ldsfld valuetype [mscorlib]System.Decimal ''.$Mutation04::x@3 + IL_0000: ldsfld valuetype [runtime]System.Decimal Mutation04::x@3 IL_0005: ret - } + } """ """ - .property valuetype [mscorlib]System.Decimal + .property valuetype [runtime]System.Decimal x() { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) - .get valuetype [mscorlib]System.Decimal Mutation04::get_x() - } + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get valuetype [runtime]System.Decimal Mutation04::get_x() + } """ """ -void .cctor() cil managed + .method assembly specialname static void staticInitialization@() cil managed { - - .maxstack 4 - .locals init (valuetype [runtime]System.Decimal V_0, - valuetype [runtime]System.Decimal V_1) + + .maxstack 3 + .locals init (valuetype [runtime]System.Decimal V_0) IL_0000: ldsfld valuetype [runtime]System.Decimal [runtime]System.Decimal::MaxValue - IL_0005: dup - IL_0006: stsfld valuetype [runtime]System.Decimal ''.$Mutation04::x@3 - IL_000b: stloc.0 - IL_000c: call valuetype [runtime]System.Decimal Mutation04::get_x() - IL_0011: stloc.1 - IL_0012: ldloca.s V_1 - IL_0014: constrained. [runtime]System.Decimal - IL_001a: callvirt instance string [runtime]System.Object::ToString() - IL_001f: pop - IL_0020: ret - } + IL_0005: stsfld valuetype [runtime]System.Decimal Mutation04::x@3 + IL_000a: call valuetype [runtime]System.Decimal Mutation04::get_x() + IL_000f: stloc.0 + IL_0010: ldloca.s V_0 + IL_0012: constrained. [runtime]System.Decimal + IL_0018: callvirt instance string [runtime]System.Object::ToString() + IL_001d: pop + IL_001e: ret + } """ ])) @@ -213,17 +204,17 @@ type StaticC() = (fun verifier -> verifier.VerifyIL [ """ .class auto ansi serializable nested public C - extends [mscorlib]System.Object + extends [runtime]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 ) + .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 int32 x - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) .method public specialname rtspecialname instance void .ctor() cil managed { - + .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() + IL_0001: callvirt instance void [runtime]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ldarg.0 @@ -231,58 +222,58 @@ type StaticC() = IL_000a: volatile. IL_000c: stfld int32 Mutation05/C::x IL_0011: ret - } + } .method public hidebysig specialname instance int32 get_X() cil managed { - + .maxstack 8 IL_0000: ldarg.0 IL_0001: volatile. IL_0003: ldfld int32 Mutation05/C::x IL_0008: ret - } + } .method public hidebysig specialname instance void set_X(int32 v) cil managed { - + .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: volatile. IL_0004: stfld int32 Mutation05/C::x IL_0009: ret - } + } .property instance int32 X() { .set instance void Mutation05/C::set_X(int32) .get instance int32 Mutation05/C::get_X() - } - } + } + } """ """ .class auto ansi serializable nested public StaticC - extends [mscorlib]System.Object + extends [runtime]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 ) + .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 static assembly int32 x - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) .field static assembly int32 init@10 .method public specialname rtspecialname instance void .ctor() cil managed { - + .maxstack 8 IL_0000: ldarg.0 - IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() + IL_0001: callvirt instance void [runtime]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: pop IL_0008: ret - } + } .method public specialname static int32 get_X() cil managed { - + .maxstack 8 IL_0000: nop IL_0001: volatile. @@ -299,11 +290,11 @@ type StaticC() = IL_0015: volatile. IL_0017: ldsfld int32 Mutation05/StaticC::x IL_001c: ret - } + } .method public specialname static void set_X(int32 v) cil managed { - + .maxstack 8 IL_0000: nop IL_0001: volatile. @@ -321,33 +312,58 @@ type StaticC() = IL_0016: volatile. IL_0018: stsfld int32 Mutation05/StaticC::x IL_001d: ret - } + } .method private specialname rtspecialname static void .cctor() cil managed { - + .maxstack 8 IL_0000: ldc.i4.0 IL_0001: stsfld int32 ''.$Mutation05::init@ IL_0006: ldsfld int32 ''.$Mutation05::init@ IL_000b: pop IL_000c: ret - } + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.1 + IL_0001: volatile. + IL_0003: stsfld int32 Mutation05/StaticC::x + IL_0008: ldc.i4.1 + IL_0009: volatile. + IL_000b: stsfld int32 Mutation05/StaticC::init@10 + IL_0010: ret + } .property int32 X() { .set void Mutation05/StaticC::set_X(int32) .get int32 Mutation05/StaticC::get_X() - } - } - """ - """ - IL_0000: ldc.i4.1 - IL_0001: volatile. - IL_0003: stsfld int32 Mutation05/StaticC::x - IL_0008: ldc.i4.1 - IL_0009: volatile. - IL_000b: stsfld int32 Mutation05/StaticC::init@10 - IL_0010: ret + } + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$Mutation05::init@ + IL_0006: ldsfld int32 ''.$Mutation05::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call void Mutation05/StaticC::staticInitialization@() + IL_0005: ret + } + +} """ ])) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs index b3fb18b8c2e..07d530dfd27 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/StaticMember.fs @@ -22,21 +22,53 @@ type C = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static class [runtime]System.Action - CreateAction() cil managed +.class public abstract auto ansi sealed StaticMember01 + extends [runtime]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 ansi serializable nested public C + extends [runtime]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 ) + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateAction@8 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void M() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + .method public static class [runtime]System.Action CreateAction() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn void StaticMember01/C/CreateAction@8::Invoke() + IL_0007: newobj instance void [runtime]System.Action::.ctor(object, + native int) + IL_000c: ret + } + + } - .maxstack 8 - IL_0000: ldnull - IL_0001: ldftn void StaticMember01/CreateAction@8::Invoke() - IL_0007: newobj instance void [runtime]System.Action::.ctor(object, - native int) - IL_000c: ret -} - """ - """ -.class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateAction@8 +} + +.class private abstract auto ansi sealed ''.$StaticMember01 extends [runtime]System.Object +{ +} """ ])) @@ -54,21 +86,48 @@ type C = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static class [runtime]System.Action`1 - CreateAction() cil managed +.class public abstract auto ansi sealed StaticMember02 + extends [runtime]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 ansi serializable nested public C + extends [runtime]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 ) + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateAction@8 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void M(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ret + } + + .method public static class [runtime]System.Action`1 CreateAction() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn void StaticMember02/C/CreateAction@8::Invoke(int32) + IL_0007: newobj instance void class [runtime]System.Action`1::.ctor(object, + native int) + IL_000c: ret + } - .maxstack 8 - IL_0000: ldnull - IL_0001: ldftn void StaticMember02/CreateAction@8::Invoke(int32) - IL_0007: newobj instance void class [runtime]System.Action`1::.ctor(object, - native int) - IL_000c: ret -} - """ - """ -.class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateAction@8 - extends [runtime]System.Object + } + +} """ ])) @@ -95,32 +154,94 @@ let main _ = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static int32 main(string[] _arg1) cil managed +.class public abstract auto ansi sealed StaticMember03 + extends [runtime]System.Object { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 4 - .locals init (class StaticMember03/MyClass V_0, - class [runtime]System.Action`1 V_1, - object V_2) - IL_0000: ldc.i4.7 - IL_0001: newobj instance void StaticMember03/MyClass::.ctor(int32) - IL_0006: stloc.0 - IL_0007: ldnull - IL_0008: ldftn void StaticMember03/func@15::Invoke(int32) - IL_000e: newobj instance void class [runtime]System.Action`1::.ctor(object, - native int) - IL_0013: stloc.1 - IL_0014: ldloc.1 - IL_0015: box class [runtime]System.Action`1 - IL_001a: stloc.2 - IL_001b: ldc.i4.0 - IL_001c: ret + .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 ansi serializable nested public C + extends [runtime]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 ) + .method public static void M(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .class auto ansi serializable nested public MyClass + extends [runtime]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 int32 x + .method public specialname rtspecialname instance void .ctor(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: stfld int32 StaticMember03/MyClass::x + IL_000f: ret + } + + .method public hidebysig specialname instance int32 get_X() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 StaticMember03/MyClass::x + IL_0006: ret + } + + .property instance int32 X() + { + .get instance int32 StaticMember03/MyClass::get_X() + } + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname func@15 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static int32 main(string[] _arg1) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (class StaticMember03/MyClass V_0, + class [runtime]System.Action`1 V_1, + object V_2) + IL_0000: ldc.i4.7 + IL_0001: newobj instance void StaticMember03/MyClass::.ctor(int32) + IL_0006: stloc.0 + IL_0007: ldnull + IL_0008: ldftn void StaticMember03/func@15::Invoke(int32) + IL_000e: newobj instance void class [runtime]System.Action`1::.ctor(object, + native int) + IL_0013: stloc.1 + IL_0014: ldloc.1 + IL_0015: box class [runtime]System.Action`1 + IL_001a: stloc.2 + IL_001b: ldc.i4.0 + IL_001c: ret + } + } - """ - """ -.class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname func@15 - extends [runtime]System.Object """ ])) @@ -139,21 +260,54 @@ type C = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static class [runtime]System.Func`2 - CreateFunc() cil managed +.class public abstract auto ansi sealed StaticMember04 + extends [runtime]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 ansi serializable nested public C + extends [runtime]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 ) + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateFunc@9 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static int32 Invoke(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: add + IL_0003: ret + } + + } + + .method public static int32 M(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: add + IL_0003: ret + } + + .method public static class [runtime]System.Func`2 CreateFunc() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn int32 StaticMember04/C/CreateFunc@9::Invoke(int32) + IL_0007: newobj instance void class [runtime]System.Func`2::.ctor(object, + native int) + IL_000c: ret + } + + } - .maxstack 8 - IL_0000: ldnull - IL_0001: ldftn int32 StaticMember04/CreateFunc@9::Invoke(int32) - IL_0007: newobj instance void class [runtime]System.Func`2::.ctor(object, - native int) - IL_000c: ret -} - """ - """ -.class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateFunc@9 - extends [runtime]System.Object +} """ ])) @@ -172,21 +326,54 @@ type C = """, (fun verifier -> verifier.VerifyIL [ """ -.method public static class [runtime]System.Func`2 - CreateFunc() cil managed +.class public abstract auto ansi sealed StaticMember05 + extends [runtime]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 ansi serializable nested public C + extends [runtime]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 ) + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateFunc@9 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static int32 Invoke(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.s 43 + IL_0003: add + IL_0004: ret + } + + } + + .method public static int32 M(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.s 43 + IL_0003: add + IL_0004: ret + } + + .method public static class [runtime]System.Func`2 CreateFunc() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn int32 StaticMember05/C/CreateFunc@9::Invoke(int32) + IL_0007: newobj instance void class [runtime]System.Func`2::.ctor(object, + native int) + IL_000c: ret + } + + } - .maxstack 8 - IL_0000: ldnull - IL_0001: ldftn int32 StaticMember05/CreateFunc@9::Invoke(int32) - IL_0007: newobj instance void class [runtime]System.Func`2::.ctor(object, - native int) - IL_000c: ret -} - """ - """ -.class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname CreateFunc@9 - extends [runtime]System.Object +} """ ])) diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs index 492bb64bfc4..e6e70b9096f 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/TaskGeneratedCode.fs @@ -1096,198 +1096,286 @@ type Generic1InGeneric1<'T>() = """, (fun verifier -> verifier.VerifyIL [ """ - .method assembly hidebysig instance class [runtime]System.Threading.Tasks.Task`1 - run(class [runtime]System.Threading.Tasks.Task`1 computation) cil managed +.class public abstract auto ansi sealed Test + extends [runtime]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 ansi serializable nested public beforefieldinit Generic1InGeneric1`1 + extends [runtime]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 ) + .class auto autochar sealed nested assembly beforefieldinit specialname clo@7 + extends [runtime]System.ValueType + implements [runtime]System.Runtime.CompilerServices.IAsyncStateMachine, + class [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.IResumableStateMachine`1> + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 Data + .field public int32 ResumptionPoint + .field public class [runtime]System.Threading.Tasks.Task`1 computation + .field public valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 awaiter + .method public strict virtual instance void MoveNext() cil managed + { + .override [runtime]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext + + .maxstack 5 + .locals init (int32 V_0, + class [runtime]System.Exception V_1, + bool V_2, + class [runtime]System.Threading.Tasks.Task`1 V_3, + bool V_4, + bool V_5, + !A V_6, + !A V_7, + valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 V_8, + class [runtime]System.Exception V_9, + class [runtime]System.Exception V_10) + IL_0000: ldarg.0 + IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.1 + IL_0009: sub + IL_000a: switch ( + IL_0015) + IL_0013: br.s IL_0018 + + IL_0015: nop + IL_0016: br.s IL_001b + + IL_0018: nop + IL_0019: ldnull + IL_001a: stloc.1 + .try + { + IL_001b: ldloc.0 + IL_001c: ldc.i4.1 + IL_001d: sub + IL_001e: switch ( + IL_0029) + IL_0027: br.s IL_002c + + IL_0029: nop + IL_002a: br.s IL_0055 + + IL_002c: nop + IL_002d: ldarg.0 + IL_002e: ldfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation + IL_0033: stloc.3 + IL_0034: ldarg.0 + IL_0035: ldloc.3 + IL_0036: callvirt instance valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1 class [netstandard]System.Threading.Tasks.Task`1::GetAwaiter() + IL_003b: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_0040: ldc.i4.1 + IL_0041: stloc.s V_4 + IL_0043: ldarg.0 + IL_0044: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_0049: call instance bool valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::get_IsCompleted() + IL_004e: brfalse.s IL_0052 + + IL_0050: br.s IL_006b + + IL_0052: ldc.i4.0 + IL_0053: brfalse.s IL_0059 + + IL_0055: ldc.i4.1 + IL_0056: nop + IL_0057: br.s IL_0062 + + IL_0059: ldarg.0 + IL_005a: ldc.i4.1 + IL_005b: stfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_0060: ldc.i4.0 + IL_0061: nop + IL_0062: stloc.s V_5 + IL_0064: ldloc.s V_5 + IL_0066: stloc.s V_4 + IL_0068: nop + IL_0069: br.s IL_006c + + IL_006b: nop + IL_006c: ldloc.s V_4 + IL_006e: brfalse.s IL_0092 + + IL_0070: ldarg.0 + IL_0071: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_0076: call instance !0 valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::GetResult() + IL_007b: stloc.s V_6 + IL_007d: ldloc.s V_6 + IL_007f: stloc.s V_7 + IL_0081: ldarg.0 + IL_0082: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0087: ldloc.s V_7 + IL_0089: stfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result + IL_008e: ldc.i4.1 + IL_008f: nop + IL_0090: br.s IL_00ab + + IL_0092: ldarg.0 + IL_0093: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0098: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder + IL_009d: ldarg.0 + IL_009e: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_00a3: ldarg.0 + IL_00a4: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::AwaitUnsafeOnCompleted,valuetype Test/Generic1InGeneric1`1/clo@7>(!!0&, + !!1&) + IL_00a9: ldc.i4.0 + IL_00aa: nop + IL_00ab: brfalse.s IL_00c1 + + IL_00ad: ldarg.0 + IL_00ae: ldloca.s V_8 + IL_00b0: initobj valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 + IL_00b6: ldloc.s V_8 + IL_00b8: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/Generic1InGeneric1`1/clo@7::awaiter + IL_00bd: ldc.i4.1 + IL_00be: nop + IL_00bf: br.s IL_00c3 + + IL_00c1: ldc.i4.0 + IL_00c2: nop + IL_00c3: stloc.2 + IL_00c4: ldloc.2 + IL_00c5: brfalse.s IL_00e4 + + IL_00c7: ldarg.0 + IL_00c8: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_00cd: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder + IL_00d2: ldarg.0 + IL_00d3: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_00d8: ldfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result + IL_00dd: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0) + IL_00e2: leave.s IL_00f2 + + IL_00e4: leave.s IL_00f2 + + } + catch [runtime]System.Object + { + IL_00e6: castclass [runtime]System.Exception + IL_00eb: stloc.s V_9 + IL_00ed: ldloc.s V_9 + IL_00ef: stloc.1 + IL_00f0: leave.s IL_00f2 + + } + IL_00f2: ldloc.1 + IL_00f3: stloc.s V_10 + IL_00f5: ldloc.s V_10 + IL_00f7: brtrue.s IL_00fa + + IL_00f9: ret + + IL_00fa: ldarg.0 + IL_00fb: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0100: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder + IL_0105: ldloc.s V_10 + IL_0107: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetException(class [netstandard]System.Exception) + IL_010c: ret + } + + .method public strict virtual instance void SetStateMachine(class [runtime]System.Runtime.CompilerServices.IAsyncStateMachine state) cil managed + { + .override [runtime]System.Runtime.CompilerServices.IAsyncStateMachine::SetStateMachine + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0006: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder + IL_000b: ldarg.1 + IL_000c: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetStateMachine(class [netstandard]System.Runtime.CompilerServices.IAsyncStateMachine) + IL_0011: ret + } + + .method public strict virtual instance int32 get_ResumptionPoint() cil managed + { + .override method instance int32 class [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.IResumableStateMachine`1>::get_ResumptionPoint() + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld int32 valuetype Test/Generic1InGeneric1`1/clo@7::ResumptionPoint + IL_0006: ret + } + + .method public strict virtual instance valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 get_Data() cil managed + { + .override method instance !0 class [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.IResumableStateMachine`1>::get_Data() + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0006: ret + } + + .method public strict virtual instance void set_Data(valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 'value') cil managed + { + .override method instance void class [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.IResumableStateMachine`1>::set_Data(!0) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data + IL_0007: ret + } + + } + + .method public specialname rtspecialname instance void .ctor() cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance void [runtime]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: ret + } + + .method public hidebysig instance class [runtime]System.Threading.Tasks.Task`1 Run() cil managed { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.3 + IL_0002: call class [runtime]System.Threading.Tasks.Task`1 [runtime]System.Threading.Tasks.Task::FromResult(!!0) + IL_0007: callvirt instance class [runtime]System.Threading.Tasks.Task`1 class Test/Generic1InGeneric1`1::run(class [runtime]System.Threading.Tasks.Task`1) + IL_000c: ret + } + + .method assembly hidebysig instance class [runtime]System.Threading.Tasks.Task`1 run(class [runtime]System.Threading.Tasks.Task`1 computation) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 4 - .locals init (valuetype Test/clo@7 V_0, - valuetype Test/clo@7& V_1) + .locals init (valuetype Test/Generic1InGeneric1`1/clo@7 V_0, + valuetype Test/Generic1InGeneric1`1/clo@7& V_1) IL_0000: ldloca.s V_0 - IL_0002: initobj valuetype Test/clo@7 + IL_0002: initobj valuetype Test/Generic1InGeneric1`1/clo@7 IL_0008: ldloca.s V_0 IL_000a: stloc.1 IL_000b: ldloc.1 IL_000c: ldarg.1 - IL_000d: stfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/clo@7::computation + IL_000d: stfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/Generic1InGeneric1`1/clo@7::computation IL_0012: ldloc.1 - IL_0013: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data + IL_0013: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0018: call valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Create() IL_001d: stfld valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_0022: ldloc.1 - IL_0023: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data + IL_0023: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0028: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_002d: ldloc.1 - IL_002e: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Start>(!!0&) + IL_002e: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::Start>(!!0&) IL_0033: ldloc.1 - IL_0034: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data + IL_0034: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/Generic1InGeneric1`1/clo@7::Data IL_0039: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder IL_003e: call instance class [netstandard]System.Threading.Tasks.Task`1 valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::get_Task() IL_0043: ret } - """ - """ - .method public strict virtual instance void - MoveNext() cil managed - { - .override [runtime]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext - - .maxstack 5 - .locals init (int32 V_0, - class [runtime]System.Exception V_1, - bool V_2, - class [runtime]System.Threading.Tasks.Task`1 V_3, - bool V_4, - bool V_5, - !A V_6, - !A V_7, - valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 V_8, - class [runtime]System.Exception V_9, - class [runtime]System.Exception V_10) - IL_0000: ldarg.0 - IL_0001: ldfld int32 valuetype Test/clo@7::ResumptionPoint - IL_0006: stloc.0 - IL_0007: ldloc.0 - IL_0008: ldc.i4.1 - IL_0009: sub - IL_000a: switch ( - IL_0015) - IL_0013: br.s IL_0018 - - IL_0015: nop - IL_0016: br.s IL_001b - - IL_0018: nop - IL_0019: ldnull - IL_001a: stloc.1 - .try - { - IL_001b: ldloc.0 - IL_001c: ldc.i4.1 - IL_001d: sub - IL_001e: switch ( - IL_0029) - IL_0027: br.s IL_002c - IL_0029: nop - IL_002a: br.s IL_0055 - - IL_002c: nop - IL_002d: ldarg.0 - IL_002e: ldfld class [runtime]System.Threading.Tasks.Task`1 valuetype Test/clo@7::computation - IL_0033: stloc.3 - IL_0034: ldarg.0 - IL_0035: ldloc.3 - IL_0036: callvirt instance valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1 class [netstandard]System.Threading.Tasks.Task`1::GetAwaiter() - IL_003b: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/clo@7::awaiter - IL_0040: ldc.i4.1 - IL_0041: stloc.s V_4 - IL_0043: ldarg.0 - IL_0044: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/clo@7::awaiter - IL_0049: call instance bool valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::get_IsCompleted() - IL_004e: brfalse.s IL_0052 - - IL_0050: br.s IL_006b - - IL_0052: ldc.i4.0 - IL_0053: brfalse.s IL_0059 - - IL_0055: ldc.i4.1 - IL_0056: nop - IL_0057: br.s IL_0062 - - IL_0059: ldarg.0 - IL_005a: ldc.i4.1 - IL_005b: stfld int32 valuetype Test/clo@7::ResumptionPoint - IL_0060: ldc.i4.0 - IL_0061: nop - IL_0062: stloc.s V_5 - IL_0064: ldloc.s V_5 - IL_0066: stloc.s V_4 - IL_0068: nop - IL_0069: br.s IL_006c - - IL_006b: nop - IL_006c: ldloc.s V_4 - IL_006e: brfalse.s IL_0092 - - IL_0070: ldarg.0 - IL_0071: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/clo@7::awaiter - IL_0076: call instance !0 valuetype [netstandard]System.Runtime.CompilerServices.TaskAwaiter`1::GetResult() - IL_007b: stloc.s V_6 - IL_007d: ldloc.s V_6 - IL_007f: stloc.s V_7 - IL_0081: ldarg.0 - IL_0082: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data - IL_0087: ldloc.s V_7 - IL_0089: stfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result - IL_008e: ldc.i4.1 - IL_008f: nop - IL_0090: br.s IL_00ab - - IL_0092: ldarg.0 - IL_0093: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data - IL_0098: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder - IL_009d: ldarg.0 - IL_009e: ldflda valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/clo@7::awaiter - IL_00a3: ldarg.0 - IL_00a4: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::AwaitUnsafeOnCompleted,valuetype Test/clo@7>(!!0&, - !!1&) - IL_00a9: ldc.i4.0 - IL_00aa: nop - IL_00ab: brfalse.s IL_00c1 - - IL_00ad: ldarg.0 - IL_00ae: ldloca.s V_8 - IL_00b0: initobj valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 - IL_00b6: ldloc.s V_8 - IL_00b8: stfld valuetype [runtime]System.Runtime.CompilerServices.TaskAwaiter`1 valuetype Test/clo@7::awaiter - IL_00bd: ldc.i4.1 - IL_00be: nop - IL_00bf: br.s IL_00c3 - - IL_00c1: ldc.i4.0 - IL_00c2: nop - IL_00c3: stloc.2 - IL_00c4: ldloc.2 - IL_00c5: brfalse.s IL_00e4 - - IL_00c7: ldarg.0 - IL_00c8: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data - IL_00cd: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder - IL_00d2: ldarg.0 - IL_00d3: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data - IL_00d8: ldfld !0 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::Result - IL_00dd: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetResult(!0) - IL_00e2: leave.s IL_00f2 - - IL_00e4: leave.s IL_00f2 + } - } - catch [runtime]System.Object - { - IL_00e6: castclass [runtime]System.Exception - IL_00eb: stloc.s V_9 - IL_00ed: ldloc.s V_9 - IL_00ef: stloc.1 - IL_00f0: leave.s IL_00f2 - - } - IL_00f2: ldloc.1 - IL_00f3: stloc.s V_10 - IL_00f5: ldloc.s V_10 - IL_00f7: brtrue.s IL_00fa - - IL_00f9: ret - - IL_00fa: ldarg.0 - IL_00fb: ldflda valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1 valuetype Test/clo@7::Data - IL_0100: ldflda valuetype [runtime]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1 valuetype [FSharp.Core]Microsoft.FSharp.Control.TaskStateMachineData`1::MethodBuilder - IL_0105: ldloc.s V_10 - IL_0107: call instance void valuetype [netstandard]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1::SetException(class [netstandard]System.Exception) - IL_010c: ret - } +} """ ])) #endif diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 50eaa7cb370..4bcad9740fe 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -335,7 +335,7 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion = let sources = extraSources |> List.filter (fileExists cfg) fsc cfg "%s --optimize -a -o:test--optimize-lib.dll -g --langversion:preview " cfg.fsc_flags sources - fsc cfg "%s --optimize -r:test--optimize-lib.dll -o:test--optimize-client-of-lib.exe -g --langversion:preview " cfg.fsc_flags sources + fsc cfg "%s --realsig- --optimize -r:test--optimize-lib.dll -o:test--optimize-client-of-lib.exe -g --langversion:preview " cfg.fsc_flags sources peverify cfg "test--optimize-lib.dll" peverify cfg "test--optimize-client-of-lib.exe" diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index c9508e50c1c..30c2e3b40d6 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1423,53 +1423,53 @@ module CoreTests = let topinit () = let cfg = testConfig "core/topinit" - fsc cfg "%s --optimize -o both69514.exe -g" cfg.fsc_flags ["lib69514.fs"; "app69514.fs"] + fsc cfg "%s --realsig- --optimize -o both69514.exe -g" cfg.fsc_flags ["lib69514.fs"; "app69514.fs"] peverify cfg "both69514.exe" - fsc cfg "%s --optimize- -o both69514-noopt.exe -g" cfg.fsc_flags ["lib69514.fs"; "app69514.fs"] + fsc cfg "%s --realsig- --optimize- -o both69514-noopt.exe -g" cfg.fsc_flags ["lib69514.fs"; "app69514.fs"] peverify cfg "both69514-noopt.exe" - fsc cfg "%s --optimize -a -g" cfg.fsc_flags ["lib69514.fs"] + fsc cfg "%s --realsig- --optimize -a -g" cfg.fsc_flags ["lib69514.fs"] peverify cfg "lib69514.dll" - fsc cfg "%s --optimize -r:lib69514.dll -g" cfg.fsc_flags ["app69514.fs"] + fsc cfg "%s --realsig- --optimize -r:lib69514.dll -g" cfg.fsc_flags ["app69514.fs"] peverify cfg "app69514.exe" - fsc cfg "%s --optimize- -o:lib69514-noopt.dll -a -g" cfg.fsc_flags ["lib69514.fs"] + fsc cfg "%s --realsig- --optimize- -o:lib69514-noopt.dll -a -g" cfg.fsc_flags ["lib69514.fs"] peverify cfg "lib69514-noopt.dll" - fsc cfg "%s --optimize- -r:lib69514-noopt.dll -o:app69514-noopt.exe -g" cfg.fsc_flags ["app69514.fs"] + fsc cfg "%s --realsig- --optimize- -r:lib69514-noopt.dll -o:app69514-noopt.exe -g" cfg.fsc_flags ["app69514.fs"] peverify cfg "app69514-noopt.exe" - fsc cfg "%s --optimize- -o:lib69514-noopt-withsig.dll -a -g" cfg.fsc_flags ["lib69514.fsi"; "lib69514.fs"] + fsc cfg "%s --realsig- --optimize- -o:lib69514-noopt-withsig.dll -a -g" cfg.fsc_flags ["lib69514.fsi"; "lib69514.fs"] peverify cfg "lib69514-noopt-withsig.dll" - fsc cfg "%s --optimize- -r:lib69514-noopt-withsig.dll -o:app69514-noopt-withsig.exe -g" cfg.fsc_flags ["app69514.fs"] + fsc cfg "%s --realsig- --optimize- -r:lib69514-noopt-withsig.dll -o:app69514-noopt-withsig.exe -g" cfg.fsc_flags ["app69514.fs"] peverify cfg "app69514-noopt-withsig.exe" - fsc cfg "%s -o:lib69514-withsig.dll -a -g" cfg.fsc_flags ["lib69514.fsi"; "lib69514.fs"] + fsc cfg "%s --realsig- -o:lib69514-withsig.dll -a -g" cfg.fsc_flags ["lib69514.fsi"; "lib69514.fs"] peverify cfg "lib69514-withsig.dll" - fsc cfg "%s -r:lib69514-withsig.dll -o:app69514-withsig.exe -g" cfg.fsc_flags ["app69514.fs"] + fsc cfg "%s -r:lib69514-withsig.dll --realsig- -o:app69514-withsig.exe -g" cfg.fsc_flags ["app69514.fs"] peverify cfg "app69514-withsig.exe" - fsc cfg "%s -o:lib.dll -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] + fsc cfg "%s -o:lib.dll --realsig- -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] peverify cfg "lib.dll" csc cfg """/nologo /r:"%s" /r:lib.dll /out:test.exe """ cfg.FSCOREDLLPATH ["test.cs"] - fsc cfg "%s --optimize -o:lib--optimize.dll -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] + fsc cfg "%s --optimize -o:lib--optimize.dll --realsig- -a --langversion:5.0 --mlcompatibility -g" cfg.fsc_flags ["lib.ml"] peverify cfg "lib--optimize.dll" @@ -1477,53 +1477,53 @@ module CoreTests = let dicases = ["flag_deterministic_init1.fs"; "lib_deterministic_init1.fs"; "flag_deterministic_init2.fs"; "lib_deterministic_init2.fs"; "flag_deterministic_init3.fs"; "lib_deterministic_init3.fs"; "flag_deterministic_init4.fs"; "lib_deterministic_init4.fs"; "flag_deterministic_init5.fs"; "lib_deterministic_init5.fs"; "flag_deterministic_init6.fs"; "lib_deterministic_init6.fs"; "flag_deterministic_init7.fs"; "lib_deterministic_init7.fs"; "flag_deterministic_init8.fs"; "lib_deterministic_init8.fs"; "flag_deterministic_init9.fs"; "lib_deterministic_init9.fs"; "flag_deterministic_init10.fs"; "lib_deterministic_init10.fs"; "flag_deterministic_init11.fs"; "lib_deterministic_init11.fs"; "flag_deterministic_init12.fs"; "lib_deterministic_init12.fs"; "flag_deterministic_init13.fs"; "lib_deterministic_init13.fs"; "flag_deterministic_init14.fs"; "lib_deterministic_init14.fs"; "flag_deterministic_init15.fs"; "lib_deterministic_init15.fs"; "flag_deterministic_init16.fs"; "lib_deterministic_init16.fs"; "flag_deterministic_init17.fs"; "lib_deterministic_init17.fs"; "flag_deterministic_init18.fs"; "lib_deterministic_init18.fs"; "flag_deterministic_init19.fs"; "lib_deterministic_init19.fs"; "flag_deterministic_init20.fs"; "lib_deterministic_init20.fs"; "flag_deterministic_init21.fs"; "lib_deterministic_init21.fs"; "flag_deterministic_init22.fs"; "lib_deterministic_init22.fs"; "flag_deterministic_init23.fs"; "lib_deterministic_init23.fs"; "flag_deterministic_init24.fs"; "lib_deterministic_init24.fs"; "flag_deterministic_init25.fs"; "lib_deterministic_init25.fs"; "flag_deterministic_init26.fs"; "lib_deterministic_init26.fs"; "flag_deterministic_init27.fs"; "lib_deterministic_init27.fs"; "flag_deterministic_init28.fs"; "lib_deterministic_init28.fs"; "flag_deterministic_init29.fs"; "lib_deterministic_init29.fs"; "flag_deterministic_init30.fs"; "lib_deterministic_init30.fs"; "flag_deterministic_init31.fs"; "lib_deterministic_init31.fs"; "flag_deterministic_init32.fs"; "lib_deterministic_init32.fs"; "flag_deterministic_init33.fs"; "lib_deterministic_init33.fs"; "flag_deterministic_init34.fs"; "lib_deterministic_init34.fs"; "flag_deterministic_init35.fs"; "lib_deterministic_init35.fs"; "flag_deterministic_init36.fs"; "lib_deterministic_init36.fs"; "flag_deterministic_init37.fs"; "lib_deterministic_init37.fs"; "flag_deterministic_init38.fs"; "lib_deterministic_init38.fs"; "flag_deterministic_init39.fs"; "lib_deterministic_init39.fs"; "flag_deterministic_init40.fs"; "lib_deterministic_init40.fs"; "flag_deterministic_init41.fs"; "lib_deterministic_init41.fs"; "flag_deterministic_init42.fs"; "lib_deterministic_init42.fs"; "flag_deterministic_init43.fs"; "lib_deterministic_init43.fs"; "flag_deterministic_init44.fs"; "lib_deterministic_init44.fs"; "flag_deterministic_init45.fs"; "lib_deterministic_init45.fs"; "flag_deterministic_init46.fs"; "lib_deterministic_init46.fs"; "flag_deterministic_init47.fs"; "lib_deterministic_init47.fs"; "flag_deterministic_init48.fs"; "lib_deterministic_init48.fs"; "flag_deterministic_init49.fs"; "lib_deterministic_init49.fs"; "flag_deterministic_init50.fs"; "lib_deterministic_init50.fs"; "flag_deterministic_init51.fs"; "lib_deterministic_init51.fs"; "flag_deterministic_init52.fs"; "lib_deterministic_init52.fs"; "flag_deterministic_init53.fs"; "lib_deterministic_init53.fs"; "flag_deterministic_init54.fs"; "lib_deterministic_init54.fs"; "flag_deterministic_init55.fs"; "lib_deterministic_init55.fs"; "flag_deterministic_init56.fs"; "lib_deterministic_init56.fs"; "flag_deterministic_init57.fs"; "lib_deterministic_init57.fs"; "flag_deterministic_init58.fs"; "lib_deterministic_init58.fs"; "flag_deterministic_init59.fs"; "lib_deterministic_init59.fs"; "flag_deterministic_init60.fs"; "lib_deterministic_init60.fs"; "flag_deterministic_init61.fs"; "lib_deterministic_init61.fs"; "flag_deterministic_init62.fs"; "lib_deterministic_init62.fs"; "flag_deterministic_init63.fs"; "lib_deterministic_init63.fs"; "flag_deterministic_init64.fs"; "lib_deterministic_init64.fs"; "flag_deterministic_init65.fs"; "lib_deterministic_init65.fs"; "flag_deterministic_init66.fs"; "lib_deterministic_init66.fs"; "flag_deterministic_init67.fs"; "lib_deterministic_init67.fs"; "flag_deterministic_init68.fs"; "lib_deterministic_init68.fs"; "flag_deterministic_init69.fs"; "lib_deterministic_init69.fs"; "flag_deterministic_init70.fs"; "lib_deterministic_init70.fs"; "flag_deterministic_init71.fs"; "lib_deterministic_init71.fs"; "flag_deterministic_init72.fs"; "lib_deterministic_init72.fs"; "flag_deterministic_init73.fs"; "lib_deterministic_init73.fs"; "flag_deterministic_init74.fs"; "lib_deterministic_init74.fs"; "flag_deterministic_init75.fs"; "lib_deterministic_init75.fs"; "flag_deterministic_init76.fs"; "lib_deterministic_init76.fs"; "flag_deterministic_init77.fs"; "lib_deterministic_init77.fs"; "flag_deterministic_init78.fs"; "lib_deterministic_init78.fs"; "flag_deterministic_init79.fs"; "lib_deterministic_init79.fs"; "flag_deterministic_init80.fs"; "lib_deterministic_init80.fs"; "flag_deterministic_init81.fs"; "lib_deterministic_init81.fs"; "flag_deterministic_init82.fs"; "lib_deterministic_init82.fs"; "flag_deterministic_init83.fs"; "lib_deterministic_init83.fs"; "flag_deterministic_init84.fs"; "lib_deterministic_init84.fs"; "flag_deterministic_init85.fs"; "lib_deterministic_init85.fs"] - fsc cfg "%s --optimize- -o test_deterministic_init.exe" cfg.fsc_flags (dicases @ ["test_deterministic_init.fs"]) + fsc cfg "%s --optimize- -o test_deterministic_init.exe --realsig- " cfg.fsc_flags (dicases @ ["test_deterministic_init.fs"]) peverify cfg "test_deterministic_init.exe" - fsc cfg "%s --optimize -o test_deterministic_init--optimize.exe" cfg.fsc_flags (dicases @ ["test_deterministic_init.fs"]) + fsc cfg "%s --optimize -o test_deterministic_init--optimize.exe --realsig- " cfg.fsc_flags (dicases @ ["test_deterministic_init.fs"]) peverify cfg "test_deterministic_init--optimize.exe" - fsc cfg "%s --optimize- -a -o test_deterministic_init_lib.dll" cfg.fsc_flags dicases + fsc cfg "%s --optimize- -a -o test_deterministic_init_lib.dll --realsig- " cfg.fsc_flags dicases peverify cfg "test_deterministic_init_lib.dll" - fsc cfg "%s --optimize- -r test_deterministic_init_lib.dll -o test_deterministic_init_exe.exe" cfg.fsc_flags ["test_deterministic_init.fs"] + fsc cfg "%s --optimize- -r test_deterministic_init_lib.dll -o test_deterministic_init_exe.exe --realsig- " cfg.fsc_flags ["test_deterministic_init.fs"] peverify cfg "test_deterministic_init_exe.exe" - fsc cfg "%s --optimize -a -o test_deterministic_init_lib--optimize.dll" cfg.fsc_flags dicases + fsc cfg "%s --realsig- --optimize -a -o test_deterministic_init_lib--optimize.dll --realsig- " cfg.fsc_flags dicases peverify cfg "test_deterministic_init_lib--optimize.dll" - fsc cfg "%s --optimize -r test_deterministic_init_lib--optimize.dll -o test_deterministic_init_exe--optimize.exe" cfg.fsc_flags ["test_deterministic_init.fs"] + fsc cfg "%s --realsig- --optimize -r test_deterministic_init_lib--optimize.dll -o test_deterministic_init_exe--optimize.exe --realsig- " cfg.fsc_flags ["test_deterministic_init.fs"] peverify cfg "test_deterministic_init_exe--optimize.exe" let static_init_cases = [ "test0.fs"; "test1.fs"; "test2.fs"; "test3.fs"; "test4.fs"; "test5.fs"; "test6.fs" ] - fsc cfg "%s --optimize- -o test_static_init.exe" cfg.fsc_flags (static_init_cases @ ["static-main.fs"]) + fsc cfg "%s --optimize- -o test_static_init.exe --realsig- " cfg.fsc_flags (static_init_cases @ ["static-main.fs"]) peverify cfg "test_static_init.exe" - fsc cfg "%s --optimize -o test_static_init--optimize.exe" cfg.fsc_flags (static_init_cases @ [ "static-main.fs" ]) + fsc cfg "%s --optimize -o test_static_init--optimize.exe --realsig- " cfg.fsc_flags (static_init_cases @ [ "static-main.fs" ]) peverify cfg "test_static_init--optimize.exe" - fsc cfg "%s --optimize- -a -o test_static_init_lib.dll" cfg.fsc_flags static_init_cases + fsc cfg "%s --optimize- -a -o test_static_init_lib.dll --realsig- " cfg.fsc_flags static_init_cases peverify cfg "test_static_init_lib.dll" - fsc cfg "%s --optimize- -r test_static_init_lib.dll -o test_static_init_exe.exe" cfg.fsc_flags ["static-main.fs"] + fsc cfg "%s --optimize- -r test_static_init_lib.dll -o test_static_init_exe.exe --realsig- " cfg.fsc_flags ["static-main.fs"] peverify cfg "test_static_init_exe.exe" - fsc cfg "%s --optimize -a -o test_static_init_lib--optimize.dll" cfg.fsc_flags static_init_cases + fsc cfg "%s --optimize -a -o test_static_init_lib--optimize.dll --realsig- " cfg.fsc_flags static_init_cases peverify cfg "test_static_init_lib--optimize.dll" - fsc cfg "%s --optimize -r test_static_init_lib--optimize.dll -o test_static_init_exe--optimize.exe" cfg.fsc_flags ["static-main.fs"] + fsc cfg "%s --realsig- --optimize -r test_static_init_lib--optimize.dll --realsig- -o test_static_init_exe--optimize.exe" cfg.fsc_flags ["static-main.fs"] peverify cfg "test_static_init_exe--optimize.exe" diff --git a/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs b/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs index 8b24af5f117..7754c07a002 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/QuickInfoTests.fs @@ -514,10 +514,10 @@ namespace FsTest module Test = type T() = - let fu$$nc x = () + let private fu$$nc x = () """ - let expectedSignature = "val func: x: 'a -> unit" + let expectedSignature = "val private func: x: 'a -> unit" let tooltip = GetQuickInfoTextFromCode code @@ -534,7 +534,7 @@ module Test = static let fu$$nc x = () """ - let expectedSignature = "val func: x: 'a -> unit" + let expectedSignature = "val private func: x: 'a -> unit" let tooltip = GetQuickInfoTextFromCode code diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs index 5f7e70a62a1..931b9b3e5e0 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs @@ -790,7 +790,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") type A() = let fff n = n + 1 """ - this.AssertQuickInfoContainsAtEndOfMarker(code, "let ff", "val fff: n: int -> int") + this.AssertQuickInfoContainsAtEndOfMarker(code, "let ff", "val private fff: n: int -> int") // Regression for 2494 [] diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index 9cfdd3f60d5..bd1b88bcf6e 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -80,7 +80,7 @@ type Build() = AssertEqual ("--codepage:65001" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -97,7 +97,7 @@ type Build() = AssertEqual ("-g" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -114,7 +114,7 @@ type Build() = AssertEqual ("--debug:pdbonly" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -133,7 +133,7 @@ type Build() = "--define:FOO=3" + Environment.NewLine + "--define:BAR=4" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -149,7 +149,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--nowarn:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -166,7 +166,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -182,7 +182,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--warnaserror-:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -199,7 +199,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--versionfile:src/version" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -217,7 +217,7 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--doc:foo.xml" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -234,7 +234,7 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--sig:foo.fsi" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -251,7 +251,7 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -268,7 +268,7 @@ type Build() = AssertEqual ("--noframework" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -284,7 +284,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize-" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -301,7 +301,7 @@ type Build() = // REVIEW we don't put the default, is that desired? AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -317,7 +317,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -336,7 +336,7 @@ type Build() = AssertEqual ("-o:oUt.dll" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -352,7 +352,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -369,7 +369,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--platform:x64" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -386,7 +386,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--platform:x86" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -404,7 +404,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "-r:" + dll + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -422,7 +422,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--lib:c:\\sd\\staging\\tools\\nunit\\,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -440,7 +440,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--lib:c:\\program files,c:\\sd\\staging\\tools\\nunit,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -457,7 +457,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--resource:Foo.resources" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -476,7 +476,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + @@ -495,7 +495,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--target:library" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -512,7 +512,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--target:winexe" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -529,7 +529,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--target:module" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -545,7 +545,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--utf8output" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -561,7 +561,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--win32res:foo.res" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -577,7 +577,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--win32manifest:foo.manifest" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -593,7 +593,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva+" + Environment.NewLine + @@ -608,7 +608,7 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--subsystemversion:6.02" + Environment.NewLine + @@ -664,7 +664,7 @@ type Build() = "--sig:foo.fsi" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--platform:anycpu" + Environment.NewLine + "--resource:MyRes.resources" + Environment.NewLine + @@ -709,7 +709,7 @@ type Build() = "--sig:foo.fsi" "--keyfile:key.txt" "--optimize+" - "--realsig-" + "--realsig+" "--pdb:out.pdb" "--platform:anycpu" "--resource:MyRes.resources" @@ -754,7 +754,7 @@ type Build() = let expected = "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--nowarn:52,109,110,73,85" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine +