diff --git a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md index 5c87eb88b8..f0ac6bec29 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -37,6 +37,7 @@ * Fix signature generation: backtick escaping for identifiers containing backticks. ([Issue #15389](https://github.com/dotnet/fsharp/issues/15389), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) * Fix signature generation: `private` keyword placement for prefix-style type abbreviations. ([Issue #15560](https://github.com/dotnet/fsharp/issues/15560), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) * Fix signature generation: missing `[]` attribute for types without visible constructors. ([Issue #16531](https://github.com/dotnet/fsharp/issues/16531), [PR #19586](https://github.com/dotnet/fsharp/pull/19586)) +* Fix F# exception serialization now preserves fields. (Issue [#878](https://github.com/dotnet/fsharp/issues/878), [PR #19342](https://github.com/dotnet/fsharp/pull/19342)) * Fix methods being tagged as `Member` instead of `Method` in tooltips. ([Issue #10540](https://github.com/dotnet/fsharp/issues/10540), [PR #19507](https://github.com/dotnet/fsharp/pull/19507)) * Fix Debug-mode compilation when mixing resumable and standard computation expressions. ([Issue #19625](https://github.com/dotnet/fsharp/issues/19625), [PR #19630](https://github.com/dotnet/fsharp/pull/19630)) * IlxGen: fix missing CompilationMapping attribute for generic values ([PR #19643](https://github.com/dotnet/fsharp/pull/19643)) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 4675e8369b..939e3da324 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -12275,6 +12275,54 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = match g.iltyp_SerializationInfo, g.iltyp_StreamingContext with | Some serializationInfoType, Some streamingContextType -> + let emitSerializationFieldIL emitPerField = + [ + for (_, ilFieldName, ilPropType, _) in fieldNamesAndTypes do + yield! emitPerField ilFieldName ilPropType + ] + + let isILValueType (ty: ILType) = + ty.IsNominal && ty.Boxity = ILBoxity.AsValue + + let ilInstrsToRestoreFields = + emitSerializationFieldIL (fun ilFieldName ilPropType -> + [ + mkLdarg0 + mkLdarg 1us + I_ldstr ilFieldName + I_ldtoken(ILToken.ILType ilPropType) + + mkNormalCall ( + mkILNonGenericStaticMethSpecInTy ( + g.ilg.typ_Type, + "GetTypeFromHandle", + [ g.iltyp_RuntimeTypeHandle ], + g.ilg.typ_Type + ) + ) + + mkNormalCallvirt ( + mkILNonGenericInstanceMethSpecInTy ( + serializationInfoType, + "GetValue", + [ g.ilg.typ_String; g.ilg.typ_Type ], + g.ilg.typ_Object + ) + ) + + if isILValueType ilPropType then + I_unbox_any ilPropType + else + I_castclass ilPropType + + mkNormalStfld (mkILFieldSpecInTy (ilThisTy, ilFieldName, ilPropType)) + ]) + + // FSharp.Core is SecurityTransparent and cannot override SecurityCritical + // Exception.GetObjectData, so field restoration would be unbalanced — skip it. + let shouldRestoreFields = + not g.compilingFSharpCore && not fieldNamesAndTypes.IsEmpty + let ilInstrsForSerialization = [ mkLdarg0 @@ -12282,6 +12330,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = mkLdarg 2us mkNormalCall (mkILCtorMethSpecForTy (g.iltyp_Exception, [ serializationInfoType; streamingContextType ])) ] + @ (if shouldRestoreFields then ilInstrsToRestoreFields else []) |> nonBranchingInstrsToCode let ilCtorDefForSerialization = @@ -12293,8 +12342,76 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = ], mkMethodBody (false, [], 8, ilInstrsForSerialization, None, eenv.imports) ) + |> AddNonUserCompilerGeneratedAttribs g - [ ilCtorDefForSerialization ] + let ilInstrsToSaveFields = + emitSerializationFieldIL (fun ilFieldName ilPropType -> + [ + mkLdarg 1us + I_ldstr ilFieldName + mkLdarg0 + mkNormalLdfld (mkILFieldSpecInTy (ilThisTy, ilFieldName, ilPropType)) + + if isILValueType ilPropType then + I_box ilPropType + + mkNormalCallvirt ( + mkILNonGenericInstanceMethSpecInTy ( + serializationInfoType, + "AddValue", + [ g.ilg.typ_String; g.ilg.typ_Object ], + ILType.Void + ) + ) + ]) + + let ilInstrsForGetObjectData = + [ + mkLdarg0 + mkLdarg 1us + mkLdarg 2us + mkNormalCall ( + mkILNonGenericInstanceMethSpecInTy ( + g.iltyp_Exception, + "GetObjectData", + [ serializationInfoType; streamingContextType ], + ILType.Void + ) + ) + ] + @ ilInstrsToSaveFields + |> nonBranchingInstrsToCode + + let ilGetObjectDataDef = + let mdef = + mkILNonGenericVirtualInstanceMethod ( + "GetObjectData", + ILMemberAccess.Public, + [ + mkILParamNamed ("info", serializationInfoType) + mkILParamNamed ("context", streamingContextType) + ], + mkILReturn ILType.Void, + mkMethodBody (false, [], 8, ilInstrsForGetObjectData, None, eenv.imports) + ) + + // SecurityCritical is required for .NET Framework where Exception.GetObjectData is security-critical + let securityCriticalAttr = + mkILCustomAttribute (g.attrib_SecurityCriticalAttribute.TypeRef, [], [], []) + + mdef.With(customAttrs = mkILCustomAttrs [ securityCriticalAttr ]) + |> AddNonUserCompilerGeneratedAttribs g + + // FSharp.Core has [assembly: SecurityTransparent], making all code transparent. + // On .NET Framework, transparent code cannot override SecurityCritical virtual + // methods like Exception.GetObjectData. Without GetObjectData to write the fields, + // the field-restoring deserialization constructor would crash (fields not in + // SerializationInfo). So for FSharp.Core: emit only the base-call ctor (status quo). + // For user exceptions: emit both GetObjectData and the field-restoring ctor. + if g.compilingFSharpCore || fieldNamesAndTypes.IsEmpty then + [ ilCtorDefForSerialization ] + else + [ ilCtorDefForSerialization; ilGetObjectDataDef ] | _ -> [] let ilTypeName = tref.Name diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs new file mode 100644 index 0000000000..6370526e9b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace EmittedIL + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module CodeGenRegressions_Exceptions = + + // https://github.com/dotnet/fsharp/issues/878 + [] + let ``Issue_878_ExceptionSerialization`` () = + let source = """ +module Test + +exception Foo of x:string * y:int +""" + let result = + FSharp source + |> asLibrary + |> compile + |> shouldSucceed + + result + |> verifyIL [ + ".method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed" + ".custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 )" + ".custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )" + ".custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )" + "call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo," + ".method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed" + """callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object)""" + ] + |> ignore + + // https://github.com/dotnet/fsharp/issues/878 + + [] + let ``Issue_878_ExceptionSerialization_Roundtrip`` () = + let source = """ +module Test +open System +open System.Runtime.Serialization + +#nowarn "44" // Serialization types are obsolete but needed for testing ISerializable +#nowarn "67" + +exception Foo of x:string * y:int + +let roundtrip (e: Exception) = + let info = SerializationInfo(e.GetType(), FormatterConverter()) + let ctx = StreamingContext(StreamingContextStates.All) + e.GetObjectData(info, ctx) + let ctor = + e.GetType().GetConstructor( + System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic ||| System.Reflection.BindingFlags.Public, + null, + [| typeof; typeof |], + null) + if ctor = null then failwith "Deserialization constructor not found" + ctor.Invoke([| info :> obj; ctx :> obj |]) :?> Exception + +[] +let main _ = + let original = Foo("value", 42) + // Check GetObjectData actually writes our fields + let info = SerializationInfo(original.GetType(), FormatterConverter()) + let ctx = StreamingContext(StreamingContextStates.All) + original.GetObjectData(info, ctx) + let xVal = info.GetString("x@") + let yVal = info.GetInt32("y@") + if xVal <> "value" then failwithf "GetObjectData: Expected x='value', got '%s'" xVal + if yVal <> 42 then failwithf "GetObjectData: Expected y=42, got %d" yVal + + // Check full roundtrip + let cloned = roundtrip original + // Access fields via internal backing fields using reflection + let xField = cloned.GetType().GetField("x@", System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic) + let yField = cloned.GetType().GetField("y@", System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic) + if xField = null then failwith "Field x@ not found" + if yField = null then failwith "Field y@ not found" + let xCloned = xField.GetValue(cloned) :?> string + let yCloned = yField.GetValue(cloned) :?> int + if xCloned <> "value" then failwithf "Roundtrip: Expected x='value', got '%s'" xCloned + if yCloned <> 42 then failwithf "Roundtrip: Expected y=42, got %d" yCloned + printfn "SUCCESS: Foo(value, 42) roundtripped correctly" + 0 +""" + FSharp source + |> asExe + |> ignoreWarnings + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> ignore + + // Regression test: exception field named "Message" must not collide with Exception.GetObjectData's "Message" key + // See: https://github.com/dotnet/fsharp/pull/19342#issuecomment-4112137398 + [] + let ``Issue_878_ExceptionSerialization_MessageFieldCollision`` () = + let source = """ +module Test +open System +open System.Runtime.Serialization + +#nowarn "44" +#nowarn "67" + +exception Foo of Message:string + +[] +let main _ = + let original = Foo("hello") + let info = SerializationInfo(original.GetType(), FormatterConverter()) + let ctx = StreamingContext(StreamingContextStates.All) + // This must not throw — previously crashed with duplicate key "Message" + original.GetObjectData(info, ctx) + + // Verify the F# field is serialized under its backing field name + let msgVal = info.GetString("Message@") + if msgVal <> "hello" then failwithf "Expected Message@='hello', got '%s'" msgVal + + // Verify base Exception's Message is also present (from base.GetObjectData) + let baseMsg = info.GetString("Message") + printfn "Base Message: %s" baseMsg + printfn "F# field Message@: %s" msgVal + + // Full roundtrip + let ctor = + original.GetType().GetConstructor( + System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic ||| System.Reflection.BindingFlags.Public, + null, + [| typeof; typeof |], + null) + if ctor = null then failwith "Deserialization constructor not found" + let cloned = ctor.Invoke([| info :> obj; ctx :> obj |]) :?> Exception + let field = cloned.GetType().GetField("Message@", System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic) + if field = null then failwith "Field Message@ not found" + let clonedVal = field.GetValue(cloned) :?> string + if clonedVal <> "hello" then failwithf "Roundtrip: Expected 'hello', got '%s'" clonedVal + printfn "SUCCESS: exception Foo of Message:string roundtripped correctly" + 0 +""" + FSharp source + |> asExe + |> ignoreWarnings + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> ignore + + // FSharp.Core has [assembly: SecurityTransparent] which prevents overriding + // SecurityCritical methods like Exception.GetObjectData on .NET Framework. + // Verify that FSharp.Core exceptions (MatchFailureException) still load and work, + // have the deserialization ctor, but do NOT have a GetObjectData override. + [] + let ``Issue_878_FSharpCoreExceptions_NoGetObjectDataOverride`` () = + let source = """ +module Test + +// Force MatchFailureException to be loaded by triggering an incomplete match +let triggerMatch x = + match x with + | 1 -> "one" + +// Verify FSharp.Core exceptions can be created and used without TypeLoadException +let test () = + try + triggerMatch 999 |> ignore + failwith "Expected MatchFailureException" + with + | :? MatchFailureException as e -> + // Verify the exception loaded successfully (no TypeLoadException from GetObjectData) + printfn "MatchFailureException loaded OK: %s" e.Message + + // Check that deserialization ctor exists (it should — base ctor is SecuritySafeCritical) + let ctorParams = [| typeof; typeof |] + let ctor = typeof.GetConstructor( + System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.NonPublic, + null, ctorParams, null) + if ctor = null then failwith "Deserialization ctor missing on MatchFailureException" + printfn "Deserialization ctor present" + + // GetObjectData should NOT be overridden on MatchFailureException + // (FSharp.Core is SecurityTransparent, can't override SecurityCritical base) + let godMethod = typeof.GetMethod("GetObjectData", + System.Reflection.BindingFlags.Instance ||| System.Reflection.BindingFlags.Public, + null, ctorParams, null) + if godMethod <> null && godMethod.DeclaringType = typeof then + failwith "GetObjectData should NOT be overridden on FSharp.Core exceptions" + printfn "GetObjectData correctly not overridden" + 0 + +[] +let main _ = test () +""" + FSharp source + |> asExe + |> ignoreWarnings + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.net472.bsl index f2feb99321..37a4301ab0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.net472.bsl @@ -55,6 +55,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -62,7 +64,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/JustStringE::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/JustStringE::Data0@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -130,6 +162,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -137,7 +171,52 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "M1@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/TwoStrings::M1@ + IL_0028: ldarg.0 + IL_0029: ldarg.1 + IL_002a: ldstr "M2@" + IL_002f: ldtoken [runtime]System.String + IL_0034: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0039: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_003e: castclass [runtime]System.String + IL_0043: stfld string MyLibrary/TwoStrings::M2@ + IL_0048: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "M1@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/TwoStrings::M1@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ldarg.1 + IL_001a: ldstr "M2@" + IL_001f: ldarg.0 + IL_0020: ldfld string MyLibrary/TwoStrings::M2@ + IL_0025: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_002a: ret } .method public hidebysig specialname instance string get_M1() cil managed @@ -219,6 +298,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -226,7 +307,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/NullableStringE::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/NullableStringE::Data0@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -293,6 +404,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -300,7 +413,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Message@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/NullableMessage::Message@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Message@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/NullableMessage::Message@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname virtual instance string get_Message() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.netcore.bsl index 2a8a0c50d2..d2c58c493b 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ExceptionType.fs.il.netcore.bsl @@ -55,6 +55,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -62,7 +64,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/JustStringE::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/JustStringE::Data0@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -130,6 +162,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -137,7 +171,52 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "M1@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/TwoStrings::M1@ + IL_0028: ldarg.0 + IL_0029: ldarg.1 + IL_002a: ldstr "M2@" + IL_002f: ldtoken [runtime]System.String + IL_0034: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0039: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_003e: castclass [runtime]System.String + IL_0043: stfld string MyLibrary/TwoStrings::M2@ + IL_0048: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "M1@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/TwoStrings::M1@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ldarg.1 + IL_001a: ldstr "M2@" + IL_001f: ldarg.0 + IL_0020: ldfld string MyLibrary/TwoStrings::M2@ + IL_0025: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_002a: ret } .method public hidebysig specialname instance string get_M1() cil managed @@ -219,6 +298,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -226,7 +307,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/NullableStringE::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/NullableStringE::Data0@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -293,6 +404,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -300,7 +413,37 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Message@" + IL_000f: ldtoken [runtime]System.String + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: castclass [runtime]System.String + IL_0023: stfld string MyLibrary/NullableMessage::Message@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Message@" + IL_000e: ldarg.0 + IL_000f: ldfld string MyLibrary/NullableMessage::Message@ + IL_0014: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_0019: ret } .method public hidebysig specialname virtual instance string get_Message() cil managed @@ -334,4 +477,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.net472.bsl index bc1e702435..c2e13b6eac 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.net472.bsl @@ -473,6 +473,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -480,7 +482,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1173,6 +1206,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1180,7 +1215,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.netcore.bsl index 9c163b8ec4..8fd29f928d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOff.il.netcore.bsl @@ -473,6 +473,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -480,7 +482,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1173,6 +1206,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1180,7 +1215,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.net472.bsl index c2c806ca39..6144e9f327 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.net472.bsl @@ -473,6 +473,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -480,7 +482,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1173,6 +1206,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1180,7 +1215,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.netcore.bsl index e9375f2d0f..81bdaf3c1d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelModule.fs.RealInternalSignatureOn.il.netcore.bsl @@ -473,6 +473,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -480,7 +482,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1173,6 +1206,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1180,7 +1215,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.net472.bsl index 2124b122fc..dc13fbaaa4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.net472.bsl @@ -469,6 +469,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -476,7 +478,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1169,6 +1202,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1176,7 +1211,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1869,6 +1935,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1876,7 +1944,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.netcore.bsl index 36d2089b28..c8255f7cb0 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOff.il.netcore.bsl @@ -469,6 +469,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -476,7 +478,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1169,6 +1202,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1176,7 +1211,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1869,6 +1935,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1876,7 +1944,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.net472.bsl index f51bf1231f..58700ab4d6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.net472.bsl @@ -469,6 +469,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -476,7 +478,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1169,6 +1202,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1176,7 +1211,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1869,6 +1935,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1876,7 +1944,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.netcore.bsl index d166fc2f2f..400e8fa88c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SerializableAttribute/ToplevelNamespace.fs.RealInternalSignatureOn.il.netcore.bsl @@ -469,6 +469,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -476,7 +478,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1169,6 +1202,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1176,7 +1211,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1869,6 +1935,8 @@ .method family specialname rtspecialname instance void .ctor(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .maxstack 8 IL_0000: ldarg.0 @@ -1876,7 +1944,38 @@ IL_0002: ldarg.2 IL_0003: call instance void [runtime]System.Exception::.ctor(class [runtime]System.Runtime.Serialization.SerializationInfo, valuetype [runtime]System.Runtime.Serialization.StreamingContext) - IL_0008: ret + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: ldstr "Data0@" + IL_000f: ldtoken [runtime]System.Int32 + IL_0014: call class [runtime]System.Type [runtime]System.Type::GetTypeFromHandle(valuetype [runtime]System.RuntimeTypeHandle) + IL_0019: callvirt instance object [runtime]System.Runtime.Serialization.SerializationInfo::GetValue(string, + class [runtime]System.Type) + IL_001e: unbox.any [runtime]System.Int32 + IL_0023: stfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0028: ret + } + + .method public strict virtual instance void GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo info, valuetype [runtime]System.Runtime.Serialization.StreamingContext context) cil managed + { + .custom instance void [runtime]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: call instance void [runtime]System.Exception::GetObjectData(class [runtime]System.Runtime.Serialization.SerializationInfo, + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ldarg.1 + IL_0009: ldstr "Data0@" + IL_000e: ldarg.0 + IL_000f: ldfld int32 XYZ.ABC/ABC/MyExn::Data0@ + IL_0014: box [runtime]System.Int32 + IL_0019: callvirt instance void [runtime]System.Runtime.Serialization.SerializationInfo::AddValue(string, + object) + IL_001e: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index aa5a5cc11f..2eaa4afe20 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -286,6 +286,7 @@ +