diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 0a8a899c1de..084aedad85b 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -6432,7 +6432,47 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = yield { ilMethodDef with Access=reprAccess } | _ -> () - + | TUnionRepr _ when (not <| tycon.HasMember cenv.g "ToString" []) -> + match (eenv.valsInScope.TryFind cenv.g.sprintf_vref.Deref, + eenv.valsInScope.TryFind cenv.g.new_format_vref.Deref) with + | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_))) -> + // The type returned by the 'sprintf' call + let funcTy = EraseClosures.mkILFuncTy cenv.g.ilxPubCloEnv ilThisTy cenv.g.ilg.typ_String + // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat + let newFormatMethSpec = mkILMethSpec(newFormatMethSpec.MethodRef,AsObject, + [// 'T -> string' + funcTy + // rest follow from 'StringFormat' + GenUnitTy cenv eenv m + cenv.g.ilg.typ_String + cenv.g.ilg.typ_String + ilThisTy],[]) + // Instantiate with our own type + let sprintfMethSpec = mkILMethSpec(sprintfMethSpec.MethodRef,AsObject,[],[funcTy]) + // Here's the body of the method. Call printf, then invoke the function it returns + let callInstrs = EraseClosures.mkCallFunc cenv.g.ilxPubCloEnv (fun _ -> 0us) eenv.tyenv.Count Normalcall (Apps_app(ilThisTy, Apps_done cenv.g.ilg.typ_String)) + let ilMethodDef = mkILNonGenericVirtualMethod ("ToString",ILMemberAccess.Public,[], + mkILReturn cenv.g.ilg.typ_String, + mkMethodBody + (true,[],2, + nonBranchingInstrsToCode + ([ // load the hardwired format string + yield I_ldstr "%+A" + // make the printf format object + yield mkNormalNewobj newFormatMethSpec + // call sprintf + yield mkNormalCall sprintfMethSpec + // call the function returned by sprintf + yield mkLdarg0 + if ilThisTy.Boxity = ILBoxity.AsValue then + yield mkNormalLdobj ilThisTy ] @ + callInstrs), + None)) + let mdef = { ilMethodDef with CustomAttrs = mkILCustomAttrs [ cenv.g.CompilerGeneratedAttribute ] } + yield mdef + | None,_ -> () + | _,None -> () + | _ -> () | _ -> () ] let ilMethods = methodDefs @ augmentOverrideMethodDefs @ abstractMethodDefs diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index cc4d04b6c5f..ab5f26311b4 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -7686,10 +7686,22 @@ type Entity with argInfos.Length = 1 && List.lengthsEqAndForall2 (typeEquiv g) (List.map fst (List.head argInfos)) argtys && membInfo.MemberFlags.IsOverrideOrExplicitImpl) + + member tycon.HasMember g nm argtys = + tycon.TypeContents.tcaug_adhoc + |> NameMultiMap.find nm + |> List.exists (fun vref -> + match vref.MemberInfo with + | None -> false + | _ -> let argInfos = ArgInfosOfMember g vref + argInfos.Length = 1 && + List.lengthsEqAndForall2 (typeEquiv g) (List.map fst (List.head argInfos)) argtys) + type EntityRef with member tcref.HasInterface g ty = tcref.Deref.HasInterface g ty member tcref.HasOverride g nm argtys = tcref.Deref.HasOverride g nm argtys + member tcref.HasMember g nm argtys = tcref.Deref.HasMember g nm argtys let mkFastForLoop g (spLet,m,idv:Val,start,dir,finish,body) = let dir = if dir then FSharpForLoopUp else FSharpForLoopDown diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 4ce0aab7a1d..23ff3d331fc 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1400,10 +1400,12 @@ val IsGenericValWithGenericContraints: TcGlobals -> Val -> bool type Entity with member HasInterface : TcGlobals -> TType -> bool member HasOverride : TcGlobals -> string -> TType list -> bool + member HasMember : TcGlobals -> string -> TType list -> bool type EntityRef with member HasInterface : TcGlobals -> TType -> bool member HasOverride : TcGlobals -> string -> TType list -> bool + member HasMember : TcGlobals -> string -> TType list -> bool val (|AttribBitwiseOrExpr|_|) : TcGlobals -> Expr -> (Expr * Expr) option val (|EnumExpr|_|) : TcGlobals -> Expr -> Expr option diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index e1a0ddcbfb1..e2c6a896145 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -5217,8 +5217,8 @@ module Repro_3947 = begin do check "Bug3947.Internal%+A" (sprintf "%+A (%+A)" ITA (ITB 2)) "ITA (ITB 2)" // The follow are not very useful outputs, but adding regression tests to pick up any changes... - do check "Bug3947.Internal%A.ITA" true (let str = sprintf "%A" ITA in str.EndsWith("InternalType+_ITA")) - do check "Bug3947.Internal%A.ITB" true (let str = sprintf "%A" (ITB 2) in str.EndsWith("InternalType+ITB")) + do check "Bug3947.Internal%A.ITA" (sprintf "%A" ITA) "ITA" + do check "Bug3947.Internal%A.ITB" (sprintf "%A" (ITB 2)) "ITB 2" end diff --git a/tests/fsharp/core/members/basics/test.fs b/tests/fsharp/core/members/basics/test.fs index b39f9cf53fd..e550e7a5f57 100644 --- a/tests/fsharp/core/members/basics/test.fs +++ b/tests/fsharp/core/members/basics/test.fs @@ -1104,6 +1104,28 @@ module OverrideIComparableOnUnionTest = begin do testc s4 s2 end +module ToStringOnUnionTest = begin + + type MyUnion = A of string | B + + let a1 = A "FOO" + do test "union-tostring-def" (a1.ToString() = "A \"FOO\"") + do test "union-sprintfO-def" ((sprintf "%O" a1) = "A \"FOO\"") + +end + +module ToStringOnUnionTestOverride = begin + + type MyUnion = A of string | B + with + override x.ToString() = "MyUnion" + + let a1 = A "FOO" + do test "union-tostring-with-override" (a1.ToString() = "MyUnion") + do test "union-sprintfO-with-override" ((sprintf "%O" a1) = "MyUnion") + +end + module OverrideIStructuralComparableOnUnionTest = begin [] diff --git a/tests/fsharp/core/members/basics/test.fsi b/tests/fsharp/core/members/basics/test.fsi index 028858f0a97..7efd5cdd50a 100644 --- a/tests/fsharp/core/members/basics/test.fsi +++ b/tests/fsharp/core/members/basics/test.fsi @@ -129,3 +129,13 @@ module UnionTypeTest: begin end end + +module ToStringOnUnionTest: begin + type MyUnion = A of string | B + +end + +module ToStringOnUnionTestOverride: begin + type MyUnion = A of string | B + +end \ No newline at end of file diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01.il.bsl index 2fa850209f3..3865f86f9b4 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/CCtorDUWithMember01.il.bsl @@ -235,6 +235,20 @@ IL_0015: ret } // end of method C::__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 CCtorDUWithMember01a/C>::.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 C::ToString + .method public hidebysig virtual final instance int32 CompareTo(class CCtorDUWithMember01a/C obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/cctorduwithmember01.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/cctorduwithmember01.il.netfx4.bsl index 4ff8d8dcbde..a72b5323e1d 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/cctorduwithmember01.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/CCtorDUWithMember/cctorduwithmember01.il.netfx4.bsl @@ -238,6 +238,20 @@ IL_0015: ret } // end of method C::__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 CCtorDUWithMember01a/C>::.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 C::ToString + .method public hidebysig virtual final instance int32 CompareTo(class CCtorDUWithMember01a/C obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.bsl index 5473a031767..c1616ec58d2 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.bsl @@ -321,6 +321,20 @@ IL_0015: ret } // end of method U::__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,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 U::ToString + .method public hidebysig virtual final instance int32 CompareTo(class EqualsOnUnions01/U obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.netfx4.bsl index 5473a031767..74753a30c3a 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/EqualsOnUnions01.il.netfx4.bsl @@ -321,6 +321,20 @@ IL_0015: ret } // end of method U::__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 EqualsOnUnions01/U>::.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 U::ToString + .method public hidebysig virtual final instance int32 CompareTo(class EqualsOnUnions01/U obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/GeneralizationOnUnions01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/GeneralizationOnUnions01.il.bsl index 74b156ee342..1e209b1e4ae 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/GeneralizationOnUnions01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/GeneralizationOnUnions01.il.bsl @@ -127,6 +127,20 @@ IL_0015: ret } // end of method Weirdo::__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 GeneralizationOnUnions01/Weirdo>::.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 Weirdo::ToString + .method public hidebysig virtual final instance int32 CompareTo(class GeneralizationOnUnions01/Weirdo obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl index 3c9df2a50c3..6b2ed9ff6db 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModule.il.bsl @@ -133,6 +133,20 @@ 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 { @@ -932,6 +946,20 @@ 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 { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl index 93b55d4bd13..771eaa3d503 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelModuleP.il.bsl @@ -133,6 +133,19 @@ 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 { @@ -918,6 +931,19 @@ 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 { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl index 2c1b74c902a..fafb6671732 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespace.il.bsl @@ -128,6 +128,20 @@ 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 { @@ -927,6 +941,20 @@ 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 { @@ -1725,6 +1753,20 @@ 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 { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl index dc494245d5b..78d8c5dba0c 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SerializableAttribute/ToplevelNamespaceP.il.bsl @@ -128,6 +128,19 @@ 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 XYZ.Expr obj) cil managed { @@ -913,6 +926,19 @@ 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 XYZ.ABC/Expr obj) cil managed { @@ -1697,6 +1723,19 @@ 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 XYZ.ABC/ABC/Expr obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch06.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch06.il.bsl index ce31aada34f..6fd8cea6404 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch06.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch06.il.bsl @@ -184,6 +184,20 @@ IL_0015: ret } // end of method Discr::__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 SteppingMatch06/Discr>::.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 Discr::ToString + .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch07.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch07.il.bsl index 475c7e4339b..63a0b7f4349 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch07.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/SteppingMatch07.il.bsl @@ -184,6 +184,20 @@ IL_0015: ret } // end of method Discr::__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 SteppingMatch07/Discr>::.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 Discr::ToString + .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch06.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch06.il.netfx4.bsl index ad23ecaebb5..b7076922725 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch06.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch06.il.netfx4.bsl @@ -187,6 +187,20 @@ IL_0015: ret } // end of method Discr::__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 SteppingMatch06/Discr>::.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 Discr::ToString + .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch06/Discr obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch07.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch07.il.netfx4.bsl index d6e062dd289..dcfb974f0c9 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch07.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/SteppingMatch/steppingmatch07.il.netfx4.bsl @@ -187,6 +187,20 @@ IL_0015: ret } // end of method Discr::__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 SteppingMatch07/Discr>::.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 Discr::ToString + .method public hidebysig virtual final instance int32 CompareTo(class SteppingMatch07/Discr obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction16.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction16.il.netfx4.bsl index 4891b7a3ac5..eafd4bf6d31 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction16.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction16.il.netfx4.bsl @@ -156,6 +156,20 @@ IL_0015: ret } // end of method U::__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 TestFunction16/U>::.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 U::ToString + .method public hidebysig virtual final instance int32 CompareTo(class TestFunction16/U obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction21.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction21.il.netfx4.bsl index a0971f6f7fc..3b35cc45dca 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction21.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/TestFunction21.il.netfx4.bsl @@ -156,6 +156,20 @@ IL_0015: ret } // end of method U::__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 TestFunction21/U>::.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 U::ToString + .method public hidebysig virtual final instance int32 CompareTo(class TestFunction21/U obj) cil managed { diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/Testfunction16.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/Testfunction16.il.bsl index e61c5699bc7..bb2a8535eac 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/Testfunction16.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/TestFunctions/Testfunction16.il.bsl @@ -153,6 +153,20 @@ IL_0015: ret } // end of method U::__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,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 U::ToString + .method public hidebysig virtual final instance int32 CompareTo(class TestFunction16/U obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare05.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare05.il.netfx4.bsl index 8f0ea608726..5f5b3dfae88 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare05.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare05.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Compare05/CompareMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Compare05/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare07.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare07.il.netfx4.bsl index 05cbe2692ca..d226891c4dd 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare07.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare07.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method GenericKey`1::__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,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(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,string>::Invoke(!0) + IL_0015: ret + } // end of method GenericKey`1::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Compare07/CompareMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare10.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare10.il.netfx4.bsl index d48be040d65..646068e06d3 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare10.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Compare10.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Compare10/CompareMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Compare10/CompareMicroPerfAndCodeGenerationTests/Key obj) cil managed { @@ -708,6 +722,20 @@ IL_0015: ret } // end of method KeyWithInnerKeys::__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 Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys>::.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 KeyWithInnerKeys::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Compare10/CompareMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals04.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals04.il.netfx4.bsl index cb5e36f2913..f6a68304346 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals04.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals04.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Equals04/EqualsMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Equals04/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals06.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals06.il.netfx4.bsl index 3c62a493a20..f6c8abb7f34 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals06.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals06.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method GenericKey`1::__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,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(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,string>::Invoke(!0) + IL_0015: ret + } // end of method GenericKey`1::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Equals06/EqualsMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals09.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals09.il.netfx4.bsl index 2ffd130c8b1..53c31b03d69 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals09.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Equals09.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Equals09/EqualsMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Equals09/EqualsMicroPerfAndCodeGenerationTests/Key obj) cil managed { @@ -708,6 +722,20 @@ IL_0015: ret } // end of method KeyWithInnerKeys::__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 Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys>::.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 KeyWithInnerKeys::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Equals09/EqualsMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash05.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash05.il.netfx4.bsl index 4c3e0ca5a9e..191ff939319 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash05.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash05.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Hash05/HashMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Hash05/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash06.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash06.il.netfx4.bsl index 66521cae353..d7f82b9ceb3 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash06.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash06.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Hash06/HashMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Hash06/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash09.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash09.il.netfx4.bsl index b739df3af08..bf446963d01 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash09.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash09.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method GenericKey`1::__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,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(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,string>::Invoke(!0) + IL_0015: ret + } // end of method GenericKey`1::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Hash09/HashMicroPerfAndCodeGenerationTests/GenericKey`1 obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash12.il.netfx4.bsl b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash12.il.netfx4.bsl index 91efe492e5a..7abded200b2 100644 --- a/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash12.il.netfx4.bsl +++ b/tests/fsharpqa/Source/Optimizations/GenericComparison/Hash12.il.netfx4.bsl @@ -160,6 +160,20 @@ IL_0015: ret } // end of method Key::__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 Hash12/HashMicroPerfAndCodeGenerationTests/Key>::.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 Key::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Hash12/HashMicroPerfAndCodeGenerationTests/Key obj) cil managed { @@ -708,6 +722,20 @@ IL_0015: ret } // end of method KeyWithInnerKeys::__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 Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys>::.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 KeyWithInnerKeys::ToString + .method public hidebysig virtual final instance int32 CompareTo(class Hash12/HashMicroPerfAndCodeGenerationTests/KeyWithInnerKeys obj) cil managed { diff --git a/tests/fsharpqa/Source/Optimizations/Inlining/Match01.il.bsl b/tests/fsharpqa/Source/Optimizations/Inlining/Match01.il.bsl index 523f7efed86..d1aa5679aaa 100644 Binary files a/tests/fsharpqa/Source/Optimizations/Inlining/Match01.il.bsl and b/tests/fsharpqa/Source/Optimizations/Inlining/Match01.il.bsl differ diff --git a/tests/fsharpqa/Source/Optimizations/Inlining/StructUnion01.il.bsl b/tests/fsharpqa/Source/Optimizations/Inlining/StructUnion01.il.bsl index 95df244b59b..83a40582bc8 100644 --- a/tests/fsharpqa/Source/Optimizations/Inlining/StructUnion01.il.bsl +++ b/tests/fsharpqa/Source/Optimizations/Inlining/StructUnion01.il.bsl @@ -152,6 +152,21 @@ IL_001a: ret } // end of method U::__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,valuetype StructUnion01/U>::.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: ldobj StructUnion01/U + IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_001a: ret + } // end of method U::ToString + .method public hidebysig virtual final instance int32 CompareTo(valuetype StructUnion01/U obj) cil managed {