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 221cb6bde01..26bb8c2e649 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/11.0.100.md @@ -37,7 +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 F# exception serialization now preserves fields (gated behind `--langversion:11`). (Issue [#878](https://github.com/dotnet/fsharp/issues/878), [PR #19342](https://github.com/dotnet/fsharp/pull/19342), [PR #19746](https://github.com/dotnet/fsharp/pull/19746)) * 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)) @@ -60,5 +60,6 @@ ### Changed * Improvements in error and warning messages: new error FS3885 when `let!`/`use!` is the final expression in a computation expression; new warning FS3886 when a list literal contains a single tuple element (likely missing `;` separator); improved wording for FS0003, FS0025, FS0039, FS0072, FS0247, FS0597, FS0670, FS3082, and SRTP operator-not-in-scope hints. ([PR #19398](https://github.com/dotnet/fsharp/pull/19398)) +* Exception field serialization (`GetObjectData` and field-restoring constructor) is now gated behind `langversion:11` (`LanguageFeature.ExceptionFieldSerializationSupport`). With langversion ≤10, exception codegen is unchanged from pre-#19342 behavior. ([PR #19746](https://github.com/dotnet/fsharp/pull/19746)) ### Breaking Changes diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 939e3da324e..49207b9f480 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -12271,11 +12271,10 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = [] let serializationRelatedMembers = - // do not emit serialization related members if target framework lacks SerializationInfo or StreamingContext match g.iltyp_SerializationInfo, g.iltyp_StreamingContext with | Some serializationInfoType, Some streamingContextType -> - let emitSerializationFieldIL emitPerField = + let emitFieldSerializationIL emitPerField = [ for (_, ilFieldName, ilPropType, _) in fieldNamesAndTypes do yield! emitPerField ilFieldName ilPropType @@ -12285,7 +12284,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = ty.IsNominal && ty.Boxity = ILBoxity.AsValue let ilInstrsToRestoreFields = - emitSerializationFieldIL (fun ilFieldName ilPropType -> + emitFieldSerializationIL (fun ilFieldName ilPropType -> [ mkLdarg0 mkLdarg 1us @@ -12318,10 +12317,10 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = 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 emitFieldSerialization = + cenv.g.langVersion.SupportsFeature(LanguageFeature.ExceptionFieldSerializationSupport) + && not g.compilingFSharpCore + && not fieldNamesAndTypes.IsEmpty let ilInstrsForSerialization = [ @@ -12330,7 +12329,10 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = mkLdarg 2us mkNormalCall (mkILCtorMethSpecForTy (g.iltyp_Exception, [ serializationInfoType; streamingContextType ])) ] - @ (if shouldRestoreFields then ilInstrsToRestoreFields else []) + @ (if emitFieldSerialization then + ilInstrsToRestoreFields + else + []) |> nonBranchingInstrsToCode let ilCtorDefForSerialization = @@ -12344,73 +12346,66 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) : ILTypeRef option = ) |> AddNonUserCompilerGeneratedAttribs g - let ilInstrsToSaveFields = - emitSerializationFieldIL (fun ilFieldName ilPropType -> + if not emitFieldSerialization then + [ ilCtorDefForSerialization ] + else + let ilInstrsToSaveFields = + emitFieldSerializationIL (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 = [ - mkLdarg 1us - I_ldstr ilFieldName mkLdarg0 - mkNormalLdfld (mkILFieldSpecInTy (ilThisTy, ilFieldName, ilPropType)) - - if isILValueType ilPropType then - I_box ilPropType - - mkNormalCallvirt ( + mkLdarg 1us + mkLdarg 2us + mkNormalCall ( mkILNonGenericInstanceMethSpecInTy ( - serializationInfoType, - "AddValue", - [ g.ilg.typ_String; g.ilg.typ_Object ], + g.iltyp_Exception, + "GetObjectData", + [ serializationInfoType; streamingContextType ], ILType.Void ) ) - ]) + ] + @ ilInstrsToSaveFields + |> nonBranchingInstrsToCode - let ilInstrsForGetObjectData = - [ - mkLdarg0 - mkLdarg 1us - mkLdarg 2us - mkNormalCall ( - mkILNonGenericInstanceMethSpecInTy ( - g.iltyp_Exception, + let ilGetObjectDataDef = + let securityCriticalAttr = + mkILCustomAttribute (g.attrib_SecurityCriticalAttribute.TypeRef, [], [], []) + + let mdef = + mkILNonGenericVirtualInstanceMethod ( "GetObjectData", - [ serializationInfoType; streamingContextType ], - ILType.Void + ILMemberAccess.Public, + [ + mkILParamNamed ("info", serializationInfoType) + mkILParamNamed ("context", streamingContextType) + ], + mkILReturn ILType.Void, + mkMethodBody (false, [], 8, ilInstrsForGetObjectData, None, eenv.imports) ) - ) - ] - @ 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 - 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 ] | _ -> [] diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 7ca8f0a7f85..f9765bdbd6e 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1818,3 +1818,4 @@ featurePreprocessorElif,"#elif preprocessor directive" 3885,parsLetBangCannotBeLastInCE,"'%s' cannot be the final expression in a computation expression. Finish with 'return', 'return!', or a simple expression." 3886,tcListLiteralWithSingleTupleElement,"This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements?" 3887,ilCustomAttrInvalidArrayElemType,"The type '%s' is not a valid custom attribute argument type. Custom attribute arrays must have elements of primitive types, enums, string, System.Type, or System.Object." +featureExceptionFieldSerializationSupport,"emit GetObjectData and field-restoring deserialization constructor for exception types" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 1bc31837052..c66a039d7df 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -108,6 +108,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | ExceptionFieldSerializationSupport /// LanguageVersion management type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) = @@ -251,6 +252,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) // Put stabilized features here for F# 11.0 previews via .NET SDK preview channels LanguageFeature.WarnWhenFunctionValueUsedAsInterpolatedStringArg, languageVersion110 LanguageFeature.PreprocessorElif, languageVersion110 + LanguageFeature.ExceptionFieldSerializationSupport, languageVersion110 // Difference between languageVersion110 and preview - 11.0 gets turned on automatically by picking a preview .NET 11 SDK // previewVersion is only when "preview" is specified explicitly in project files and users also need a preview SDK @@ -453,6 +455,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.MethodOverloadsCache -> FSComp.SR.featureMethodOverloadsCache () | LanguageFeature.ImplicitDIMCoverage -> FSComp.SR.featureImplicitDIMCoverage () | LanguageFeature.PreprocessorElif -> FSComp.SR.featurePreprocessorElif () + | LanguageFeature.ExceptionFieldSerializationSupport -> FSComp.SR.featureExceptionFieldSerializationSupport () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index fd6182c9d3e..4219ce43e35 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -99,6 +99,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | ExceptionFieldSerializationSupport /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 811bc1b86bb..10fe84e6ab1 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 994f29280bd..17f93260936 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 670163d0f88..ecc7e4a3f27 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index de16952ceec..3e0ab156a68 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 5b52ef2ebb2..424a8e0310b 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 5eef9cc71a4..d588b1908d7 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index ae7ca4394f0..ec0d939e7b2 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 5ed89505503..ae93051caa0 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 30f75e12c8f..0e0c2367513 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 2f606681434..e25503d865e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 4e89b343fe7..a296c02e44c 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 3485c64f09a..aa66fa326f6 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 2c60a0abcf2..d8517bff3ff 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -8982,6 +8982,11 @@ This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements? + + emit GetObjectData and field-restoring deserialization constructor for exception types + emit GetObjectData and field-restoring deserialization constructor for exception types + + \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs index 6370526e9b7..fba3cecf2d7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/CodeGenRegressions/CodeGenRegressions_Exceptions.fs @@ -19,6 +19,7 @@ exception Foo of x:string * y:int let result = FSharp source |> asLibrary + |> withLangVersion "11" |> compile |> shouldSucceed @@ -90,6 +91,7 @@ let main _ = """ FSharp source |> asExe + |> withLangVersion "11" |> ignoreWarnings |> compile |> shouldSucceed @@ -146,6 +148,7 @@ let main _ = """ FSharp source |> asExe + |> withLangVersion "11" |> ignoreWarnings |> compile |> shouldSucceed 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 37a4301ab0d..a3d9c281ff7 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 @@ -63,38 +63,8 @@ IL_0001: ldarg.1 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: 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 + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -170,53 +140,8 @@ IL_0001: ldarg.1 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: 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 + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ret } .method public hidebysig specialname instance string get_M1() cil managed @@ -306,38 +231,8 @@ IL_0001: ldarg.1 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: 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 + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -412,38 +307,8 @@ IL_0001: ldarg.1 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: 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 + valuetype [runtime]System.Runtime.Serialization.StreamingContext) + IL_0008: 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 d2c58c493bd..ae120424bcc 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 @@ -64,37 +64,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -171,52 +141,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance string get_M1() cil managed @@ -307,37 +232,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance string get_Data0() cil managed @@ -413,37 +308,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname virtual instance string get_Message() cil managed 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 c2e13b6eac0..7f7632e16e7 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 @@ -482,38 +482,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1215,38 +1184,7 @@ 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: 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 + IL_0008: 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 8fd29f928dd..9a5a9063329 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 @@ -482,38 +482,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1215,38 +1184,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1578,4 +1516,3 @@ - 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 6144e9f3271..0d7172dfc0a 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 @@ -482,38 +482,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1215,38 +1184,7 @@ 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: 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 + IL_0008: 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 81bdaf3c1d4..4f12c1595c8 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 @@ -482,38 +482,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1215,38 +1184,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1568,4 +1506,3 @@ - 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 dc13fbaaa41..c8ee72c0771 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 @@ -478,38 +478,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1211,38 +1180,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1944,38 +1882,7 @@ 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: 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 + IL_0008: 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 c8255f7cb0e..d840f0f7404 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 @@ -478,38 +478,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1211,38 +1180,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1944,38 +1882,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -2307,4 +2214,3 @@ - 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 58700ab4d6f..407197b1184 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 @@ -478,38 +478,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1211,38 +1180,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1944,38 +1882,7 @@ 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: 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 + IL_0008: 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 400e8fa88c9..ef41cabbfcb 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 @@ -478,38 +478,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1211,38 +1180,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -1944,38 +1882,7 @@ 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: 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 + IL_0008: ret } .method public hidebysig specialname instance int32 get_Data0() cil managed @@ -2297,4 +2204,3 @@ -