@@ -3747,8 +3747,8 @@ and GenClosureTypeDefs cenv (tref:ILTypeRef, ilGenParams, attrs, ilCloFreeVars,
37473747 Properties= emptyILProperties
37483748 Methods= mkILMethods mdefs
37493749 MethodImpls= mkILMethodImpls mimpls
3750- IsSerializable= cenv.g.attrib _ SerializableAttribute.IsSome
3751- IsComInterop= false
3750+ IsSerializable= true
3751+ IsComInterop= false
37523752 IsSpecialName= true
37533753 NestedTypes= emptyILTypeDefs
37543754 Encoding= ILDefaultPInvokeEncoding.Auto
@@ -3803,8 +3803,8 @@ and GenLambdaClosure cenv (cgbuf:CodeGenBuffer) eenv isLocalTypeFunc selfv expr
38033803 Properties= emptyILProperties
38043804 Methods= mkILMethods ilContractMeths
38053805 MethodImpls= emptyILMethodImpls
3806- IsSerializable= cenv.g.attrib _ SerializableAttribute.IsSome
3807- IsComInterop= false
3806+ IsSerializable= true
3807+ IsComInterop= false
38083808 IsSpecialName= true
38093809 NestedTypes= emptyILTypeDefs
38103810 Encoding= ILDefaultPInvokeEncoding.Auto
@@ -6563,9 +6563,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) =
65636563let ilFields = mkILFields ilFieldDefs
65646564
65656565let tdef , tdefDiscards =
6566- let isSerializable = ( TryFindFSharpBoolAttribute cenv.g cenv.g.attrib_ AutoSerializableAttribute tycon.Attribs<> Some( false ))
6567- && cenv.g.attrib_ SerializableAttribute.IsSome
6568-
6566+ let isSerializable = ( TryFindFSharpBoolAttribute cenv.g cenv.g.attrib_ AutoSerializableAttribute tycon.Attribs<> Some( false ))
6567+
65696568match tycon.TypeReprInfowith
65706569| TILObjectRepr_ ->
65716570let td = tycon.ILTyconRawMetadata
@@ -6817,11 +6816,10 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) =
68176816else
68186817[]
68196818
6820-
68216819let serializationRelatedMembers =
6822- // do not emit serialization related members if target framework lacksSerializableAttribute orSerializationInfo
6823- match cenv.g.attrib _ SerializableAttribute , cenv.g. iltyp_ SerializationInfo, cenv.g.iltyp_ StreamingContextwith
6824- | Some_, Some serializationInfoType, Some streamingContextType->
6820+ // do not emit serialization related members if target framework lacksSerializationInfo orStreamingContext
6821+ match cenv.g.iltyp_ SerializationInfo, cenv.g.iltyp_ StreamingContextwith
6822+ | Some serializationInfoType, Some streamingContextType->
68256823let ilCtorDefForSerialziation =
68266824 mkILCtor( ILMemberAccess.Family,
68276825[ mkILParamNamed( " info" , serializationInfoType); mkILParamNamed( " context" , streamingContextType)],
@@ -6880,7 +6878,7 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) =
68806878 emptyILEvents,
68816879 mkILCustomAttrs[ mkCompilationMappingAttr cenv.g( int SourceConstructFlags.Exception)],
68826880 ILTypeInit.BeforeField)
6883- let tdef = { tdefwith IsSerializable= cenv.g.attrib _ SerializableAttribute.IsSome }
6881+ let tdef = { tdefwith IsSerializable= true }
68846882 mgbuf.AddTypeDef( tref, tdef, false , false , None)
68856883
68866884