From f05822686098c90fd3ea974d5b15c05008d03a26 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 5 Dec 2023 14:19:11 +0100 Subject: [PATCH 01/48] failing test --- .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../Language/NullableCsharpImportTests.fs | 57 +++++++++++++++++++ tests/FSharp.Test.Utilities/Compiler.fs | 3 + 3 files changed, 61 insertions(+) create mode 100644 tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 0be2b6bed00..07357bfc7ec 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -220,6 +220,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs new file mode 100644 index 00000000000..3a7ad7aa9dd --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -0,0 +1,57 @@ +module Language.NullableCSharpImport + +open FSharp.Test +open Xunit +open FSharp.Test.Compiler + +[] +let ``Consumption of nullable C# - no generics, just strings`` () = + let csharpLib = + CSharp """ + #nullable enable + namespace Nullables { + public class NullableClass { + // Fields with nullable type + public static string NullableField; + // Fields with non-nullable type + public static string? NonNullableField; + // Methods which return nullable string + public static string? ReturnsNullableStringNoParams() { return null; } + public static string? ReturnsNullableString1NullableParam(string? _) { return null; } + public static string? ReturnsNullableString1NonNullableParam(string _) { return null; } + public static string? ReturnsNullableString2NullableParams(string? _, string? __) { return null; } + public static string? ReturnsNullableString2NonNullableParams(string _, string __) { return null; } + public static string? ReturnsNullableString1Nullable1NonNullableParam(string? _, string __) { return null; } + + // Methods which return non-nullable string + public static string ReturnsNonNullableStringNoParams() { return ""; } + public static string ReturnsNonNullableString1NullableParam(string? _) { return ""; } + public static string ReturnsNonNullableString1NonNullableParam(string _) { return ""; } + public static string ReturnsNonNullableString2NullableParams(string? _, string? __) { return ""; } + public static string ReturnsNonNullableString2NonNullableParams(string _, string __) { return ""; } + public static string ReturnsNonNullableString1Nullable1NonNullableParam(string? _, string __) { return ""; } + } + }""" |> withName "csNullableLib" + + FSharp """ + module FSNullable + open Nullables + + let nullablestrNoParams : string = NullableClass.ReturnsNullableStringNoParams() + let nonNullableStrNoParams : string | null = NullableClass.ReturnsNonNullableStringNoParams() // Here we don't expect any warning. + let nullablestrNoParamsCorrectlyAnnotated : string | null = NullableClass.ReturnsNullableStringNoParams() + let nonNullableStrNoParamsCorrectlyAnnotated : string = NullableClass.ReturnsNonNullableStringNoParams() + let nullableField : string = NullableClass.NullableField + let nonNullableField : string | null = NullableClass.NonNullableField + """ + |> asLibrary + |> withLangVersionPreview + |> withReferences [csharpLib] + |> withCheckNulls + |> compile + |> shouldFail + |> withDiagnostics [ + // TODO NULLNESS: makes sure that both of these are expected. + Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string __withnull' do not have compatible nullability."; + Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string __withnull' do not have equivalent nullability." + ] diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 55f03a4f9c1..d021fecc953 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -475,6 +475,9 @@ module rec Compiler = | FS fs -> FS { fs with OutputDirectory = path } | _ -> failwith "withOutputDirectory is only supported on F#" + let withCheckNulls (cUnit: CompilationUnit) : CompilationUnit = + withOptionsHelper ["--checknulls+"] "checknulls is only supported in F#" cUnit + let withBufferWidth (width: int)(cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--bufferwidth:{width}" ] "withBufferWidth is only supported on F#" cUnit From c24a7466d8460e3c2dbf9c4a65720f54326cde63 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 5 Dec 2023 14:52:51 +0100 Subject: [PATCH 02/48] todo for IL import --- src/Compiler/Checking/TypeHierarchy.fs | 2 ++ src/Compiler/Checking/import.fs | 7 ++++++- src/Compiler/Checking/infos.fs | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index b4c2e965f25..c6aa275887e 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -375,11 +375,13 @@ let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst ilTy getCat /// Get the parameter type of an IL method. let ImportParameterTypeFromMetadata amap m ilTy getCattrs scoref tinst mist = + // TODO nullness import + fallback + generics ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist ilTy getCattrs /// Get the return type of an IL method, taking into account instantiations for type, return attributes and method generic parameters, and /// translating 'void' to 'None'. let ImportReturnTypeFromMetadata amap m ilTy getCattrs scoref tinst minst = + // TODO nullness import + fallback + generics match ilTy with | ILType.Void -> None | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst retTy getCattrs) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 6621600d7f5..3aec2c4063c 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -490,7 +490,12 @@ let ImportILGenericParameters amap m scoref tinst (gps: ILGenericParameterDefs) let importInst = tinst@tptys (tps, gps) ||> List.iter2 (fun tp gp -> let constraints = - [ if gp.CustomAttrs |> TryFindILAttribute amap.g.attrib_IsUnmanagedAttribute then + [ (* + let nullness = gp.CustomAttrs Nullable |> orElse ('nullable context from parent in metadata hierarchy') + if nullness = 1 -> without null -> TyparConstraint.NotSupportsNull + if nullness = 2 -> with null -> TyparConstraint.SupportsNull + *) + if gp.CustomAttrs |> TryFindILAttribute amap.g.attrib_IsUnmanagedAttribute then TyparConstraint.IsUnmanaged(m) if gp.HasDefaultConstructorConstraint then TyparConstraint.RequiresDefaultConstructor(m) diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index a641ef81709..568d753250b 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -561,11 +561,13 @@ type ILMethInfo = /// Get the argument types of the the IL method. If this is an C#-style extension method /// then drop the object argument. member x.GetParamTypes(amap, m, minst) = + // TODO nullness import + fallback + generics x.ParamMetadata |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst) /// Get all the argument types of the IL method. Include the object argument even if this is /// an C#-style extension method. member x.GetRawArgTypes(amap, m, minst) = + // TODO nullness import + fallback + generics x.RawMetadata.Parameters |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst) /// Get info about the arguments of the IL method. If this is an C#-style extension method then @@ -573,6 +575,7 @@ type ILMethInfo = /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamNamesAndTypes(amap, m, minst) = + // TODO nullness import + fallback + generics let scope = x.MetadataScope let tinst = x.DeclaringTypeInst x.ParamMetadata |> List.map (fun p -> ParamNameAndType(Option.map (mkSynId m) p.Name, ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) scope tinst minst) ) @@ -600,6 +603,7 @@ type ILMethInfo = /// Get the (zero or one) 'self'/'this'/'object' arguments associated with an IL method. /// An instance extension method returns one object argument. member x.GetObjArgTypes(amap, m, minst) = + // TODO nullness import + fallback + generics. ++!!++ a special test for C# defined extension method with nullability on/off on "this" // All C#-style extension methods are instance. We have to re-read the 'obj' type w.r.t. the // method instantiation. if x.IsILExtensionMethod then @@ -612,10 +616,12 @@ type ILMethInfo = /// Get the compiled return type of the method, where 'void' is None. member x.GetCompiledReturnType (amap, m, minst) = + // TODO nullness import + fallback + generics ImportReturnTypeFromMetadata amap m x.RawMetadata.Return.Type (fun _ -> x.RawMetadata.Return.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst /// Get the F# view of the return type of the method, where 'void' is 'unit'. member x.GetFSharpReturnType (amap, m, minst) = + // TODO nullness import + fallback + generics x.GetCompiledReturnType(amap, m, minst) |> GetFSharpViewOfReturnType amap.g @@ -1261,6 +1267,11 @@ type MethInfo = let formalRetTy, formalParams = match x with | ILMeth(_, ilminfo, _) -> + // TODO nullness for return types and parameters, both possibly generic (i.e. recurse into typars as well) + // Order of data sourcing fallbacks: + // Nullable directly on the return/param + // NullableContext on method + // NullableContext on containing type let ftinfo = ILTypeInfo.FromType g (TType_app(tcref, formalEnclosingTyparTys, g.knownWithoutNull)) let formalRetTy = ImportReturnTypeFromMetadata amap m ilminfo.RawMetadata.Return.Type (fun _ -> ilminfo.RawMetadata.Return.CustomAttrs) ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys let formalParams = @@ -1464,6 +1475,7 @@ type ILFieldInfo = /// Get the type of the field as an F# type member x.FieldType(amap, m) = match x with + // TODO nullness import + fallback + generics | ILFieldInfo (tinfo, fdef) -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] fdef.FieldType #if !NO_TYPEPROVIDERS | ProvidedField(amap, fi, m) -> ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType), m)) @@ -1637,6 +1649,7 @@ type ILPropInfo = /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamNamesAndTypes(amap, m) = + // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x pdef.Args |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) ) @@ -1644,6 +1657,7 @@ type ILPropInfo = /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamTypes(amap, m) = + // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x pdef.Args |> List.map (fun ty -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) @@ -1651,6 +1665,7 @@ type ILPropInfo = /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetPropertyType (amap, m) = + // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] pdef.PropertyType @@ -1931,6 +1946,7 @@ type PropInfo = /// Get the result type of the property member x.GetPropertyType (amap, m) = match x with + // TODO nullness import + fallback + generics | ILProp ilpinfo -> ilpinfo.GetPropertyType (amap, m) | FSProp (g, _, Some vref, _) | FSProp (g, _, _, Some vref) -> @@ -1949,6 +1965,7 @@ type PropInfo = /// If the property is in a generic type, then the type parameters are instantiated in the types returned. member x.GetParamNamesAndTypes(amap, m) = match x with + // TODO nullness import + fallback + generics | ILProp ilpinfo -> ilpinfo.GetParamNamesAndTypes(amap, m) | FSProp (g, ty, Some vref, _) | FSProp (g, ty, _, Some vref) -> @@ -1965,11 +1982,13 @@ type PropInfo = /// Get the details of the indexer parameters associated with the property member x.GetParamDatas(amap, m) = + // TODO nullness import + fallback + generics x.GetParamNamesAndTypes(amap, m) |> List.map (fun (ParamNameAndType(nmOpt, paramTy)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, paramTy)) /// Get the types of the indexer parameters associated with the property member x.GetParamTypes(amap, m) = + // TODO nullness import + fallback + generics x.GetParamNamesAndTypes(amap, m) |> List.map (fun (ParamNameAndType(_, ty)) -> ty) /// Get a MethInfo for the 'getter' method associated with the property @@ -2261,6 +2280,7 @@ type EventInfo = | ILEvent(ILEventInfo(tinfo, edef)) -> // Get the delegate type associated with an IL event, taking into account the instantiation of the // declaring type. + // TODO nullness import + fallback + generics if Option.isNone edef.EventType then error (nonStandardEventError x.EventName m) ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] edef.EventType.Value From 37a27523252f3d5cf624e0b75448c9e41be208f4 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 6 Dec 2023 15:27:23 +0100 Subject: [PATCH 03/48] explanation added --- src/Compiler/Checking/import.fs | 63 ++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 3aec2c4063c..5922a32d349 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -166,21 +166,44 @@ let CanImportILTypeRef (env: ImportMap) m (tref: ILTypeRef) = let ImportTyconRefApp (env: ImportMap) tcref tyargs nullness = env.g.improveType tcref tyargs nullness -let ImportNullness (g: TcGlobals) = - ignore g - // if g.langFeatureNullness && g.assumeNullOnImport then - // KnownWithNull - // else - // TODO NULLNESS - KnownAmbivalentToNull - -let ImportNullnessForTyconRef (g: TcGlobals) (m: range) (tcref: TyconRef) = - ignore (g, tcref, m) - // if g.langFeatureNullness && g.assumeNullOnImport && TyconRefNullIsExtraValue g m tcref then - // KnownWithNull - // else - // TODO NULLNESS - KnownAmbivalentToNull + +module Nullness = + +(* Support full cascade trough the metadata hierarchy, as neeeded by the following existing calls: +">" in the below logic means a fallback in case of attribute missing +ImportParameterTypeFromMetadata : Parameter>Method>Class (+ extension method 'this') +ImportReturnTypeFromMetadata : Return>Method>Class +ImportILTypeFromMetadata : Field>Class +ImportILTypeFromMetadata : Property>Class (property return type) +ImportILTypeFromMetadata : Property arg> Property >Class (property indexer param) + + +ImportILTypeFromMetadata : Event > Class (DelegateType of an event) + +ImportReturnTypeFromMetadata : SlotSlig Param,Method,Class + + +The data which falls back might be a flat array, or a scalar (which represents an array of previously unknown size) +The array is passed trough all generic typars depth first , e.g. List,Uri>> + -- see here how the array indexes map to types above: [| 0 1 2 3 4 5 |] +For value types, a value is passed even though it is always 0 +*) + + let ImportNullness (g: TcGlobals) = + ignore g + // if g.langFeatureNullness && g.assumeNullOnImport then + // KnownWithNull + // else + // TODO NULLNESS + KnownAmbivalentToNull + + let ImportNullnessForTyconRef (g: TcGlobals) (m: range) (tcref: TyconRef) = + ignore (g, tcref, m) + // if g.langFeatureNullness && g.assumeNullOnImport && TyconRefNullIsExtraValue g m tcref then + // KnownWithNull + // else + // TODO NULLNESS + KnownAmbivalentToNull /// Import an IL type as an F# type. let rec ImportILType (env: ImportMap) m tinst ty = @@ -191,13 +214,13 @@ let rec ImportILType (env: ImportMap) m tinst ty = | ILType.Array(bounds, ty) -> let n = bounds.Rank let elemTy = ImportILType env m tinst ty - let nullness = ImportNullness env.g + let nullness = Nullness.ImportNullness env.g mkArrayTy env.g n nullness elemTy m | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) - let nullness = ImportNullnessForTyconRef env.g m tcref + let nullness = Nullness.ImportNullnessForTyconRef env.g m tcref ImportTyconRefApp env tcref inst nullness | ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty) @@ -219,7 +242,7 @@ let rec ImportILType (env: ImportMap) m tinst ty = List.item (int u16) tinst with _ -> error(Error(FSComp.SR.impNotEnoughTypeParamsInScopeWhileImporting(), m)) - let nullness = ImportNullness env.g + let nullness = Nullness.ImportNullness env.g let tyWithNullness = addNullnessToTy nullness ty tyWithNullness @@ -307,7 +330,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( let g = env.g if st.PUntaint((fun st -> st.IsArray), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) - let nullness = ImportNullness env.g + let nullness = Nullness.ImportNullness env.g mkArrayTy g (st.PUntaint((fun st -> st.GetArrayRank()), m)) nullness elemTy m elif st.PUntaint((fun st -> st.IsByRef), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) @@ -380,7 +403,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( else genericArg) - let nullness = ImportNullnessForTyconRef env.g m tcref + let nullness = Nullness.ImportNullnessForTyconRef env.g m tcref ImportTyconRefApp env tcref genericArgs nullness From baca9499431f0294cd5e1a07c7b9fa9e53edbf34 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 7 Dec 2023 16:27:48 +0100 Subject: [PATCH 04/48] il meta parsing --- src/Compiler/AbstractIL/il.fsi | 7 ++- src/Compiler/Checking/import.fs | 68 ++++++++++++++++++++++++++++- src/Compiler/TypedTree/TcGlobals.fs | 2 + 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 02fccb9f552..4ffd1dae8f9 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -868,7 +868,12 @@ type ILAttributes = /// Represents the efficiency-oriented storage of ILAttributes in another item. [] -type ILAttributesStored +type ILAttributesStored = + /// Computed by ilread.fs based on metadata index + | Reader of (int32 -> ILAttribute[]) + /// Already computed + | Given of ILAttributes + member GetCustomAttrs: int32 -> ILAttributes /// Method parameters and return values. [] diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 5922a32d349..0482e4d966b 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -167,7 +167,73 @@ let ImportTyconRefApp (env: ImportMap) tcref tyargs nullness = env.g.improveType tcref tyargs nullness -module Nullness = +module Nullness = + + open FSharp.Compiler.AbstractIL.Diagnostics + + let arrayWithByte0 = [|0uy|] + let arrayWithByte1 = [|1uy|] + let arrayWithByte2 = [|2uy|] + + let mapping byteValue = + match byteValue with + | 0uy -> NullnessInfo.AmbivalentToNull + | 1uy -> NullnessInfo.WithoutNull + | 2uy -> NullnessInfo.WithNull + | _ -> + dprintfn "%i was passed to Nullness mapping, this is not a valid value" byteValue + NullnessInfo.AmbivalentToNull + + let tryParseAttributeDataToNullableByteFlags (g:TcGlobals) attrData = + match attrData with + | None -> ValueNone + | Some ([ILAttribElem.Byte 0uy],_) -> ValueSome arrayWithByte0 + | Some ([ILAttribElem.Byte 1uy],_) -> ValueSome arrayWithByte1 + | Some ([ILAttribElem.Byte 2uy],_) -> ValueSome arrayWithByte2 + | Some ([ILAttribElem.Array(g.ilg.typ_Byte, listOfBytes)],_) -> + listOfBytes + |> Array.ofList + |> Array.choose(function | ILAttribElem.Byte b -> Some b | _ -> None) + + | _ -> ValueNone + + [] + type AttributesFromIL = AttributesFromIL of metadataIndex:int * attrs:ILAttributesStored + with + member this.Read() = match this with| AttributesFromIL(idx,attrs) -> attrs.GetCustomAttrs(idx) + member this.GetNullable(g:TcGlobals) = + match g.attrib_NullableAttribute_opt with + | None -> ValueNone + | Some n -> + TryDecodeILAttribute n.TypeRef (this.Read()) + |> tryParseAttributeDataToNullableByteFlags g + + member this.GetNullableContext(g:TcGlobals) = + match g.attrib_NullableContextAttribute_opt with + | None -> ValueNone + | Some n -> + TryDecodeILAttribute n.TypeRef (this.Read()) + |> tryParseAttributeDataToNullableByteFlags g + + [] + type NullableContextSource = + | FromClass of AttributesFromIL + | FromMethodAndClass of methodAttrs:AttributesFromIL * classAttrs:AttributesFromIL + + [] + type NullableInfoContainer = + { DirectAttributes: AttributesFromIL + Fallback : NullableContextSource} + with + member this.GetFlags(g:TcGlobals) = + this.DirectAttributes.GetNullable(g) + |> ValueOption.orElseWith(fun () -> + match this.Fallback with + | FromClass attrs -> attrs.GetNullableContext(g) + | FromMethodAndClass(methodCtx,classCtx) -> + methodCtx.GetNullableContext(g) + |> ValueOption.orElseWith (fun () -> classCtx.GetNullableContext(g))) + |> ValueOption.defaultValue arrayWithByte0 (* Support full cascade trough the metadata hierarchy, as neeeded by the following existing calls: ">" in the below logic means a fallback in case of attribute missing diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 982f5de20ff..e43c422eafe 100755 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1452,6 +1452,8 @@ type TcGlobals( member val attrib_IsReadOnlyAttribute = findOrEmbedSysPublicType "System.Runtime.CompilerServices.IsReadOnlyAttribute" member val attrib_IsUnmanagedAttribute = findOrEmbedSysPublicType "System.Runtime.CompilerServices.IsUnmanagedAttribute" member val attrib_DynamicDependencyAttribute = findOrEmbedSysPublicType "System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute" + member val attrib_NullableAttribute_opt = tryFindSysAttrib "System.Runtime.CompilerServices.NullableAttribute" + member val attrib_NullableContextAttribute_opt = tryFindSysAttrib "System.Runtime.CompilerServices.NullableContextAttribute" member val attrib_NullableAttribute = findOrEmbedSysPublicType "System.Runtime.CompilerServices.NullableAttribute" member val attrib_NullableContextAttribute = findOrEmbedSysPublicType "System.Runtime.CompilerServices.NullableContextAttribute" member val attrib_MemberNotNullWhenAttribute = findOrEmbedSysPublicType "System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute" From feeb0981f7233daf552848dfdb1b4664e988ca94 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 7 Dec 2023 16:50:40 +0100 Subject: [PATCH 05/48] flags evaluation --- src/Compiler/Checking/import.fs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 0482e4d966b..61a43e943d3 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -175,14 +175,18 @@ module Nullness = let arrayWithByte1 = [|1uy|] let arrayWithByte2 = [|2uy|] + let knownAmbivalent = NullnessInfo.AmbivalentToNull |> Nullness.Known + let knownWithoutNull = NullnessInfo.WithoutNull |> Nullness.Known + let knownNullable = NullnessInfo.WithNull |> Nullness.Known + let mapping byteValue = match byteValue with - | 0uy -> NullnessInfo.AmbivalentToNull - | 1uy -> NullnessInfo.WithoutNull - | 2uy -> NullnessInfo.WithNull + | 0uy -> knownAmbivalent + | 1uy -> knownWithoutNull + | 2uy -> knownNullable | _ -> dprintfn "%i was passed to Nullness mapping, this is not a valid value" byteValue - NullnessInfo.AmbivalentToNull + knownAmbivalent let tryParseAttributeDataToNullableByteFlags (g:TcGlobals) attrData = match attrData with @@ -221,7 +225,7 @@ module Nullness = | FromMethodAndClass of methodAttrs:AttributesFromIL * classAttrs:AttributesFromIL [] - type NullableInfoContainer = + type NullableAttributesSource = { DirectAttributes: AttributesFromIL Fallback : NullableContextSource} with @@ -235,6 +239,24 @@ module Nullness = |> ValueOption.orElseWith (fun () -> classCtx.GetNullableContext(g))) |> ValueOption.defaultValue arrayWithByte0 + [] + type NullableFlags = {Data : byte[]; Idx : int } + with + member this.GetNullness() = + match this.Data.Length with + // No nullable data nor parent context -> we cannot tell + | 0 -> knownAmbivalent + // A scalar value from attributes, cover type and all it's potential typars + | 1 -> this.Data[0] |> mapping + // We have a bigger array, indexes map to typars in a depth-first fashion + | n when n > this.Idx -> this.Data[this.Idx] |> mapping + // This is an errornous case, we need more nullnessinfo then the metadata contains + | _ -> + failwithf "This is wrong %A" this // TODO nullness - once being confident, remove failwith and replace with dprintfn + knownAmbivalent + + member this.Advance() = {Data = this.Data; Idx = this.Idx + 1} + (* Support full cascade trough the metadata hierarchy, as neeeded by the following existing calls: ">" in the below logic means a fallback in case of attribute missing ImportParameterTypeFromMetadata : Parameter>Method>Class (+ extension method 'this') From cfa416fd9b7ff2ac7bfde2bdb030d58fdd961f9f Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 7 Dec 2023 17:00:08 +0100 Subject: [PATCH 06/48] you shall passs --- src/Compiler/Checking/import.fs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 61a43e943d3..49703a46e62 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -194,10 +194,11 @@ module Nullness = | Some ([ILAttribElem.Byte 0uy],_) -> ValueSome arrayWithByte0 | Some ([ILAttribElem.Byte 1uy],_) -> ValueSome arrayWithByte1 | Some ([ILAttribElem.Byte 2uy],_) -> ValueSome arrayWithByte2 - | Some ([ILAttribElem.Array(g.ilg.typ_Byte, listOfBytes)],_) -> + | Some ([ILAttribElem.Array(byteType,listOfBytes)],_) when byteType = g.ilg.typ_Byte -> listOfBytes |> Array.ofList |> Array.choose(function | ILAttribElem.Byte b -> Some b | _ -> None) + |> ValueSome | _ -> ValueNone @@ -230,9 +231,10 @@ module Nullness = Fallback : NullableContextSource} with member this.GetFlags(g:TcGlobals) = + let fallback = this.Fallback this.DirectAttributes.GetNullable(g) |> ValueOption.orElseWith(fun () -> - match this.Fallback with + match fallback with | FromClass attrs -> attrs.GetNullableContext(g) | FromMethodAndClass(methodCtx,classCtx) -> methodCtx.GetNullableContext(g) @@ -252,7 +254,7 @@ module Nullness = | n when n > this.Idx -> this.Data[this.Idx] |> mapping // This is an errornous case, we need more nullnessinfo then the metadata contains | _ -> - failwithf "This is wrong %A" this // TODO nullness - once being confident, remove failwith and replace with dprintfn + failwithf "Length of Nullable metadata and needs of its processing do not match: %A" this // TODO nullness - once being confident, remove failwith and replace with dprintfn knownAmbivalent member this.Advance() = {Data = this.Data; Idx = this.Idx + 1} From ac5ff278da7f70be7ae6c94d295a83d3bcadf374 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 7 Dec 2023 18:07:43 +0100 Subject: [PATCH 07/48] evaluateFirstOrderNullnessAndAdvance --- src/Compiler/Checking/import.fs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 49703a46e62..e3d9c81a11b 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -254,11 +254,19 @@ module Nullness = | n when n > this.Idx -> this.Data[this.Idx] |> mapping // This is an errornous case, we need more nullnessinfo then the metadata contains | _ -> - failwithf "Length of Nullable metadata and needs of its processing do not match: %A" this // TODO nullness - once being confident, remove failwith and replace with dprintfn + failwithf "Length of Nullable metadata and needs of its processing do not match: %A" this // TODO nullness - once being confident that our bugs are solved and what remains are incoming metadata bugs, remove failwith and replace with dprintfn knownAmbivalent member this.Advance() = {Data = this.Data; Idx = this.Idx + 1} + let inline evaluateFirstOrderNullnessAndAdvance (ilt:ILType) (flags:NullableFlags) = + match ilt with + | ILType.Value tspec when tspec.GenericArgs.IsEmpty -> KnownWithoutNull, flags + // TODO nullness - System.Nullable might bite us, since you CAN assign 'null' to it, and when boxed, it CAN be boxed to 'null'. + | ILType.Value tspec when tspec.Name = "Nullable`1" && tspec.Enclosing = ["System"] -> KnownWithoutNull, flags + | ILType.Value _ -> KnownWithoutNull, flags.Advance() + | _ -> flags.GetNullness(), flags.Advance() + (* Support full cascade trough the metadata hierarchy, as neeeded by the following existing calls: ">" in the below logic means a fallback in case of attribute missing ImportParameterTypeFromMetadata : Parameter>Method>Class (+ extension method 'this') @@ -296,21 +304,23 @@ For value types, a value is passed even though it is always 0 KnownAmbivalentToNull /// Import an IL type as an F# type. -let rec ImportILType (env: ImportMap) m tinst ty = +let rec ImportILType (env: ImportMap) m tinst (nullableFlags:Nullness.NullableFlags) ty = match ty with | ILType.Void -> env.g.unit_ty | ILType.Array(bounds, ty) -> let n = bounds.Rank - let elemTy = ImportILType env m tinst ty - let nullness = Nullness.ImportNullness env.g - mkArrayTy env.g n nullness elemTy m + let (arrayNullness,flagsForElem) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nullableFlags + let elemTy = ImportILType env m tinst flagsForElem ty + mkArrayTy env.g n arrayNullness elemTy m | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef + let (nullness,flagsForTypars) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nullableFlags + List.mapFold let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) - let nullness = Nullness.ImportNullnessForTyconRef env.g m tcref + ImportTyconRefApp env tcref inst nullness | ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty) From 62aa5342c2e1951b7a2d66b26a9113306c830094 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 11 Dec 2023 14:56:51 +0100 Subject: [PATCH 08/48] import il type with nullness --- src/Compiler/Checking/import.fs | 101 ++++++++++++++++++------------- src/Compiler/Utilities/illib.fs | 13 ++++ src/Compiler/Utilities/illib.fsi | 2 + 3 files changed, 74 insertions(+), 42 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index e3d9c81a11b..891000e933e 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -262,7 +262,7 @@ module Nullness = let inline evaluateFirstOrderNullnessAndAdvance (ilt:ILType) (flags:NullableFlags) = match ilt with | ILType.Value tspec when tspec.GenericArgs.IsEmpty -> KnownWithoutNull, flags - // TODO nullness - System.Nullable might bite us, since you CAN assign 'null' to it, and when boxed, it CAN be boxed to 'null'. + // TODO nullness - System.Nullable might be tricky, since you CAN assign 'null' to it, and when boxed, it CAN be boxed to 'null'. | ILType.Value tspec when tspec.Name = "Nullable`1" && tspec.Enclosing = ["System"] -> KnownWithoutNull, flags | ILType.Value _ -> KnownWithoutNull, flags.Advance() | _ -> flags.GetNullness(), flags.Advance() @@ -287,53 +287,28 @@ The array is passed trough all generic typars depth first , e.g. List env.g.unit_ty | ILType.Array(bounds, ty) -> let n = bounds.Rank - let (arrayNullness,flagsForElem) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nullableFlags - let elemTy = ImportILType env m tinst flagsForElem ty - mkArrayTy env.g n arrayNullness elemTy m + let elemTy = ImportILType env m tinst ty + mkArrayTy env.g n Nullness.knownAmbivalent elemTy m | ILType.Boxed tspec | ILType.Value tspec -> let tcref = ImportILTypeRef env m tspec.TypeRef - let (nullness,flagsForTypars) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nullableFlags - List.mapFold - let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) - - ImportTyconRefApp env tcref inst nullness + let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) + ImportTyconRefApp env tcref inst Nullness.knownAmbivalent | ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty) - | ILType.Ptr ILType.Void when env.g.voidptr_tcr.CanDeref -> mkVoidPtrTy env.g - | ILType.Ptr ty -> mkNativePtrTy env.g (ImportILType env m tinst ty) - | ILType.FunctionPointer _ -> env.g.nativeint_ty (* failwith "cannot import this kind of type (ptr, fptr)" *) - | ILType.Modified(_, _, ty) -> - // All custom modifiers are ignored - // NULLNESS TODO: pick up the optional attributes at this point and fold the array of nullness information into the conversion + // All custom modifiers are ignored ImportILType env m tinst ty | ILType.TypeVar u16 -> @@ -342,30 +317,69 @@ let rec ImportILType (env: ImportMap) m tinst (nullableFlags:Nullness.NullableFl List.item (int u16) tinst with _ -> error(Error(FSComp.SR.impNotEnoughTypeParamsInScopeWhileImporting(), m)) - let nullness = Nullness.ImportNullness env.g - let tyWithNullness = addNullnessToTy nullness ty + + let tyWithNullness = addNullnessToTy Nullness.knownAmbivalent ty tyWithNullness +/// Import an IL type as an F# type. +let rec ImportILTypeWithNullness (env: ImportMap) m tinst (nf:Nullness.NullableFlags) ty : struct(TType*Nullness.NullableFlags) = + match ty with + | ILType.Void -> + env.g.unit_ty,nf + + | ILType.Array(bounds, ty) -> + let n = bounds.Rank + let (arrayNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + let struct(elemTy,nf) = ImportILTypeWithNullness env m tinst nf ty + mkArrayTy env.g n arrayNullness elemTy m, nf + + | ILType.Boxed tspec | ILType.Value tspec -> + let tcref = ImportILTypeRef env m tspec.TypeRef + let (typeRefNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + let struct(inst,nullableFlagsLeft) = (nf,tspec.GenericArgs) ||> List.vMapFold (fun nf current -> ImportILTypeWithNullness env m tinst nf current ) + + ImportTyconRefApp env tcref inst typeRefNullness, nullableFlagsLeft + + | ILType.Byref ty -> + let struct(ttype,nf) = ImportILTypeWithNullness env m tinst nf ty + mkByrefTy env.g ttype, nf + + | ILType.Ptr ILType.Void when env.g.voidptr_tcr.CanDeref -> mkVoidPtrTy env.g, nf + + | ILType.Ptr ty -> + let struct(ttype,nf) = ImportILTypeWithNullness env m tinst nf ty + mkNativePtrTy env.g ttype, nf + + | ILType.FunctionPointer _ -> env.g.nativeint_ty, nf (* failwith "cannot import this kind of type (ptr, fptr)" *) + + | ILType.Modified(_, _, ty) -> + // All custom modifiers are ignored + ImportILTypeWithNullness env m tinst nf ty + + | ILType.TypeVar u16 -> + let ttype = + try + List.item (int u16) tinst + with _ -> + error(Error(FSComp.SR.impNotEnoughTypeParamsInScopeWhileImporting(), m)) + + let (typeVarNullness,nf) = Nullness.evaluateFirstOrderNullnessAndAdvance ty nf + addNullnessToTy typeVarNullness ttype, nf + /// Determines if an IL type can be imported as an F# type let rec CanImportILType (env: ImportMap) m ty = match ty with | ILType.Void -> true - | ILType.Array(_bounds, ety) -> CanImportILType env m ety - | ILType.Boxed tspec | ILType.Value tspec -> CanImportILTypeRef env m tspec.TypeRef && tspec.GenericArgs |> List.forall (CanImportILType env m) | ILType.Byref ety -> CanImportILType env m ety - | ILType.Ptr ety -> CanImportILType env m ety - | ILType.FunctionPointer _ -> true - | ILType.Modified(_, _, ety) -> CanImportILType env m ety - | ILType.TypeVar _u16 -> true #if !NO_TYPEPROVIDERS @@ -430,7 +444,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( let g = env.g if st.PUntaint((fun st -> st.IsArray), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) - let nullness = Nullness.ImportNullness env.g + let nullness = Nullness.knownAmbivalent // TODO nullness type providers Nullness.ImportNullness env.g mkArrayTy g (st.PUntaint((fun st -> st.GetArrayRank()), m)) nullness elemTy m elif st.PUntaint((fun st -> st.IsByRef), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) @@ -503,7 +517,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( else genericArg) - let nullness = Nullness.ImportNullnessForTyconRef env.g m tcref + let nullness = Nullness.knownAmbivalent // TODO nullness type providers Nullness.ImportNullnessForTyconRef env.g m tcref ImportTyconRefApp env tcref genericArgs nullness @@ -556,6 +570,7 @@ let ImportProvidedMethodBaseAsILMethodRef (env: ImportMap) (m: range) (mbase: Ta let formalParamTysAfterInst = [ for p in ctor.PApplyArray((fun x -> x.GetParameters()), "GetParameters", m) do let ilFormalTy = ImportProvidedTypeAsILType env m (p.PApply((fun p -> p.ParameterType), m)) + // TODO import of Nullness in type providers yield ImportILType env m actualGenericArgs ilFormalTy ] (formalParamTysAfterInst, actualParamTys) ||> List.lengthsEqAndForall2 (typeEquiv env.g)) @@ -859,6 +874,8 @@ let ImportILAssembly(amap: unit -> ImportMap, m, auxModuleLoader, xmlDocInfoLoad /// Import an IL type as an F# type. importInst gives the context for interpreting type variables. let RescopeAndImportILType scoref amap m importInst ilTy = ilTy |> rescopeILType scoref |> ImportILType amap m importInst + //let g = amap.g + //g.checkNullness && g.langFeatureNullness let CanRescopeAndImportILType scoref amap m ilTy = ilTy |> rescopeILType scoref |> CanImportILType amap m diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index dd2030d156b..7689f251f26 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -648,6 +648,19 @@ module List = | Some x -> x :: l | _ -> l + let rec vMapFold<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list : struct('Result list * 'State) = + match list with + | [] -> [], state + | [h] -> + let struct(x', s') = mapping state h + [x'], s' + | h :: t -> + let struct(mappedHead, stateHead) = mapping state h + let struct(mappedTail,stateTail) = vMapFold mapping stateHead t + (mappedHead :: mappedTail), stateTail + + + module ResizeArray = /// Split a ResizeArray into an array of smaller chunks. diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index 1110e8134b1..266f884fa01 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -240,6 +240,8 @@ module internal List = val prependIfSome: x: 'a option -> l: 'a list -> 'a list + val vMapFold<'T,'State,'Result> : mapping:('State -> 'T -> struct('Result * 'State)) -> state:'State -> list:'T list -> struct('Result list * 'State) + module internal ResizeArray = /// Split a ResizeArray into an array of smaller chunks. From 06623dffd0faef64426794af7da280fb19602cd7 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Dec 2023 13:48:45 +0100 Subject: [PATCH 09/48] type import --- src/Compiler/Checking/AttributeChecking.fs | 6 ++--- src/Compiler/Checking/TypeHierarchy.fs | 29 +++++++++++++--------- src/Compiler/Checking/TypeHierarchy.fsi | 7 ++++++ src/Compiler/Checking/import.fs | 18 +++++++++++--- src/Compiler/Checking/import.fsi | 26 ++++++++++++++++++- src/Compiler/Checking/infos.fs | 2 +- 6 files changed, 67 insertions(+), 21 deletions(-) diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 2f02f794e8b..ccfb744618c 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -90,7 +90,7 @@ type AttribInfo = match x with | FSAttribInfo(_g, Attrib(tcref, _, _, _, _, _, _)) -> tcref | ILAttribInfo (g, amap, scoref, a, m) -> - let ty = RescopeAndImportILType scoref amap m [] a.Method.DeclaringType + let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] a.Method.DeclaringType tcrefOfAppTy g ty member x.ConstructorArguments = @@ -104,7 +104,7 @@ type AttribInfo = | ILAttribInfo (_g, amap, scoref, cattr, m) -> let parms, _args = decodeILAttribData cattr [ for argTy, arg in Seq.zip cattr.Method.FormalArgTypes parms -> - let ty = RescopeAndImportILType scoref amap m [] argTy + let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] argTy let obj = evalILAttribElem arg ty, obj ] @@ -119,7 +119,7 @@ type AttribInfo = | ILAttribInfo (_g, amap, scoref, cattr, m) -> let _parms, namedArgs = decodeILAttribData cattr [ for nm, argTy, isProp, arg in namedArgs -> - let ty = RescopeAndImportILType scoref amap m [] argTy + let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] argTy let obj = evalILAttribElem arg let isField = not isProp ty, nm, isField, obj ] diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index c6aa275887e..12e57247133 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -55,7 +55,7 @@ let GetSuperTypeOfType g amap m ty = let tinst = argsOfAppTy g ty match tdef.Extends with | None -> None - | Some ilTy -> Some (RescopeAndImportILType scoref amap m tinst ilTy) + | Some ilTy -> Some (RescopeAndImportILTypeSkipNullness scoref amap m tinst ilTy) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> if isFSharpObjModelTy g ty || isFSharpExceptionTy g ty then @@ -115,7 +115,7 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) // assume those are present. for intfTy in tdef.Implements do if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m intfTy then - RescopeAndImportILType scoref amap m tinst intfTy + RescopeAndImportILTypeSkipNullness scoref amap m tinst intfTy | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> for intfTy in tcref.ImmediateInterfaceTypesOfFSharpTycon do instType (mkInstForAppTy g ty) intfTy ] @@ -356,35 +356,40 @@ let ExistsHeadTypeInEntireHierarchy g amap m typeToSearchFrom tcrefToLookFor = ExistsInEntireHierarchyOfType (HasHeadType g tcrefToLookFor) g amap m AllowMultiIntfInstantiations.Yes typeToSearchFrom /// Read an Abstract IL type from metadata and convert to an F# type. -let ImportILTypeFromMetadata amap m scoref tinst minst ilTy = - RescopeAndImportILType scoref amap m (tinst@minst) ilTy +let ImportILTypeFromMetadata amap m scoref tinst minst nullnessSource ilTy = + RescopeAndImportILType scoref amap m (tinst@minst) nullnessSource ilTy + +/// Read an Abstract IL type from metadata and convert to an F# type, ignoring nullness checking. +let ImportILTypeFromMetadataSkipNullness amap m scoref tinst minst ilTy = + RescopeAndImportILTypeSkipNullness scoref amap m (tinst@minst) ilTy /// Read an Abstract IL type from metadata, including any attributes that may affect the type itself, and convert to an F# type. -let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst ilTy getCattrs = - let ty = RescopeAndImportILType scoref amap m (tinst@minst) ilTy +let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource ilTy (_getCattrs: unit -> ILAttributes) = + let ty = RescopeAndImportILType scoref amap m (tinst@minst) nullnessSource ilTy + // If the type is a byref and one of attributes from a return or parameter has // - a `IsReadOnlyAttribute` - it's an inref // - a `RequiresLocationAttribute` (in which case it's a `ref readonly`) which we treat as inref, // latter is an ad-hoc fix for https://github.com/dotnet/runtime/issues/94317. if isByrefTy amap.g ty - && (TryFindILAttribute amap.g.attrib_IsReadOnlyAttribute (getCattrs ()) - || TryFindILAttribute amap.g.attrib_RequiresLocationAttribute (getCattrs ())) then + && (TryFindILAttribute amap.g.attrib_IsReadOnlyAttribute (nullnessSource.DirectAttributes.Read()) + || TryFindILAttribute amap.g.attrib_RequiresLocationAttribute (nullnessSource.DirectAttributes.Read())) then mkInByrefTy amap.g (destByrefTy amap.g ty) else ty /// Get the parameter type of an IL method. -let ImportParameterTypeFromMetadata amap m ilTy getCattrs scoref tinst mist = +let ImportParameterTypeFromMetadata amap m nullnessSource ilTy getCattrs scoref tinst mist = // TODO nullness import + fallback + generics - ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist ilTy getCattrs + ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist nullnessSource ilTy getCattrs /// Get the return type of an IL method, taking into account instantiations for type, return attributes and method generic parameters, and /// translating 'void' to 'None'. -let ImportReturnTypeFromMetadata amap m ilTy getCattrs scoref tinst minst = +let ImportReturnTypeFromMetadata amap m nullnessSource ilTy getCattrs scoref tinst minst = // TODO nullness import + fallback + generics match ilTy with | ILType.Void -> None - | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst retTy getCattrs) + | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource retTy getCattrs ) /// Copy constraints. If the constraint comes from a type parameter associated diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index 225e6187477..be41acbf77a 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -117,6 +117,10 @@ val ExistsHeadTypeInEntireHierarchy: /// Read an Abstract IL type from metadata and convert to an F# type. val ImportILTypeFromMetadata: + amap: ImportMap -> m: range -> scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> TType + +/// Read an Abstract IL type from metadata and convert to an F# type, ignoring nullness checking. +val ImportILTypeFromMetadataSkipNullness: amap: ImportMap -> m: range -> scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> ilTy: ILType -> TType /// Read an Abstract IL type from metadata, including any attributes that may affect the type itself, and convert to an F# type. @@ -126,6 +130,7 @@ val ImportILTypeFromMetadataWithAttributes: scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> + nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> getCattrs: (unit -> ILAttributes) -> TType @@ -134,6 +139,7 @@ val ImportILTypeFromMetadataWithAttributes: val ImportParameterTypeFromMetadata: amap: ImportMap -> m: range -> + nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> getCattrs: (unit -> ILAttributes) -> scoref: ILScopeRef -> @@ -146,6 +152,7 @@ val ImportParameterTypeFromMetadata: val ImportReturnTypeFromMetadata: amap: ImportMap -> m: range -> + nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> getCattrs: (unit -> ILAttributes) -> scoref: ILScopeRef -> diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 891000e933e..6170e249ff0 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -868,14 +868,24 @@ let ImportILAssembly(amap: unit -> ImportMap, m, auxModuleLoader, xmlDocInfoLoad CcuThunk.Create(nm, ccuData) //------------------------------------------------------------------------- -// From IL types to F# types +// From IL types to F# typess //------------------------------------------------------------------------- /// Import an IL type as an F# type. importInst gives the context for interpreting type variables. -let RescopeAndImportILType scoref amap m importInst ilTy = +let RescopeAndImportILTypeSkipNullness scoref amap m importInst ilTy = ilTy |> rescopeILType scoref |> ImportILType amap m importInst - //let g = amap.g - //g.checkNullness && g.langFeatureNullness + +let RescopeAndImportILType scoref (amap:ImportMap) m importInst (nullnessSource:Nullness.NullableAttributesSource) ilTy = + let g = amap.g + if g.langFeatureNullness && g.checkNullness then + let flags = nullnessSource.GetFlags(g) + let flags = {Nullness.NullableFlags.Data = flags; Nullness.NullableFlags.Idx = 0} + let struct(ty,_) = ilTy |> rescopeILType scoref |> ImportILTypeWithNullness amap m importInst flags + ty + else + RescopeAndImportILTypeSkipNullness scoref amap m importInst ilTy + + let CanRescopeAndImportILType scoref amap m ilTy = ilTy |> rescopeILType scoref |> CanImportILType amap m diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index 830fd81b12d..42755399bab 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -98,9 +98,33 @@ val internal ImportILAssembly: val internal ImportILAssemblyTypeForwarders: (unit -> ImportMap) * range * ILExportedTypesAndForwarders -> CcuTypeForwarderTable +module Nullness = + + [] + type AttributesFromIL = AttributesFromIL of metadataIndex:int * attrs:ILAttributesStored + with + member Read: unit -> ILAttributes + + [] + type NullableContextSource = + | FromClass of AttributesFromIL + | FromMethodAndClass of methodAttrs:AttributesFromIL * classAttrs:AttributesFromIL + + [] + type NullableAttributesSource = + { DirectAttributes: AttributesFromIL + Fallback : NullableContextSource} + /// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly /// being compiled. importInst gives the context for interpreting type variables. -val RescopeAndImportILType: +/// This function fully skips the 'nullness checking' metadata flags. +val RescopeAndImportILTypeSkipNullness: scoref: ILScopeRef -> amap: ImportMap -> m: range -> importInst: TType list -> ilTy: ILType -> TType + +/// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly +/// being compiled. importInst gives the context for interpreting type variables. +val RescopeAndImportILType: + scoref: ILScopeRef -> amap: ImportMap -> m: range -> importInst: TType list -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> TType + val CanRescopeAndImportILType: scoref: ILScopeRef -> amap: ImportMap -> m: range -> ilTy: ILType -> bool diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 568d753250b..0098a94d548 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -216,7 +216,7 @@ type OptionalArgInfo = else MissingValue else DefaultValue - CallerSide (analyze (ImportILTypeFromMetadata amap m ilScope ilTypeInst [] ilParam.Type)) + CallerSide (analyze (ImportILTypeFromMetadataSkipNullness amap m ilScope ilTypeInst [] ilParam.Type)) | Some v -> CallerSide (Constant v) else From 2aa972277fd1e0dce4fb85606e8ec605b333dd4d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Dec 2023 15:39:06 +0100 Subject: [PATCH 10/48] IL nullness import fields, props, events, method args, method return types - nullness imported from IL --- src/Compiler/AbstractIL/il.fsi | 12 ++ src/Compiler/Checking/AccessibilityLogic.fs | 2 +- src/Compiler/Checking/InfoReader.fs | 2 +- src/Compiler/Checking/NicePrint.fs | 2 +- src/Compiler/Checking/TypeHierarchy.fs | 12 +- src/Compiler/Checking/TypeHierarchy.fsi | 3 - src/Compiler/Checking/import.fs | 3 + src/Compiler/Checking/import.fsi | 2 + src/Compiler/Checking/infos.fs | 121 ++++++++++-------- src/Compiler/Checking/infos.fsi | 2 +- src/Compiler/Symbols/Exprs.fs | 5 +- src/Compiler/TypedTree/TypedTreeBasics.fs | 21 ++- .../Language/NullableCsharpImportTests.fs | 46 +++++-- 13 files changed, 150 insertions(+), 83 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 4ffd1dae8f9..db9f878f994 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -1074,6 +1074,8 @@ type ILMethodDef = member IsEntryPoint: bool member GenericParams: ILGenericParameterDefs member CustomAttrs: ILAttributes + member MetadataIndex: int32 + member CustomAttrsStored: ILAttributesStored member ParameterTypes: ILTypes member IsIL: bool member Code: ILCode option @@ -1247,6 +1249,10 @@ type ILFieldDef = member CustomAttrs: ILAttributes + member MetadataIndex: int32 + + member CustomAttrsStored: ILAttributesStored + member IsStatic: bool member IsSpecialName: bool @@ -1330,6 +1336,8 @@ type ILEventDef = member FireMethod: ILMethodRef option member OtherMethods: ILMethodRef list member CustomAttrs: ILAttributes + member MetadataIndex: int32 + member CustomAttrsStored: ILAttributesStored member IsSpecialName: bool member IsRTSpecialName: bool @@ -1392,6 +1400,8 @@ type ILPropertyDef = member Init: ILFieldInit option member Args: ILTypes member CustomAttrs: ILAttributes + member MetadataIndex: int32 + member CustomAttrsStored: ILAttributesStored member IsSpecialName: bool member IsRTSpecialName: bool @@ -1543,6 +1553,8 @@ type ILTypeDef = member Events: ILEventDefs member Properties: ILPropertyDefs member CustomAttrs: ILAttributes + member MetadataIndex: int32 + member CustomAttrsStored: ILAttributesStored member IsClass: bool member IsStruct: bool member IsInterface: bool diff --git a/src/Compiler/Checking/AccessibilityLogic.fs b/src/Compiler/Checking/AccessibilityLogic.fs index 4a70f268ddf..7e93b5c07a9 100644 --- a/src/Compiler/Checking/AccessibilityLogic.fs +++ b/src/Compiler/Checking/AccessibilityLogic.fs @@ -243,7 +243,7 @@ let IsILEventInfoAccessible g amap m ad einfo = let private IsILMethInfoAccessible g amap m adType ad ilminfo = match ilminfo with - | ILMethInfo (_, ty, None, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad (ILTypeInfo.FromType g ty) mdef.Access + | ILMethInfo (_, ty, None, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad (ILTypeInfo.FromType g ty.ToType) mdef.Access | ILMethInfo (_, _, Some declaringTyconRef, mdef, _) -> IsILMemberAccessible g amap m declaringTyconRef ad mdef.Access let GetILAccessOfILPropInfo (ILPropInfo(tinfo, pdef)) = diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 8f5489b0c6a..e917dbd6d8b 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -1142,7 +1142,7 @@ let GetXmlDocSigOfMethInfo (infoReader: InfoReader) m (minfo: MethInfo) = match TryFindMetadataInfoOfExternalEntityRef infoReader m ilminfo.DeclaringTyconRef with | None -> None | Some (ccuFileName, formalTypars, formalTypeInfo) -> - let filminfo = ILMethInfo(g, formalTypeInfo.ToType, None, ilminfo.RawMetadata, fmtps) + let filminfo = ILMethInfo(g, formalTypeInfo, None, ilminfo.RawMetadata, fmtps) let args = if ilminfo.IsILExtensionMethod then filminfo.GetRawArgTypes(amap, m, minfo.FormalMethodInst) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 5fbdc0d2bc6..aa086407311 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1647,7 +1647,7 @@ module InfoMemberPrinting = // Prettify an ILMethInfo let prettifyILMethInfo (amap: Import.ImportMap) m (minfo: MethInfo) typarInst ilMethInfo = let (ILMethInfo(_, apparentTy, dty, mdef, _)) = ilMethInfo - let (prettyTyparInst, prettyTys), _ = PrettyTypes.PrettifyInstAndTypes amap.g (typarInst, (apparentTy :: minfo.FormalMethodInst)) + let (prettyTyparInst, prettyTys), _ = PrettyTypes.PrettifyInstAndTypes amap.g (typarInst, (apparentTy.ToType :: minfo.FormalMethodInst)) match prettyTys with | prettyApparentTy :: prettyFormalMethInst -> let prettyMethInfo = diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index 12e57247133..7fb2eca7964 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -364,7 +364,7 @@ let ImportILTypeFromMetadataSkipNullness amap m scoref tinst minst ilTy = RescopeAndImportILTypeSkipNullness scoref amap m (tinst@minst) ilTy /// Read an Abstract IL type from metadata, including any attributes that may affect the type itself, and convert to an F# type. -let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource ilTy (_getCattrs: unit -> ILAttributes) = +let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource ilTy = let ty = RescopeAndImportILType scoref amap m (tinst@minst) nullnessSource ilTy // If the type is a byref and one of attributes from a return or parameter has @@ -379,17 +379,15 @@ let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSou ty /// Get the parameter type of an IL method. -let ImportParameterTypeFromMetadata amap m nullnessSource ilTy getCattrs scoref tinst mist = - // TODO nullness import + fallback + generics - ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist nullnessSource ilTy getCattrs +let ImportParameterTypeFromMetadata amap m nullnessSource ilTy scoref tinst mist = + ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist nullnessSource ilTy /// Get the return type of an IL method, taking into account instantiations for type, return attributes and method generic parameters, and /// translating 'void' to 'None'. -let ImportReturnTypeFromMetadata amap m nullnessSource ilTy getCattrs scoref tinst minst = - // TODO nullness import + fallback + generics +let ImportReturnTypeFromMetadata amap m nullnessSource ilTy scoref tinst minst = match ilTy with | ILType.Void -> None - | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource retTy getCattrs ) + | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst nullnessSource retTy ) /// Copy constraints. If the constraint comes from a type parameter associated diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index be41acbf77a..ff41ef6760a 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -132,7 +132,6 @@ val ImportILTypeFromMetadataWithAttributes: minst: TType list -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> - getCattrs: (unit -> ILAttributes) -> TType /// Get the parameter type of an IL method. @@ -141,7 +140,6 @@ val ImportParameterTypeFromMetadata: m: range -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> - getCattrs: (unit -> ILAttributes) -> scoref: ILScopeRef -> tinst: TType list -> mist: TType list -> @@ -154,7 +152,6 @@ val ImportReturnTypeFromMetadata: m: range -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> - getCattrs: (unit -> ILAttributes) -> scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 6170e249ff0..2b26bf968dc 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -240,6 +240,9 @@ module Nullness = methodCtx.GetNullableContext(g) |> ValueOption.orElseWith (fun () -> classCtx.GetNullableContext(g))) |> ValueOption.defaultValue arrayWithByte0 + static member Empty = + let emptyFromIL = AttributesFromIL(0,Given(ILAttributes.Empty)) + {DirectAttributes = emptyFromIL; Fallback = FromClass(emptyFromIL)} [] type NullableFlags = {Data : byte[]; Idx : int } diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index 42755399bab..c7467770268 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -114,6 +114,8 @@ module Nullness = type NullableAttributesSource = { DirectAttributes: AttributesFromIL Fallback : NullableContextSource} + with + static member Empty : NullableAttributesSource /// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly /// being compiled. importInst gives the context for interpreting type variables. diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 0098a94d548..593fe760f59 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -9,6 +9,7 @@ open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Import +open FSharp.Compiler.Import.Nullness open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.TcGlobals @@ -447,6 +448,10 @@ type ILTypeInfo = let (ILTypeInfo(g, ty, tref, tdef)) = x ILTypeInfo(g, instType inst ty, tref, tdef) + member x.NullableAttributes = AttributesFromIL(x.RawMetadata.MetadataIndex,x.RawMetadata.CustomAttrsStored) + + member x.NullableClassSource = FromClass(x.NullableAttributes) + static member FromType g ty = if isAnyTupleTy g ty then // When getting .NET metadata for the properties and methods @@ -472,14 +477,14 @@ type ILMethInfo = /// /// If ilDeclaringTyconRefOpt is 'Some' then this is an F# use of an C#-style extension method. /// If ilDeclaringTyconRefOpt is 'None' then ilApparentType is an IL type definition. - | ILMethInfo of g: TcGlobals * ilApparentType: TType * ilDeclaringTyconRefOpt: TyconRef option * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of g: TcGlobals * ilApparentType: ILTypeInfo * ilDeclaringTyconRefOpt: TyconRef option * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars member x.TcGlobals = match x with ILMethInfo(g, _, _, _, _) -> g /// Get the apparent declaring type of the method as an F# type. /// If this is a C#-style extension method then this is the type which the method /// appears to extend. This may be a variable type. - member x.ApparentEnclosingType = match x with ILMethInfo(_, ty, _, _, _) -> ty + member x.ApparentEnclosingType = match x with ILMethInfo(_, ty, _, _, _) -> ty.ToType /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member x.ApparentEnclosingAppType = convertToTypeWithMetadataIfPossible x.TcGlobals x.ApparentEnclosingType @@ -558,27 +563,35 @@ type ILMethInfo = /// Does it appear to the user as an instance method? member x.IsInstance = not x.IsConstructor && not x.IsStatic + member x.NullableFallback = + let raw = x.RawMetadata + let classAttrs = + match x.ILExtensionMethodDeclaringTyconRef with + | Some t when t.IsILTycon -> AttributesFromIL(t.ILTyconRawMetadata.MetadataIndex,t.ILTyconRawMetadata.CustomAttrsStored) + | _ -> match x with ILMethInfo(ilApparentType=ilType) -> ilType.NullableAttributes + + FromMethodAndClass(AttributesFromIL(raw.MetadataIndex,raw.CustomAttrsStored),classAttrs) + + member x.GetNullness(p:ILParameter) = {DirectAttributes = AttributesFromIL(p.MetadataIndex,p.CustomAttrsStored); Fallback = x.NullableFallback} + /// Get the argument types of the the IL method. If this is an C#-style extension method /// then drop the object argument. member x.GetParamTypes(amap, m, minst) = - // TODO nullness import + fallback + generics - x.ParamMetadata |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst) + x.ParamMetadata |> List.map (fun p -> ImportParameterTypeFromMetadata amap m (x.GetNullness(p)) p.Type x.MetadataScope x.DeclaringTypeInst minst) /// Get all the argument types of the IL method. Include the object argument even if this is /// an C#-style extension method. member x.GetRawArgTypes(amap, m, minst) = - // TODO nullness import + fallback + generics - x.RawMetadata.Parameters |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst) + x.RawMetadata.Parameters |> List.map (fun p -> ImportParameterTypeFromMetadata amap m (x.GetNullness(p)) p.Type x.MetadataScope x.DeclaringTypeInst minst) /// Get info about the arguments of the IL method. If this is an C#-style extension method then /// drop the object argument. /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamNamesAndTypes(amap, m, minst) = - // TODO nullness import + fallback + generics let scope = x.MetadataScope let tinst = x.DeclaringTypeInst - x.ParamMetadata |> List.map (fun p -> ParamNameAndType(Option.map (mkSynId m) p.Name, ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) scope tinst minst) ) + x.ParamMetadata |> List.map (fun p -> ParamNameAndType(Option.map (mkSynId m) p.Name, ImportParameterTypeFromMetadata amap m (x.GetNullness(p)) p.Type scope tinst minst) ) /// Get a reference to the method (dropping all generic instantiations), as an Abstract IL ILMethodRef. member x.ILMethodRef = @@ -602,13 +615,13 @@ type ILMethInfo = /// Get the (zero or one) 'self'/'this'/'object' arguments associated with an IL method. /// An instance extension method returns one object argument. - member x.GetObjArgTypes(amap, m, minst) = - // TODO nullness import + fallback + generics. ++!!++ a special test for C# defined extension method with nullability on/off on "this" + member x.GetObjArgTypes(amap, m, minst) = // All C#-style extension methods are instance. We have to re-read the 'obj' type w.r.t. the // method instantiation. if x.IsILExtensionMethod then let p = x.RawMetadata.Parameters.Head - [ ImportParameterTypeFromMetadata amap m p.Type (fun _ -> p.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst ] + let nullableSource = {DirectAttributes = AttributesFromIL(p.MetadataIndex,p.CustomAttrsStored); Fallback = x.NullableFallback} + [ ImportParameterTypeFromMetadata amap m nullableSource p.Type x.MetadataScope x.DeclaringTypeInst minst ] else if x.IsInstance then [ x.ApparentEnclosingType ] else @@ -616,12 +629,12 @@ type ILMethInfo = /// Get the compiled return type of the method, where 'void' is None. member x.GetCompiledReturnType (amap, m, minst) = - // TODO nullness import + fallback + generics - ImportReturnTypeFromMetadata amap m x.RawMetadata.Return.Type (fun _ -> x.RawMetadata.Return.CustomAttrs) x.MetadataScope x.DeclaringTypeInst minst + let ilReturn = x.RawMetadata.Return + let nullableSource = {DirectAttributes = AttributesFromIL(ilReturn.MetadataIndex,ilReturn.CustomAttrsStored); Fallback = x.NullableFallback} + ImportReturnTypeFromMetadata amap m nullableSource ilReturn.Type x.MetadataScope x.DeclaringTypeInst minst /// Get the F# view of the return type of the method, where 'void' is 'unit'. - member x.GetFSharpReturnType (amap, m, minst) = - // TODO nullness import + fallback + generics + member x.GetFSharpReturnType (amap, m, minst) = x.GetCompiledReturnType(amap, m, minst) |> GetFSharpViewOfReturnType amap.g @@ -1038,13 +1051,14 @@ type MethInfo = static member CreateILMeth (amap: ImportMap, m, ty: TType, md: ILMethodDef) = let tinfo = ILTypeInfo.FromType amap.g ty let mtps = ImportILGenericParameters (fun () -> amap) m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata md.GenericParams - ILMeth (amap.g, ILMethInfo(amap.g, ty, None, md, mtps), None) + ILMeth (amap.g, ILMethInfo(amap.g, tinfo, None, md, mtps), None) /// Build IL method infos for a C#-style extension method - static member CreateILExtensionMeth (amap, m, apparentTy: TType, declaringTyconRef: TyconRef, extMethPri, md: ILMethodDef) = + static member CreateILExtensionMeth (amap:ImportMap, m, apparentTy: TType, declaringTyconRef: TyconRef, extMethPri, md: ILMethodDef) = let scoref = declaringTyconRef.CompiledRepresentationForNamedType.Scope + let apparentTinfo = ILTypeInfo.FromType amap.g apparentTy let mtps = ImportILGenericParameters (fun () -> amap) m scoref [] md.GenericParams - ILMeth (amap.g, ILMethInfo(amap.g, apparentTy, Some declaringTyconRef, md, mtps), extMethPri) + ILMeth (amap.g, ILMethInfo(amap.g, apparentTinfo, Some declaringTyconRef, md, mtps), extMethPri) /// Tests whether two method infos have the same underlying definition. /// Used to merge operator overloads collected from left and right of an operator constraint. @@ -1075,8 +1089,8 @@ type MethInfo = match x with | ILMeth(_g, ilminfo, pri) -> match ilminfo with - | ILMethInfo(_, ty, None, md, _) -> MethInfo.CreateILMeth(amap, m, instType inst ty, md) - | ILMethInfo(_, ty, Some declaringTyconRef, md, _) -> MethInfo.CreateILExtensionMeth(amap, m, instType inst ty, declaringTyconRef, pri, md) + | ILMethInfo(_, ty, None, md, _) -> MethInfo.CreateILMeth(amap, m, instType inst ty.ToType, md) + | ILMethInfo(_, ty, Some declaringTyconRef, md, _) -> MethInfo.CreateILExtensionMeth(amap, m, instType inst ty.ToType, declaringTyconRef, pri, md) | FSMeth(g, ty, vref, pri) -> FSMeth(g, instType inst ty, vref, pri) | DefaultStructCtor(g, ty) -> DefaultStructCtor(g, instType inst ty) #if !NO_TYPEPROVIDERS @@ -1266,17 +1280,17 @@ type MethInfo = let formalRetTy, formalParams = match x with - | ILMeth(_, ilminfo, _) -> - // TODO nullness for return types and parameters, both possibly generic (i.e. recurse into typars as well) - // Order of data sourcing fallbacks: - // Nullable directly on the return/param - // NullableContext on method - // NullableContext on containing type + | ILMeth(_, ilminfo, _) -> let ftinfo = ILTypeInfo.FromType g (TType_app(tcref, formalEnclosingTyparTys, g.knownWithoutNull)) - let formalRetTy = ImportReturnTypeFromMetadata amap m ilminfo.RawMetadata.Return.Type (fun _ -> ilminfo.RawMetadata.Return.CustomAttrs) ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys + + let ilReturn = ilminfo.RawMetadata.Return + let nullableSource = {DirectAttributes = AttributesFromIL(ilReturn.MetadataIndex,ilReturn.CustomAttrsStored); Fallback = ilminfo.NullableFallback} + + let formalRetTy = ImportReturnTypeFromMetadata amap m nullableSource ilReturn.Type ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys let formalParams = [ [ for p in ilminfo.RawMetadata.Parameters do - let paramTy = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type (fun _ -> p.CustomAttrs) + let nullableSource = {nullableSource with DirectAttributes = AttributesFromIL(p.MetadataIndex,p.CustomAttrsStored)} + let paramTy = ImportILTypeFromMetadataWithAttributes amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys nullableSource p.Type yield TSlotParam(p.Name, paramTy, p.IsIn, p.IsOut, p.IsOptional, []) ] ] formalRetTy, formalParams #if !NO_TYPEPROVIDERS @@ -1474,9 +1488,10 @@ type ILFieldInfo = /// Get the type of the field as an F# type member x.FieldType(amap, m) = - match x with - // TODO nullness import + fallback + generics - | ILFieldInfo (tinfo, fdef) -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] fdef.FieldType + match x with + | ILFieldInfo (tinfo, fdef) -> + let nullness = {DirectAttributes = AttributesFromIL(fdef.MetadataIndex,fdef.CustomAttrsStored); Fallback = tinfo.NullableClassSource} + ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] nullness fdef.FieldType #if !NO_TYPEPROVIDERS | ProvidedField(amap, fi, m) -> ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType), m)) #endif @@ -1611,13 +1626,13 @@ type ILPropInfo = member x.GetterMethod = assert x.HasGetter let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.GetMethod.Value - ILMethInfo(x.TcGlobals, x.ILTypeInfo.ToType, None, mdef, []) + ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) /// Gets the ILMethInfo of the 'set' method for the IL property member x.SetterMethod = assert x.HasSetter let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.SetMethod.Value - ILMethInfo(x.TcGlobals, x.ILTypeInfo.ToType, None, mdef, []) + ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) /// Indicates if the IL property has a 'get' method member x.HasGetter = Option.isSome x.RawMetadata.GetMethod @@ -1649,25 +1664,33 @@ type ILPropInfo = /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamNamesAndTypes(amap, m) = - // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x - pdef.Args |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) ) + if x.HasGetter then + x.GetterMethod.GetParamNamesAndTypes(amap,m,tinfo.TypeInstOfRawMetadata) + else if x.HasSetter then + x.SetterMethod.GetParamNamesAndTypes(amap,m,tinfo.TypeInstOfRawMetadata) + else + pdef.Args |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadataSkipNullness amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) ) /// Get the types of the indexer arguments associated with the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamTypes(amap, m) = - // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x - pdef.Args |> List.map (fun ty -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) + if x.HasGetter then + x.GetterMethod.GetParamTypes(amap,m,tinfo.TypeInstOfRawMetadata) + else if x.HasSetter then + x.SetterMethod.GetParamTypes(amap,m,tinfo.TypeInstOfRawMetadata) + else + pdef.Args |> List.map (fun ty -> ImportILTypeFromMetadataSkipNullness amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) /// Get the return type of the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetPropertyType (amap, m) = - // TODO nullness import + fallback + generics let (ILPropInfo (tinfo, pdef)) = x - ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] pdef.PropertyType + let nullness = {DirectAttributes = AttributesFromIL(pdef.MetadataIndex,pdef.CustomAttrsStored); Fallback = tinfo.NullableClassSource} + ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] nullness pdef.PropertyType override x.ToString() = x.ILTypeInfo.ToString() + "::" + x.PropertyName @@ -1945,8 +1968,7 @@ type PropInfo = /// Get the result type of the property member x.GetPropertyType (amap, m) = - match x with - // TODO nullness import + fallback + generics + match x with | ILProp ilpinfo -> ilpinfo.GetPropertyType (amap, m) | FSProp (g, _, Some vref, _) | FSProp (g, _, _, Some vref) -> @@ -1964,8 +1986,7 @@ type PropInfo = /// /// If the property is in a generic type, then the type parameters are instantiated in the types returned. member x.GetParamNamesAndTypes(amap, m) = - match x with - // TODO nullness import + fallback + generics + match x with | ILProp ilpinfo -> ilpinfo.GetParamNamesAndTypes(amap, m) | FSProp (g, ty, Some vref, _) | FSProp (g, ty, _, Some vref) -> @@ -1982,13 +2003,11 @@ type PropInfo = /// Get the details of the indexer parameters associated with the property member x.GetParamDatas(amap, m) = - // TODO nullness import + fallback + generics x.GetParamNamesAndTypes(amap, m) |> List.map (fun (ParamNameAndType(nmOpt, paramTy)) -> ParamData(false, false, false, NotOptional, NoCallerInfo, nmOpt, ReflectedArgInfo.None, paramTy)) /// Get the types of the indexer parameters associated with the property - member x.GetParamTypes(amap, m) = - // TODO nullness import + fallback + generics + member x.GetParamTypes(amap, m) = x.GetParamNamesAndTypes(amap, m) |> List.map (fun (ParamNameAndType(_, ty)) -> ty) /// Get a MethInfo for the 'getter' method associated with the property @@ -2078,12 +2097,12 @@ type ILEventInfo = /// Get the ILMethInfo describing the 'add' method associated with the event member x.AddMethod = let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.AddMethod - ILMethInfo(x.TcGlobals, x.ILTypeInfo.ToType, None, mdef, []) + ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) /// Get the ILMethInfo describing the 'remove' method associated with the event member x.RemoveMethod = let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.RemoveMethod - ILMethInfo(x.TcGlobals, x.ILTypeInfo.ToType, None, mdef, []) + ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) /// Get the declaring type of the event as an ILTypeRef member x.TypeRef = x.ILTypeInfo.ILTypeRef @@ -2279,10 +2298,10 @@ type EventInfo = match x with | ILEvent(ILEventInfo(tinfo, edef)) -> // Get the delegate type associated with an IL event, taking into account the instantiation of the - // declaring type. - // TODO nullness import + fallback + generics + // declaring type if Option.isNone edef.EventType then error (nonStandardEventError x.EventName m) - ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] edef.EventType.Value + let nullness = {DirectAttributes = AttributesFromIL(edef.MetadataIndex,edef.CustomAttrsStored); Fallback = tinfo.NullableClassSource} + ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] nullness edef.EventType.Value | FSEvent(g, p, _, _) -> FindDelegateTypeOfPropertyEvent g amap x.EventName m (p.GetPropertyType(amap, m)) diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 041c652650a..b8006f5abea 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -183,7 +183,7 @@ type ILTypeInfo = type ILMethInfo = | ILMethInfo of g: TcGlobals * - ilApparentType: TType * + ilApparentType: ILTypeInfo * ilDeclaringTyconRefOpt: TyconRef option * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 3aa8f1cbe5e..084e590838a 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -1149,9 +1149,10 @@ module FSharpExprConvert = // TODO: this will not work for curried methods in F# classes. // This is difficult to solve as the information in the ILMethodRef // is not sufficient to resolve to a symbol unambiguously in these cases. - let argTys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadata cenv.amap m scoref tinst1 tinst2) ] + let argTys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadataSkipNullness cenv.amap m scoref tinst1 tinst2) ] let retTy = - match ImportReturnTypeFromMetadata cenv.amap m ilMethRef.ReturnType (fun _ -> emptyILCustomAttrs) scoref tinst1 tinst2 with + let nullableAttributes = Import.Nullness.NullableAttributesSource.Empty + match ImportReturnTypeFromMetadata cenv.amap m nullableAttributes ilMethRef.ReturnType scoref tinst1 tinst2 with | None -> if isCtor then enclosingTy else g.unit_ty | Some ty -> ty diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 04052291cb1..cab59a529ab 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -255,17 +255,26 @@ let combineNullness (nullnessOrig: Nullness) (nullnessNew: Nullness) = let tryAddNullnessToTy nullnessNew (ty:TType) = match ty with | TType_var (tp, nullnessOrig) -> - // TODO NULLNESS: make this avoid allocation if no change - Some (TType_var (tp, combineNullness nullnessOrig nullnessNew)) + let nullnessAfter = combineNullness nullnessOrig nullnessNew + if nullnessAfter = nullnessOrig then + Some ty + else + Some (TType_var (tp, nullnessAfter)) | TType_app (tcr, tinst, nullnessOrig) -> - // TODO NULLNESS: make this avoid allocation if no change - Some (TType_app (tcr, tinst, combineNullness nullnessOrig nullnessNew)) + let nullnessAfter = combineNullness nullnessOrig nullnessNew + if nullnessAfter = nullnessOrig then + Some ty + else + Some (TType_app (tcr, tinst, nullnessAfter)) | TType_ucase _ -> None // TODO NULLNESS | TType_tuple _ -> None // TODO NULLNESS | TType_anon _ -> None // TODO NULLNESS | TType_fun (d, r, nullnessOrig) -> - // TODO NULLNESS: make this avoid allocation if no change - Some (TType_fun (d, r, combineNullness nullnessOrig nullnessNew)) + let nullnessAfter = combineNullness nullnessOrig nullnessNew + if nullnessAfter = nullnessOrig then + Some ty + else + Some (TType_fun (d, r, nullnessAfter)) | TType_forall _ -> None | TType_measure _ -> None diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs index 3a7ad7aa9dd..436bea3d584 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -12,9 +12,9 @@ let ``Consumption of nullable C# - no generics, just strings`` () = namespace Nullables { public class NullableClass { // Fields with nullable type - public static string NullableField; + public static string NotNullField; // Fields with non-nullable type - public static string? NonNullableField; + public static string? MaybeNullField; // Methods which return nullable string public static string? ReturnsNullableStringNoParams() { return null; } public static string? ReturnsNullableString1NullableParam(string? _) { return null; } @@ -37,12 +37,34 @@ let ``Consumption of nullable C# - no generics, just strings`` () = module FSNullable open Nullables - let nullablestrNoParams : string = NullableClass.ReturnsNullableStringNoParams() - let nonNullableStrNoParams : string | null = NullableClass.ReturnsNonNullableStringNoParams() // Here we don't expect any warning. + let nullablestrNoParams : string = NullableClass.ReturnsNullableStringNoParams() // Error here, line 5 + let nonNullableStrNoParams : string | null = NullableClass.ReturnsNonNullableStringNoParams() let nullablestrNoParamsCorrectlyAnnotated : string | null = NullableClass.ReturnsNullableStringNoParams() let nonNullableStrNoParamsCorrectlyAnnotated : string = NullableClass.ReturnsNonNullableStringNoParams() - let nullableField : string = NullableClass.NullableField - let nonNullableField : string | null = NullableClass.NonNullableField + let notNullField : string = NullableClass.NotNullField + let maybeNullField : string | null = NullableClass.MaybeNullField + let maybeNullField2 : string | null = NullableClass.NotNullField + + + let notNullField2 : string = NullableClass.MaybeNullField // Error here, line 14 + NullableClass.MaybeNullField <- null + NullableClass.NotNullField <- null // Error here, line 16 + + let notNullArg : string = "hello" + let maybeNullArg : string | null = "there" + + let nullableParamOk1 = NullableClass.ReturnsNullableString1NullableParam(notNullArg) + let nullableParamOk2 = NullableClass.ReturnsNullableString1NullableParam(maybeNullArg) + + let nonNullParamCallPass = NullableClass.ReturnsNullableString1NonNullableParam(notNullArg) + let nonNullParamCallFail = NullableClass.ReturnsNullableString1NonNullableParam(maybeNullArg) // Error here, 25 + + let mixedParams1 = NullableClass.ReturnsNullableString1Nullable1NonNullableParam(notNullArg,notNullArg) + let mixedParams2 = NullableClass.ReturnsNullableString1Nullable1NonNullableParam(maybeNullArg,maybeNullArg) // Error here, 28 + let mixedParams3 = NullableClass.ReturnsNullableString1Nullable1NonNullableParam(maybeNullArg,notNullArg) + let mixedParams4 = NullableClass.ReturnsNullableString1Nullable1NonNullableParam(notNullArg,maybeNullArg) // Error here, 30 + + """ |> asLibrary |> withLangVersionPreview @@ -51,7 +73,11 @@ let ``Consumption of nullable C# - no generics, just strings`` () = |> compile |> shouldFail |> withDiagnostics [ - // TODO NULLNESS: makes sure that both of these are expected. - Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string __withnull' do not have compatible nullability."; - Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string __withnull' do not have equivalent nullability." - ] + Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability." + Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Warning 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Warning 3261, Line 16, Col 35, Line 16, Col 39, "Nullness warning: The type 'string' does not support 'null'." + Warning 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Warning 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Warning 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + From 469e10bdae9eb1a4511d144174b0147b8b21aa97 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Dec 2023 15:39:35 +0100 Subject: [PATCH 11/48] test rename --- .../Language/NullableCsharpImportTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs index 436bea3d584..78984796666 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -5,7 +5,7 @@ open Xunit open FSharp.Test.Compiler [] -let ``Consumption of nullable C# - no generics, just strings`` () = +let ``Consumption of nullable C# - no generics, just strings in methods and fields`` () = let csharpLib = CSharp """ #nullable enable From db1bfac0e22378508797d2b1eecb8c570355fbb0 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Dec 2023 15:40:21 +0100 Subject: [PATCH 12/48] fantomas --- src/Compiler/AbstractIL/il.fsi | 5 ++-- src/Compiler/Checking/TypeHierarchy.fsi | 15 ++++++++--- src/Compiler/Checking/import.fsi | 34 +++++++++++++++---------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index db9f878f994..e0c18d435b0 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -868,12 +868,13 @@ type ILAttributes = /// Represents the efficiency-oriented storage of ILAttributes in another item. [] -type ILAttributesStored = +type ILAttributesStored = /// Computed by ilread.fs based on metadata index | Reader of (int32 -> ILAttribute[]) /// Already computed | Given of ILAttributes - member GetCustomAttrs: int32 -> ILAttributes + + member GetCustomAttrs: int32 -> ILAttributes /// Method parameters and return values. [] diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index ff41ef6760a..8633f9827f9 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -117,7 +117,14 @@ val ExistsHeadTypeInEntireHierarchy: /// Read an Abstract IL type from metadata and convert to an F# type. val ImportILTypeFromMetadata: - amap: ImportMap -> m: range -> scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> TType + amap: ImportMap -> + m: range -> + scoref: ILScopeRef -> + tinst: TType list -> + minst: TType list -> + nullnessSource: Nullness.NullableAttributesSource -> + ilTy: ILType -> + TType /// Read an Abstract IL type from metadata and convert to an F# type, ignoring nullness checking. val ImportILTypeFromMetadataSkipNullness: @@ -130,7 +137,7 @@ val ImportILTypeFromMetadataWithAttributes: scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> - nullnessSource:Nullness.NullableAttributesSource -> + nullnessSource: Nullness.NullableAttributesSource -> ilTy: ILType -> TType @@ -138,7 +145,7 @@ val ImportILTypeFromMetadataWithAttributes: val ImportParameterTypeFromMetadata: amap: ImportMap -> m: range -> - nullnessSource:Nullness.NullableAttributesSource -> + nullnessSource: Nullness.NullableAttributesSource -> ilTy: ILType -> scoref: ILScopeRef -> tinst: TType list -> @@ -150,7 +157,7 @@ val ImportParameterTypeFromMetadata: val ImportReturnTypeFromMetadata: amap: ImportMap -> m: range -> - nullnessSource:Nullness.NullableAttributesSource -> + nullnessSource: Nullness.NullableAttributesSource -> ilTy: ILType -> scoref: ILScopeRef -> tinst: TType list -> diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index c7467770268..5316c1b0e99 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -98,24 +98,25 @@ val internal ImportILAssembly: val internal ImportILAssemblyTypeForwarders: (unit -> ImportMap) * range * ILExportedTypesAndForwarders -> CcuTypeForwarderTable -module Nullness = +module Nullness = - [] - type AttributesFromIL = AttributesFromIL of metadataIndex:int * attrs:ILAttributesStored - with - member Read: unit -> ILAttributes + [] + type AttributesFromIL = + | AttributesFromIL of metadataIndex: int * attrs: ILAttributesStored - [] - type NullableContextSource = + member Read: unit -> ILAttributes + + [] + type NullableContextSource = | FromClass of AttributesFromIL - | FromMethodAndClass of methodAttrs:AttributesFromIL * classAttrs:AttributesFromIL + | FromMethodAndClass of methodAttrs: AttributesFromIL * classAttrs: AttributesFromIL - [] + [] type NullableAttributesSource = { DirectAttributes: AttributesFromIL - Fallback : NullableContextSource} - with - static member Empty : NullableAttributesSource + Fallback: NullableContextSource } + + static member Empty: NullableAttributesSource /// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly /// being compiled. importInst gives the context for interpreting type variables. @@ -123,10 +124,15 @@ module Nullness = val RescopeAndImportILTypeSkipNullness: scoref: ILScopeRef -> amap: ImportMap -> m: range -> importInst: TType list -> ilTy: ILType -> TType - /// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly /// being compiled. importInst gives the context for interpreting type variables. val RescopeAndImportILType: - scoref: ILScopeRef -> amap: ImportMap -> m: range -> importInst: TType list -> nullnessSource:Nullness.NullableAttributesSource -> ilTy: ILType -> TType + scoref: ILScopeRef -> + amap: ImportMap -> + m: range -> + importInst: TType list -> + nullnessSource: Nullness.NullableAttributesSource -> + ilTy: ILType -> + TType val CanRescopeAndImportILType: scoref: ILScopeRef -> amap: ImportMap -> m: range -> ilTy: ILType -> bool From 94e02aaa6f095deaf3bdebe43806d6daa1f23b79 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 12 Dec 2023 18:58:30 +0100 Subject: [PATCH 13/48] get stack trace on error --- src/Compiler/Checking/infos.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 7ff0d3810a4..2e258ada378 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -468,7 +468,7 @@ type ILTypeInfo = let tref = mkRefForNestedILTypeDef scoref (enc, tdef) ILTypeInfo(g, ty, tref, tdef) else - failwith "ILTypeInfo.FromType - no IL metadata for type" + failwith ("ILTypeInfo.FromType - no IL metadata for type" + System.Environment.StackTrace) /// Describes an F# use of an IL method. [] From 4d2f36f23e2609fe2ae68e1ce94dbefb0fcdb854 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Dec 2023 12:07:25 +0100 Subject: [PATCH 14/48] split ilmethod's type --- src/Compiler/Checking/AccessibilityLogic.fs | 2 +- src/Compiler/Checking/infos.fs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/AccessibilityLogic.fs b/src/Compiler/Checking/AccessibilityLogic.fs index 7e93b5c07a9..c20f7817386 100644 --- a/src/Compiler/Checking/AccessibilityLogic.fs +++ b/src/Compiler/Checking/AccessibilityLogic.fs @@ -243,7 +243,7 @@ let IsILEventInfoAccessible g amap m ad einfo = let private IsILMethInfoAccessible g amap m adType ad ilminfo = match ilminfo with - | ILMethInfo (_, ty, None, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad (ILTypeInfo.FromType g ty.ToType) mdef.Access + | ILMethInfo (_, ty, None, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad ty mdef.Access | ILMethInfo (_, _, Some declaringTyconRef, mdef, _) -> IsILMemberAccessible g amap m declaringTyconRef ad mdef.Access let GetILAccessOfILPropInfo (ILPropInfo(tinfo, pdef)) = diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 2e258ada378..37789908eba 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -470,6 +470,11 @@ type ILTypeInfo = else failwith ("ILTypeInfo.FromType - no IL metadata for type" + System.Environment.StackTrace) +[] +type ILMethodType = + | IlType of ILTypeInfo + | CsExtension of declaring:TyconRef * apparent:TType + /// Describes an F# use of an IL method. [] type ILMethInfo = From e186b6a9cdf7192fd8a8319f6bb96cb631632043 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 13 Dec 2023 12:33:39 +0100 Subject: [PATCH 15/48] fix crashes for Csharp style extensions --- src/Compiler/Checking/AccessibilityLogic.fs | 4 +- src/Compiler/Checking/InfoReader.fs | 2 +- src/Compiler/Checking/NicePrint.fs | 10 ++-- src/Compiler/Checking/infos.fs | 55 +++++++++++++-------- src/Compiler/Checking/infos.fsi | 14 +++--- 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/src/Compiler/Checking/AccessibilityLogic.fs b/src/Compiler/Checking/AccessibilityLogic.fs index c20f7817386..052befa7a0c 100644 --- a/src/Compiler/Checking/AccessibilityLogic.fs +++ b/src/Compiler/Checking/AccessibilityLogic.fs @@ -243,8 +243,8 @@ let IsILEventInfoAccessible g amap m ad einfo = let private IsILMethInfoAccessible g amap m adType ad ilminfo = match ilminfo with - | ILMethInfo (_, ty, None, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad ty mdef.Access - | ILMethInfo (_, _, Some declaringTyconRef, mdef, _) -> IsILMemberAccessible g amap m declaringTyconRef ad mdef.Access + | ILMethInfo (_, IlType ty, mdef, _) -> IsILTypeAndMemberAccessible g amap m adType ad ty mdef.Access + | ILMethInfo (_, CSharpStyleExtension(declaring=declaringTyconRef), mdef, _) -> IsILMemberAccessible g amap m declaringTyconRef ad mdef.Access let GetILAccessOfILPropInfo (ILPropInfo(tinfo, pdef)) = let tdef = tinfo.RawMetadata diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index e917dbd6d8b..c006dc916cf 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -1142,7 +1142,7 @@ let GetXmlDocSigOfMethInfo (infoReader: InfoReader) m (minfo: MethInfo) = match TryFindMetadataInfoOfExternalEntityRef infoReader m ilminfo.DeclaringTyconRef with | None -> None | Some (ccuFileName, formalTypars, formalTypeInfo) -> - let filminfo = ILMethInfo(g, formalTypeInfo, None, ilminfo.RawMetadata, fmtps) + let filminfo = ILMethInfo(g, IlType formalTypeInfo, ilminfo.RawMetadata, fmtps) let args = if ilminfo.IsILExtensionMethod then filminfo.GetRawArgTypes(amap, m, minfo.FormalMethodInst) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 0bfd1f3dba2..718fcc7610c 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -1646,14 +1646,14 @@ module InfoMemberPrinting = // Prettify an ILMethInfo let prettifyILMethInfo (amap: Import.ImportMap) m (minfo: MethInfo) typarInst ilMethInfo = - let (ILMethInfo(_, apparentTy, dty, mdef, _)) = ilMethInfo - let (prettyTyparInst, prettyTys), _ = PrettyTypes.PrettifyInstAndTypes amap.g (typarInst, (apparentTy.ToType :: minfo.FormalMethodInst)) + let (ILMethInfo(_, methodsType, mdef, _)) = ilMethInfo + let (prettyTyparInst, prettyTys), _ = PrettyTypes.PrettifyInstAndTypes amap.g (typarInst, (methodsType.ToType :: minfo.FormalMethodInst)) match prettyTys with | prettyApparentTy :: prettyFormalMethInst -> let prettyMethInfo = - match dty with - | None -> MethInfo.CreateILMeth (amap, m, prettyApparentTy, mdef) - | Some declaringTyconRef -> MethInfo.CreateILExtensionMeth(amap, m, prettyApparentTy, declaringTyconRef, minfo.ExtensionMemberPriorityOption, mdef) + match methodsType with + | IlType _ -> MethInfo.CreateILMeth (amap, m, prettyApparentTy, mdef) + | CSharpStyleExtension(declaring=declaringTyconRef) -> MethInfo.CreateILExtensionMeth(amap, m, prettyApparentTy, declaringTyconRef, minfo.ExtensionMemberPriorityOption, mdef) prettyTyparInst, prettyMethInfo, prettyFormalMethInst | _ -> failwith "prettifyILMethInfo - prettyTys empty" diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 37789908eba..c1583d3f20a 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -471,9 +471,14 @@ type ILTypeInfo = failwith ("ILTypeInfo.FromType - no IL metadata for type" + System.Environment.StackTrace) [] -type ILMethodType = +type ILMethodsType = | IlType of ILTypeInfo - | CsExtension of declaring:TyconRef * apparent:TType + | CSharpStyleExtension of declaring:TyconRef * apparent:TType + + member x.ToType = + match x with + | IlType x -> x.ToType + | CSharpStyleExtension(apparent=x) -> x /// Describes an F# use of an IL method. [] @@ -482,32 +487,38 @@ type ILMethInfo = /// /// If ilDeclaringTyconRefOpt is 'Some' then this is an F# use of an C#-style extension method. /// If ilDeclaringTyconRefOpt is 'None' then ilApparentType is an IL type definition. - | ILMethInfo of g: TcGlobals * ilApparentType: ILTypeInfo * ilDeclaringTyconRefOpt: TyconRef option * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of g: TcGlobals * ilType:ILMethodsType * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars - member x.TcGlobals = match x with ILMethInfo(g, _, _, _, _) -> g + member x.TcGlobals = match x with ILMethInfo(g, _, _, _) -> g /// Get the apparent declaring type of the method as an F# type. /// If this is a C#-style extension method then this is the type which the method /// appears to extend. This may be a variable type. - member x.ApparentEnclosingType = match x with ILMethInfo(_, ty, _, _, _) -> ty.ToType + member x.ApparentEnclosingType = match x with ILMethInfo(_, ty, _, _) -> ty.ToType /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member x.ApparentEnclosingAppType = convertToTypeWithMetadataIfPossible x.TcGlobals x.ApparentEnclosingType /// Get the declaring type associated with an extension member, if any. - member x.ILExtensionMethodDeclaringTyconRef = match x with ILMethInfo(_, _, tcrefOpt, _, _) -> tcrefOpt + member x.ILExtensionMethodDeclaringTyconRef = + match x with + | ILMethInfo(ilType=CSharpStyleExtension(declaring= x)) -> Some x + | _ -> None /// Get the Abstract IL metadata associated with the method. - member x.RawMetadata = match x with ILMethInfo(_, _, _, md, _) -> md + member x.RawMetadata = match x with ILMethInfo(_, _, md, _) -> md /// Get the formal method type parameters associated with a method. - member x.FormalMethodTypars = match x with ILMethInfo(_, _, _, _, fmtps) -> fmtps + member x.FormalMethodTypars = match x with ILMethInfo(_, _, _, fmtps) -> fmtps /// Get the IL name of the method member x.ILName = x.RawMetadata.Name /// Indicates if the method is an extension method - member x.IsILExtensionMethod = x.ILExtensionMethodDeclaringTyconRef.IsSome + member x.IsILExtensionMethod = + match x with + | ILMethInfo(ilType=CSharpStyleExtension _) -> true + | _ -> false /// Get the declaring type of the method. If this is an C#-style extension method then this is the IL type /// holding the static member that is the extension method. @@ -571,9 +582,11 @@ type ILMethInfo = member x.NullableFallback = let raw = x.RawMetadata let classAttrs = - match x.ILExtensionMethodDeclaringTyconRef with - | Some t when t.IsILTycon -> AttributesFromIL(t.ILTyconRawMetadata.MetadataIndex,t.ILTyconRawMetadata.CustomAttrsStored) - | _ -> match x with ILMethInfo(ilApparentType=ilType) -> ilType.NullableAttributes + match x with + | ILMethInfo(ilType=CSharpStyleExtension(declaring= t)) when t.IsILTycon -> AttributesFromIL(t.ILTyconRawMetadata.MetadataIndex,t.ILTyconRawMetadata.CustomAttrsStored) + // C#-style extension defined in F# -> we do not support manually adding NullableContextAttribute by F# users. + | ILMethInfo(ilType=CSharpStyleExtension _) -> AttributesFromIL(0,Given(ILAttributes.Empty)) + | ILMethInfo(ilType=IlType(t)) -> t.NullableAttributes FromMethodAndClass(AttributesFromIL(raw.MetadataIndex,raw.CustomAttrsStored),classAttrs) @@ -1065,14 +1078,14 @@ type MethInfo = static member CreateILMeth (amap: ImportMap, m, ty: TType, md: ILMethodDef) = let tinfo = ILTypeInfo.FromType amap.g ty let mtps = ImportILGenericParameters (fun () -> amap) m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata md.GenericParams - ILMeth (amap.g, ILMethInfo(amap.g, tinfo, None, md, mtps), None) + ILMeth (amap.g, ILMethInfo(amap.g, IlType tinfo, md, mtps), None) /// Build IL method infos for a C#-style extension method static member CreateILExtensionMeth (amap:ImportMap, m, apparentTy: TType, declaringTyconRef: TyconRef, extMethPri, md: ILMethodDef) = let scoref = declaringTyconRef.CompiledRepresentationForNamedType.Scope - let apparentTinfo = ILTypeInfo.FromType amap.g apparentTy + let typeInfo = CSharpStyleExtension(declaringTyconRef,apparentTy) let mtps = ImportILGenericParameters (fun () -> amap) m scoref [] md.GenericParams - ILMeth (amap.g, ILMethInfo(amap.g, apparentTinfo, Some declaringTyconRef, md, mtps), extMethPri) + ILMeth (amap.g, ILMethInfo(amap.g, typeInfo, md, mtps), extMethPri) /// Tests whether two method infos have the same underlying definition. /// Used to merge operator overloads collected from left and right of an operator constraint. @@ -1103,8 +1116,8 @@ type MethInfo = match x with | ILMeth(_g, ilminfo, pri) -> match ilminfo with - | ILMethInfo(_, ty, None, md, _) -> MethInfo.CreateILMeth(amap, m, instType inst ty.ToType, md) - | ILMethInfo(_, ty, Some declaringTyconRef, md, _) -> MethInfo.CreateILExtensionMeth(amap, m, instType inst ty.ToType, declaringTyconRef, pri, md) + | ILMethInfo(_, IlType ty, md, _) -> MethInfo.CreateILMeth(amap, m, instType inst ty.ToType, md) + | ILMethInfo(_, CSharpStyleExtension(declaringTyconRef,ty), md, _) -> MethInfo.CreateILExtensionMeth(amap, m, instType inst ty, declaringTyconRef, pri, md) | FSMeth(g, ty, vref, pri) -> FSMeth(g, instType inst ty, vref, pri) | DefaultStructCtor(g, ty) -> DefaultStructCtor(g, instType inst ty) #if !NO_TYPEPROVIDERS @@ -1640,13 +1653,13 @@ type ILPropInfo = member x.GetterMethod = assert x.HasGetter let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.GetMethod.Value - ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) + ILMethInfo(x.TcGlobals, IlType x.ILTypeInfo, mdef, []) /// Gets the ILMethInfo of the 'set' method for the IL property member x.SetterMethod = assert x.HasSetter let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.SetMethod.Value - ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) + ILMethInfo(x.TcGlobals, IlType x.ILTypeInfo, mdef, []) /// Indicates if the IL property has a 'get' method member x.HasGetter = Option.isSome x.RawMetadata.GetMethod @@ -2116,12 +2129,12 @@ type ILEventInfo = /// Get the ILMethInfo describing the 'add' method associated with the event member x.AddMethod = let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.AddMethod - ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) + ILMethInfo(x.TcGlobals, IlType x.ILTypeInfo, mdef, []) /// Get the ILMethInfo describing the 'remove' method associated with the event member x.RemoveMethod = let mdef = resolveILMethodRef x.ILTypeInfo.RawMetadata x.RawMetadata.RemoveMethod - ILMethInfo(x.TcGlobals, x.ILTypeInfo, None, mdef, []) + ILMethInfo(x.TcGlobals, IlType x.ILTypeInfo, mdef, []) /// Get the declaring type of the event as an ILTypeRef member x.TypeRef = x.ILTypeInfo.ILTypeRef diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 57e27ae9233..65374fb655b 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -178,15 +178,17 @@ type ILTypeInfo = member TypeInstOfRawMetadata: TypeInst +[] +type ILMethodsType = + | IlType of ILTypeInfo + | CSharpStyleExtension of declaring: TyconRef * apparent: TType + + member ToType: TType + /// Describes an F# use of an IL method. [] type ILMethInfo = - | ILMethInfo of - g: TcGlobals * - ilApparentType: ILTypeInfo * - ilDeclaringTyconRefOpt: TyconRef option * - ilMethodDef: ILMethodDef * - ilGenericMethodTyArgs: Typars + | ILMethInfo of g: TcGlobals * ilType: ILMethodsType * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member ApparentEnclosingAppType: TType From d084a93fad92e79e00ac20a322e3fc7cc6e4cecc Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 10:27:52 +0100 Subject: [PATCH 16/48] solve coexistance of nullness and Is* properties of DUs --- src/Compiler/CodeGen/EraseUnions.fs | 6 +++--- src/Compiler/CodeGen/IlxGen.fs | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index e3679a39020..97358a54091 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -872,11 +872,11 @@ let convAlternativeDef let baseTesterMeths, baseTesterProps = if - g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible - && cud.HasHelpers = AllHelpers + (* g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible && + cud.HasHelpers = AllHelpers then [], [] - elif cud.UnionCases.Length <= 1 then + elif *) cud.UnionCases.Length <= 1 then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 1f331c30987..ebb20080349 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -10731,6 +10731,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = else ILTypeDefKind.Class | TFSharpClass -> ILTypeDefKind.Class + | TFSharpStruct -> ILTypeDefKind.ValueType | TFSharpInterface -> ILTypeDefKind.Interface | TFSharpEnum -> ILTypeDefKind.Enum @@ -11414,19 +11415,22 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = // private static field for lists etc. // // Also discard the F#-compiler supplied implementation of the Empty, IsEmpty, Value and None properties. + let tdefDiscards = Some( (fun (md: ILMethodDef) -> (cuinfo.HasHelpers = SpecialFSharpListHelpers && (md.Name = "get_Empty" || md.Name = "Cons" || md.Name = "get_IsEmpty")) || (cuinfo.HasHelpers = SpecialFSharpOptionHelpers - && (md.Name = "get_Value" || md.Name = "get_None" || md.Name = "Some"))), + && (md.Name = "get_Value" || md.Name = "get_None" || md.Name = "Some")) + || (cuinfo.HasHelpers = AllHelpers && (md.Name.StartsWith("get_Is") && not (tdef2.Methods.FindByName(md.Name).IsEmpty)))), (fun (pd: ILPropertyDef) -> (cuinfo.HasHelpers = SpecialFSharpListHelpers && (pd.Name = "Empty" || pd.Name = "IsEmpty")) || (cuinfo.HasHelpers = SpecialFSharpOptionHelpers - && (pd.Name = "Value" || pd.Name = "None"))) + && (pd.Name = "Value" || pd.Name = "None")) + || (cuinfo.HasHelpers = AllHelpers && (pd.Name.StartsWith("Is") && not (tdef2.Properties.LookupByName(pd.Name).IsEmpty)))) ) tdef2, tdefDiscards From 83816596643bb879544a05a1146663c50f6a13d2 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 11:26:59 +0100 Subject: [PATCH 17/48] updating tests --- .../EmittedIL/Nullness/GenericStructDu.fs | 11 + .../Nullness/GenericStructDu.fs.il.net472.bsl | 644 ++++++++++++++++++ .../GenericStructDu.fs.il.netcore.bsl | 415 +++++++++++ .../EmittedIL/Nullness/NullAsTrueValue.fs | 12 +- .../Nullness/NullAsTrueValue.fs.il.net472.bsl | 484 ++++++++----- .../NullAsTrueValue.fs.il.netcore.bsl | 191 +++++- .../EmittedIL/Nullness/NullnessMetadata.fs | 5 + 7 files changed, 1535 insertions(+), 227 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.net472.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.netcore.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs new file mode 100644 index 00000000000..cf72987cafb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs @@ -0,0 +1,11 @@ +module TestModule + +[] +type MyStructOption<'T when 'T: not null> = + | MyStructNone + | MyStructSome of nestedGenericField : list> * notNullField2 : string * canBeNullField : (string | null) * notNullField1 : 'T + +let mapStructContents f myOpt = + match myOpt with + | MyStructNone -> MyStructNone + | MyStructSome(ngf,s,ns,x) -> MyStructSome (ngf,s,ns,f x) \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.net472.bsl new file mode 100644 index 00000000000..97f43391f53 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.net472.bsl @@ -0,0 +1,644 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.dll + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TestModule + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .class sequential autochar serializable sealed nested public beforefieldinit MyStructOption`1 + extends [runtime]System.ValueType + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param type T + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .class abstract auto ansi sealed nested public Tags + extends [runtime]System.Object + { + .param type T + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .field public static literal int32 MyStructNone = int32(0x00000000) + .field public static literal int32 MyStructSome = int32(0x00000001) + } + + .field assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly string _notNullField2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly string _canBeNullField + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly !T _notNullField1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly int32 _tag + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static valuetype TestModule/MyStructOption`1 + get_MyStructNone() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 ) + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: newobj instance void valuetype TestModule/MyStructOption`1::.ctor(int32) + IL_0006: ret + } + + .method public hidebysig instance bool + get_IsMyStructNone() 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 + IL_0001: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0006: ldc.i4.0 + IL_0007: ceq + IL_0009: ret + } + + .method public static valuetype TestModule/MyStructOption`1 + NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField, + string _notNullField2, + string _canBeNullField, + !T _notNullField1) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 01 00 00 00 00 00 ) + .param [1] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 01 01 02 00 00 ) + .param [3] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 5 + .locals init (valuetype TestModule/MyStructOption`1 V_0) + IL_0000: ldloca.s V_0 + IL_0002: initobj valuetype TestModule/MyStructOption`1 + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0010: ldloca.s V_0 + IL_0012: ldarg.0 + IL_0013: stfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0018: ldloca.s V_0 + IL_001a: ldarg.1 + IL_001b: stfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0020: ldloca.s V_0 + IL_0022: ldarg.2 + IL_0023: stfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_0028: ldloca.s V_0 + IL_002a: ldarg.3 + IL_002b: stfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_0030: ldloc.0 + IL_0031: ret + } + + .method public hidebysig instance bool + get_IsMyStructSome() cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, + string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 + 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 + 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C + 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 + 31 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: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0006: ldc.i4.1 + IL_0007: ceq + IL_0009: ret + } + + .method assembly specialname rtspecialname + instance void .ctor(int32 _tag) cil managed + { + .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 1B 54 65 73 74 4D 6F 64 75 6C + 65 2B 4D 79 53 74 72 75 63 74 4F 70 74 69 6F 6E + 60 31 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: stfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0007: ret + } + + .method public hidebysig instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + get_nestedGenericField() 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 ) + .param [0] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0006: ret + } + + .method public hidebysig instance string + get_notNullField2() 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 ) + .param [0] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0006: ret + } + + .method public hidebysig instance string + get_canBeNullField() 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 ) + .param [0] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_0006: ret + } + + .method public hidebysig instance !T + get_notNullField1() 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 ) + .param [0] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_0006: ret + } + + .method public hidebysig instance int32 + get_Tag() 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 + IL_0001: ldfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0006: ret + } + + .method assembly hidebysig specialname + instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: ldobj valuetype TestModule/MyStructOption`1 + IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) + IL_001a: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,valuetype TestModule/MyStructOption`1>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: ldobj valuetype TestModule/MyStructOption`1 + IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) + IL_001a: ret + } + + .property instance int32 Tag() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 TestModule/MyStructOption`1::get_Tag() + } + .property valuetype TestModule/MyStructOption`1 + MyStructNone() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get valuetype TestModule/MyStructOption`1 TestModule/MyStructOption`1::get_MyStructNone() + } + .property instance bool IsMyStructNone() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance bool TestModule/MyStructOption`1::get_IsMyStructNone() + } + .property instance bool IsMyStructSome() + { + .custom instance void System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, + string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 + 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 + 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C + 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 + 31 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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance bool TestModule/MyStructOption`1::get_IsMyStructSome() + } + .property instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + nestedGenericField() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 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 ) + .get instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> TestModule/MyStructOption`1::get_nestedGenericField() + } + .property instance string notNullField2() + { + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 01 00 00 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 ) + .get instance string TestModule/MyStructOption`1::get_notNullField2() + } + .property instance string canBeNullField() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 02 00 00 00 00 00 ) + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 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 ) + .get instance string TestModule/MyStructOption`1::get_canBeNullField() + } + .property instance !T notNullField1() + { + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 03 00 00 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 ) + .get instance !T TestModule/MyStructOption`1::get_notNullField1() + } + } + + .method public static valuetype TestModule/MyStructOption`1 + mapStructContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + valuetype TestModule/MyStructOption`1 myOpt) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param type b + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param [0] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + .param [2] + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + + .maxstack 7 + .locals init (valuetype TestModule/MyStructOption`1 V_0, + !!a V_1, + string V_2, + string V_3, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0009: ldc.i4.1 + IL_000a: bne.un.s IL_000e + + IL_000c: br.s IL_0014 + + IL_000e: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::get_MyStructNone() + IL_0013: ret + + IL_0014: ldloca.s V_0 + IL_0016: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_001b: stloc.1 + IL_001c: ldloca.s V_0 + IL_001e: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0023: stloc.2 + IL_0024: ldloca.s V_0 + IL_0026: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_002b: stloc.3 + IL_002c: ldloca.s V_0 + IL_002e: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0033: stloc.s V_4 + IL_0035: ldloc.s V_4 + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: ldarg.0 + IL_003a: ldloc.1 + IL_003b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0040: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, + string, + string, + !0) + IL_0045: ret + } + +} + +.class private abstract auto ansi sealed ''.$TestModule + extends [runtime]System.Object +{ +} + +.class private auto ansi serializable sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.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 ) + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .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 ) + .field private class [runtime]System.Type Type@ + .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 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() 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 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() 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 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { + .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 ) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { + .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 ) + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private bool ReturnValue@ + .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 ) + .field private string[] Members@ + .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 ) + .method public specialname rtspecialname + instance void .ctor(bool ReturnValue, + string[] Members) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::ReturnValue@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::Members@ + IL_0014: ret + } + + .method public hidebysig specialname instance string[] + get_Members() 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 + IL_0001: ldfld string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::Members@ + IL_0006: ret + } + + .method public hidebysig specialname instance bool + get_ReturnValue() 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 + IL_0001: ldfld bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::ReturnValue@ + IL_0006: ret + } + + .property instance bool ReturnValue() + { + .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 ) + .get instance bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::get_ReturnValue() + } + .property instance string[] Members() + { + .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 ) + .get instance string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::get_Members() + } +} + +.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public uint8[] NullableFlags + .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 ) + .method public specialname rtspecialname + instance void .ctor(uint8 scalarByteValue) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldc.i4.1 + IL_0008: newarr [runtime]System.Byte + IL_000d: dup + IL_000e: ldc.i4.0 + IL_000f: ldarg.1 + IL_0010: stelem.i1 + IL_0011: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags + IL_0016: ret + } + + .method public specialname rtspecialname + instance void .ctor(uint8[] NullableFlags) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags + IL_000d: ret + } + +} + +.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableContextAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public uint8 Flag + .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 ) + .method public specialname rtspecialname + instance void .ctor(uint8 Flag) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld uint8 System.Runtime.CompilerServices.NullableContextAttribute::Flag + IL_000d: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.netcore.bsl new file mode 100644 index 00000000000..74b8ce8a49f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/GenericStructDu.fs.il.netcore.bsl @@ -0,0 +1,415 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.dll + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TestModule + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .class sequential autochar serializable sealed nested public beforefieldinit MyStructOption`1 + extends [runtime]System.ValueType + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C + 61 79 28 29 2C 6E 71 7D 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param type T + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .class abstract auto ansi sealed nested public Tags + extends [runtime]System.Object + { + .param type T + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .field public static literal int32 MyStructNone = int32(0x00000000) + .field public static literal int32 MyStructSome = int32(0x00000001) + } + + .field assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly string _notNullField2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly string _canBeNullField + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly !T _notNullField1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .field assembly int32 _tag + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) + .method public static valuetype TestModule/MyStructOption`1 + get_MyStructNone() cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 ) + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: newobj instance void valuetype TestModule/MyStructOption`1::.ctor(int32) + IL_0006: ret + } + + .method public hidebysig instance bool + get_IsMyStructNone() 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 + IL_0001: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0006: ldc.i4.0 + IL_0007: ceq + IL_0009: ret + } + + .method public static valuetype TestModule/MyStructOption`1 + NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField, + string _notNullField2, + string _canBeNullField, + !T _notNullField1) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32) = ( 01 00 08 00 00 00 01 00 00 00 00 00 ) + .param [1] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 01 01 02 00 00 ) + .param [3] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 5 + .locals init (valuetype TestModule/MyStructOption`1 V_0) + IL_0000: ldloca.s V_0 + IL_0002: initobj valuetype TestModule/MyStructOption`1 + IL_0008: ldloca.s V_0 + IL_000a: ldc.i4.1 + IL_000b: stfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0010: ldloca.s V_0 + IL_0012: ldarg.0 + IL_0013: stfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0018: ldloca.s V_0 + IL_001a: ldarg.1 + IL_001b: stfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0020: ldloca.s V_0 + IL_0022: ldarg.2 + IL_0023: stfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_0028: ldloca.s V_0 + IL_002a: ldarg.3 + IL_002b: stfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_0030: ldloc.0 + IL_0031: ret + } + + .method public hidebysig instance bool + get_IsMyStructSome() cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, + string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 + 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 + 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C + 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 + 31 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: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0006: ldc.i4.1 + IL_0007: ceq + IL_0009: ret + } + + .method assembly specialname rtspecialname + instance void .ctor(int32 _tag) cil managed + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, + class [runtime]System.Type) = ( 01 00 60 06 00 00 1B 54 65 73 74 4D 6F 64 75 6C + 65 2B 4D 79 53 74 72 75 63 74 4F 70 74 69 6F 6E + 60 31 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: stfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0007: ret + } + + .method public hidebysig instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + get_nestedGenericField() 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 ) + .param [0] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0006: ret + } + + .method public hidebysig instance string + get_notNullField2() 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 ) + .param [0] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0006: ret + } + + .method public hidebysig instance string + get_canBeNullField() 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 ) + .param [0] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_0006: ret + } + + .method public hidebysig instance !T + get_notNullField1() 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 ) + .param [0] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_0006: ret + } + + .method public hidebysig instance int32 + get_Tag() 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 + IL_0001: ldfld int32 valuetype TestModule/MyStructOption`1::_tag + IL_0006: ret + } + + .method assembly hidebysig specialname + instance object __DebugDisplay() 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: ldstr "%+0.8A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: ldobj valuetype TestModule/MyStructOption`1 + IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) + IL_001a: ret + } + + .method public strict virtual instance string + ToString() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldstr "%+A" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,valuetype TestModule/MyStructOption`1>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_000f: ldarg.0 + IL_0010: ldobj valuetype TestModule/MyStructOption`1 + IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) + IL_001a: ret + } + + .property instance int32 Tag() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance int32 TestModule/MyStructOption`1::get_Tag() + } + .property valuetype TestModule/MyStructOption`1 + MyStructNone() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get valuetype TestModule/MyStructOption`1 TestModule/MyStructOption`1::get_MyStructNone() + } + .property instance bool IsMyStructNone() + { + .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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance bool TestModule/MyStructOption`1::get_IsMyStructNone() + } + .property instance bool IsMyStructSome() + { + .custom instance void [runtime]System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, + string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 + 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 + 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C + 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 + 31 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 ) + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance bool TestModule/MyStructOption`1::get_IsMyStructSome() + } + .property instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> + nestedGenericField() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 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 ) + .get instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> TestModule/MyStructOption`1::get_nestedGenericField() + } + .property instance string notNullField2() + { + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 01 00 00 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 ) + .get instance string TestModule/MyStructOption`1::get_notNullField2() + } + .property instance string canBeNullField() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 02 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 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 ) + .get instance string TestModule/MyStructOption`1::get_canBeNullField() + } + .property instance !T notNullField1() + { + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, + int32, + int32) = ( 01 00 04 00 00 00 01 00 00 00 03 00 00 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 ) + .get instance !T TestModule/MyStructOption`1::get_notNullField1() + } + } + + .method public static valuetype TestModule/MyStructOption`1 + mapStructContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + valuetype TestModule/MyStructOption`1 myOpt) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param type b + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + .param [0] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + .param [2] + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + + .maxstack 7 + .locals init (valuetype TestModule/MyStructOption`1 V_0, + !!a V_1, + string V_2, + string V_3, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() + IL_0009: ldc.i4.1 + IL_000a: bne.un.s IL_000e + + IL_000c: br.s IL_0014 + + IL_000e: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::get_MyStructNone() + IL_0013: ret + + IL_0014: ldloca.s V_0 + IL_0016: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 + IL_001b: stloc.1 + IL_001c: ldloca.s V_0 + IL_001e: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 + IL_0023: stloc.2 + IL_0024: ldloca.s V_0 + IL_0026: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField + IL_002b: stloc.3 + IL_002c: ldloca.s V_0 + IL_002e: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField + IL_0033: stloc.s V_4 + IL_0035: ldloc.s V_4 + IL_0037: ldloc.2 + IL_0038: ldloc.3 + IL_0039: ldarg.0 + IL_003a: ldloc.1 + IL_003b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0040: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, + string, + string, + !0) + IL_0045: ret + } + +} + +.class private abstract auto ansi sealed ''.$TestModule + extends [runtime]System.Object +{ +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs index f6038521066..043675e4bcc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs @@ -20,14 +20,4 @@ type MyOptionWhichCannotHaveNullInTheInside<'T when 'T:not null> = let mapNotNullableContents f myOpt = match myOpt with | MyNotNullNone -> MyNotNullNone - | MyNotNullSome x -> MyNotNullSome (f x) - -[] -type MyStructOption<'T when 'T: not null> = - | MyStructNone - | MyStructSome of nestedGenericField : list> * notNullField2 : string * canBeNullField : (string | null) * notNullField1 : 'T - -let mapStructContents f myOpt = - match myOpt with - | MyStructNone -> MyStructNone - | MyStructSome(ngf,s,ns,x) -> MyStructSome (ngf,s,ns,f x) \ No newline at end of file + | MyNotNullSome x -> MyNotNullSome (f x) \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl index f2a1074fb26..3d67575b886 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl @@ -170,6 +170,30 @@ IL_0015: ret } + .method public specialname static bool + get_IsMyNone(class TestModule/MyNullableOption`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: ceq + IL_0004: ret + } + + .method public specialname static bool + get_IsMySome(class TestModule/MyNullableOption`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: ret + } + .property class TestModule/MyNullableOption`1 MyNone() { @@ -188,6 +212,20 @@ .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance !T TestModule/MyNullableOption`1::get_value() } + .property bool IsMyNone() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyNullableOption`1::get_IsMyNone(class TestModule/MyNullableOption`1) + } + .property bool IsMySome() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyNullableOption`1::get_IsMySome(class TestModule/MyNullableOption`1) + } } .class auto autochar serializable sealed nested public beforefieldinit MyOptionWhichCannotHaveNullInTheInside`1 @@ -335,6 +373,30 @@ IL_0015: ret } + .method public specialname static bool + get_IsMyNotNullNone(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: ceq + IL_0004: ret + } + + .method public specialname static bool + get_IsMyNotNullSome(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: ret + } + .property class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 MyNotNullNone() { @@ -353,213 +415,269 @@ .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance !T TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_value() } + .property bool IsMyNotNullNone() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_IsMyNotNullNone(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1) + } + .property bool IsMyNotNullSome() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_IsMyNotNullSome(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1) + } } - .class sequential autochar serializable sealed nested public beforefieldinit MyStructOption`1 - extends [runtime]System.ValueType + .method public static class TestModule/MyNullableOption`1 + mapPossiblyNullable(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class TestModule/MyNullableOption`1 myOpt) cil managed { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C - 61 79 28 29 2C 6E 71 7D 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) - .custom instance void System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type T + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .param type b + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + + .maxstack 4 + .locals init (class TestModule/MyNullableOption`1 V_0, + class TestModule/MyNullableOption`1 V_1, + !!a V_2) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: brfalse.s IL_0007 + + IL_0005: br.s IL_0009 + + IL_0007: ldnull + IL_0008: ret + + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: ldloc.1 + IL_000c: ldfld !0 class TestModule/MyNullableOption`1::_value + IL_0011: stloc.2 + IL_0012: ldarg.0 + IL_0013: ldloc.2 + IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0019: call class TestModule/MyNullableOption`1 class TestModule/MyNullableOption`1::NewMySome(!0) + IL_001e: ret + } + + .method public static class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 + mapNotNullableContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 myOpt) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .class abstract auto ansi sealed nested public Tags - extends [runtime]System.Object - { - .param type T - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field public static literal int32 MyStructNone = int32(0x00000000) - .field public static literal int32 MyStructSome = int32(0x00000001) - } + .param type b + .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + + .maxstack 4 + .locals init (class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_0, + class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_1, + !!a V_2) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: brfalse.s IL_0007 - .field assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + IL_0005: br.s IL_0009 + + IL_0007: ldnull + IL_0008: ret + + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: ldloc.1 + IL_000c: ldfld !0 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::_value + IL_0011: stloc.2 + IL_0012: ldarg.0 + IL_0013: ldloc.2 + IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0019: call class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::NewMyNotNullSome(!0) + IL_001e: ret + } + +} + +.class private abstract auto ansi sealed ''.$TestModule + extends [runtime]System.Object +{ +} + +.class private auto ansi serializable sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + extends [runtime]System.Enum +{ + .custom instance void [runtime]System.FlagsAttribute::.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 ) + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) + .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) +} + +.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ + .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 ) + .field private class [runtime]System.Type Type@ + .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 ) + .method public specialname rtspecialname + instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, + class [runtime]System.Type Type) 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 ) - .field assembly string _notNullField2 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0014: ret + } + + .method public hidebysig specialname instance class [runtime]System.Type + get_Type() 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 ) - .field assembly string _canBeNullField - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ + IL_0006: ret + } + + .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + get_MemberType() 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 ) - .field assembly !T _notNullField1 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ + IL_0006: ret + } + + .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes + MemberType() + { .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 ) - .field assembly int32 _tag - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() + } + .property instance class [runtime]System.Type + Type() + { .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 ) - .method public static valuetype TestModule/MyStructOption`1 - get_MyStructNone() cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 ) - - .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: newobj instance void valuetype TestModule/MyStructOption`1::.ctor(int32) - IL_0006: ret - } + .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() + } +} - .method public hidebysig instance bool - get_IsMyStructNone() 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 - IL_0001: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0006: ldc.i4.0 - IL_0007: ceq - IL_0009: ret - } +.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public uint8[] NullableFlags + .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 ) + .method public specialname rtspecialname + instance void .ctor(uint8 scalarByteValue) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldc.i4.1 + IL_0008: newarr [runtime]System.Byte + IL_000d: dup + IL_000e: ldc.i4.0 + IL_000f: ldarg.1 + IL_0010: stelem.i1 + IL_0011: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags + IL_0016: ret + } - .method public static valuetype TestModule/MyStructOption`1 - NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField, - string _notNullField2, - string _canBeNullField, - !T _notNullField1) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 08 00 00 00 01 00 00 00 00 00 ) - .param [1] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 01 01 02 00 00 ) - .param [3] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 5 - .locals init (valuetype TestModule/MyStructOption`1 V_0) - IL_0000: ldloca.s V_0 - IL_0002: initobj valuetype TestModule/MyStructOption`1 - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 valuetype TestModule/MyStructOption`1::_tag - IL_0010: ldloca.s V_0 - IL_0012: ldarg.0 - IL_0013: stfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0018: ldloca.s V_0 - IL_001a: ldarg.1 - IL_001b: stfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0020: ldloca.s V_0 - IL_0022: ldarg.2 - IL_0023: stfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_0028: ldloca.s V_0 - IL_002a: ldarg.3 - IL_002b: stfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_0030: ldloc.0 - IL_0031: ret - } + .method public specialname rtspecialname + instance void .ctor(uint8[] NullableFlags) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags + IL_000d: ret + } - .method public hidebysig instance bool - get_IsMyStructSome() cil managed - { - .custom instance void System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, - string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 - 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 - 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C - 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 - 31 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: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0006: ldc.i4.1 - IL_0007: ceq - IL_0009: ret - } +} - .method assembly specialname rtspecialname - instance void .ctor(int32 _tag) cil managed - { - .custom instance void System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, - class [runtime]System.Type) = ( 01 00 60 06 00 00 1B 54 65 73 74 4D 6F 64 75 6C - 65 2B 4D 79 53 74 72 75 63 74 4F 70 74 69 6F 6E - 60 31 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: stfld int32 valuetype TestModule/MyStructOption`1::_tag - IL_0007: ret - } +.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableContextAttribute + extends [runtime]System.Attribute +{ + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public uint8 Flag + .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 ) + .method public specialname rtspecialname + instance void .ctor(uint8 Flag) 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 + IL_0001: call instance void [runtime]System.Attribute::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld uint8 System.Runtime.CompilerServices.NullableContextAttribute::Flag + IL_000d: ret + } - .method public hidebysig instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - get_nestedGenericField() 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 ) - .param [0] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0006: ret - } +} - .method public hidebysig instance string - get_notNullField2() 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 ) - .param [0] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0006: ret - } - .method public hidebysig instance string - get_canBeNullField() 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 ) - .param [0] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_0006: ret - } - .method public hidebysig instance !T - get_notNullField1() 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 ) - .param [0] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_0006: ret - } - .method public hidebysig instance int32 - get_Tag() 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 - IL_0001: ldfld int32 valuetype TestModule/MyStructOption`1::_tag + + +aluetype TestModule/MyStructOption`1::_tag IL_0006: ret } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl index e7c127ead88..c6f79604801 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl @@ -170,6 +170,30 @@ IL_0015: ret } + .method public specialname static bool + get_IsMyNone(class TestModule/MyNullableOption`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: ceq + IL_0004: ret + } + + .method public specialname static bool + get_IsMySome(class TestModule/MyNullableOption`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: ret + } + .property class TestModule/MyNullableOption`1 MyNone() { @@ -188,6 +212,20 @@ .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance !T TestModule/MyNullableOption`1::get_value() } + .property bool IsMyNone() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyNullableOption`1::get_IsMyNone(class TestModule/MyNullableOption`1) + } + .property bool IsMySome() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyNullableOption`1::get_IsMySome(class TestModule/MyNullableOption`1) + } } .class auto autochar serializable sealed nested public beforefieldinit MyOptionWhichCannotHaveNullInTheInside`1 @@ -335,6 +373,30 @@ IL_0015: ret } + .method public specialname static bool + get_IsMyNotNullNone(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: ceq + IL_0004: ret + } + + .method public specialname static bool + get_IsMyNotNullSome(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 A_0) cil managed + { + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: cgt.un + IL_0004: ret + } + .property class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 MyNotNullNone() { @@ -353,44 +415,107 @@ .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .get instance !T TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_value() } + .property bool IsMyNotNullNone() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_IsMyNotNullNone(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1) + } + .property bool IsMyNotNullSome() + { + .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 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 00 00 00 00 00 00 ) + .get bool TestModule/MyOptionWhichCannotHaveNullInTheInside`1::get_IsMyNotNullSome(class TestModule/MyOptionWhichCannotHaveNullInTheInside`1) + } } - .class sequential autochar serializable sealed nested public beforefieldinit MyStructOption`1 - extends [runtime]System.ValueType + .method public static class TestModule/MyNullableOption`1 + mapPossiblyNullable(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class TestModule/MyNullableOption`1 myOpt) cil managed { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoEqualityAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.NoComparisonAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 7B 5F 5F 44 65 62 75 67 44 69 73 70 6C - 61 79 28 29 2C 6E 71 7D 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 01 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.NullableContextAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type T + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) + .param type b + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) + + .maxstack 4 + .locals init (class TestModule/MyNullableOption`1 V_0, + class TestModule/MyNullableOption`1 V_1, + !!a V_2) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: brfalse.s IL_0007 + + IL_0005: br.s IL_0009 + + IL_0007: ldnull + IL_0008: ret + + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: ldloc.1 + IL_000c: ldfld !0 class TestModule/MyNullableOption`1::_value + IL_0011: stloc.2 + IL_0012: ldarg.0 + IL_0013: ldloc.2 + IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0019: call class TestModule/MyNullableOption`1 class TestModule/MyNullableOption`1::NewMySome(!0) + IL_001e: ret + } + + .method public static class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 + mapNotNullableContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 myOpt) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + .param type a .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .class abstract auto ansi sealed nested public Tags - extends [runtime]System.Object - { - .param type T - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .field public static literal int32 MyStructNone = int32(0x00000000) - .field public static literal int32 MyStructSome = int32(0x00000001) - } + .param type b + .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) + + .maxstack 4 + .locals init (class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_0, + class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_1, + !!a V_2) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: brfalse.s IL_0007 - .field assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .field assembly string _notNullField2 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .field assembly string _canBeNullField - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .field assembly !T _notNullField1 - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + IL_0005: br.s IL_0009 + + IL_0007: ldnull + IL_0008: ret + + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: ldloc.1 + IL_000c: ldfld !0 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::_value + IL_0011: stloc.2 + IL_0012: ldarg.0 + IL_0013: ldloc.2 + IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0019: call class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::NewMyNotNullSome(!0) + IL_001e: ret + } + +} + +.class private abstract auto ansi sealed ''.$TestModule + extends [runtime]System.Object +{ +} + + + + + + +.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field assembly int32 _tag .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs index fc9425ee4e2..0c9774032e8 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullnessMetadata.fs @@ -69,6 +69,11 @@ let ``Nullable attr for Option clones`` compilation = compilation |> verifyCompilation DoNotOptimize +[] +let ``Generic struct DU`` compilation = + compilation + |> verifyCompilation DoNotOptimize + module Interop = open System.IO From eabfeaf740833f456d6a922896404dbcff86a3af Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 12:10:37 +0100 Subject: [PATCH 18/48] clean tests --- .../Nullness/NullAsTrueValue.fs.il.net472.bsl | 483 ------------------ 1 file changed, 483 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl index 3d67575b886..66fa1c78b4d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.net472.bsl @@ -677,486 +677,3 @@ -aluetype TestModule/MyStructOption`1::_tag - IL_0006: ret - } - - .method assembly hidebysig specialname - instance object __DebugDisplay() 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: ldstr "%+0.8A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: ldobj valuetype TestModule/MyStructOption`1 - IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) - IL_001a: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,valuetype TestModule/MyStructOption`1>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: ldobj valuetype TestModule/MyStructOption`1 - IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) - IL_001a: ret - } - - .property instance int32 Tag() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance int32 TestModule/MyStructOption`1::get_Tag() - } - .property valuetype TestModule/MyStructOption`1 - MyStructNone() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get valuetype TestModule/MyStructOption`1 TestModule/MyStructOption`1::get_MyStructNone() - } - .property instance bool IsMyStructNone() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance bool TestModule/MyStructOption`1::get_IsMyStructNone() - } - .property instance bool IsMyStructSome() - { - .custom instance void System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, - string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 - 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 - 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C - 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 - 31 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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance bool TestModule/MyStructOption`1::get_IsMyStructSome() - } - .property instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - nestedGenericField() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 ) - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 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 ) - .get instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> TestModule/MyStructOption`1::get_nestedGenericField() - } - .property instance string notNullField2() - { - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 01 00 00 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 ) - .get instance string TestModule/MyStructOption`1::get_notNullField2() - } - .property instance string canBeNullField() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 02 00 00 00 00 00 ) - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 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 ) - .get instance string TestModule/MyStructOption`1::get_canBeNullField() - } - .property instance !T notNullField1() - { - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 03 00 00 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 ) - .get instance !T TestModule/MyStructOption`1::get_notNullField1() - } - } - - .method public static class TestModule/MyNullableOption`1 - mapPossiblyNullable(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class TestModule/MyNullableOption`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .param type b - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - - .maxstack 4 - .locals init (class TestModule/MyNullableOption`1 V_0, - class TestModule/MyNullableOption`1 V_1, - !!a V_2) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: brfalse.s IL_0007 - - IL_0005: br.s IL_0009 - - IL_0007: ldnull - IL_0008: ret - - IL_0009: ldloc.0 - IL_000a: stloc.1 - IL_000b: ldloc.1 - IL_000c: ldfld !0 class TestModule/MyNullableOption`1::_value - IL_0011: stloc.2 - IL_0012: ldarg.0 - IL_0013: ldloc.2 - IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0019: call class TestModule/MyNullableOption`1 class TestModule/MyNullableOption`1::NewMySome(!0) - IL_001e: ret - } - - .method public static class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 - mapNotNullableContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type b - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - - .maxstack 4 - .locals init (class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_0, - class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_1, - !!a V_2) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: brfalse.s IL_0007 - - IL_0005: br.s IL_0009 - - IL_0007: ldnull - IL_0008: ret - - IL_0009: ldloc.0 - IL_000a: stloc.1 - IL_000b: ldloc.1 - IL_000c: ldfld !0 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::_value - IL_0011: stloc.2 - IL_0012: ldarg.0 - IL_0013: ldloc.2 - IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0019: call class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::NewMyNotNullSome(!0) - IL_001e: ret - } - - .method public static valuetype TestModule/MyStructOption`1 - mapStructContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - valuetype TestModule/MyStructOption`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type b - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param [0] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - .param [2] - .custom instance void System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - - .maxstack 7 - .locals init (valuetype TestModule/MyStructOption`1 V_0, - !!a V_1, - string V_2, - string V_3, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0009: ldc.i4.1 - IL_000a: bne.un.s IL_000e - - IL_000c: br.s IL_0014 - - IL_000e: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::get_MyStructNone() - IL_0013: ret - - IL_0014: ldloca.s V_0 - IL_0016: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_001b: stloc.1 - IL_001c: ldloca.s V_0 - IL_001e: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0023: stloc.2 - IL_0024: ldloca.s V_0 - IL_0026: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_002b: stloc.3 - IL_002c: ldloca.s V_0 - IL_002e: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0033: stloc.s V_4 - IL_0035: ldloc.s V_4 - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: ldarg.0 - IL_003a: ldloc.1 - IL_003b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0040: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, - string, - string, - !0) - IL_0045: ret - } - -} - -.class private abstract auto ansi sealed ''.$TestModule - extends [runtime]System.Object -{ -} - -.class private auto ansi serializable sealed System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes - extends [runtime]System.Enum -{ - .custom instance void [runtime]System.FlagsAttribute::.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 ) - .field public specialname rtspecialname int32 value__ - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes All = int32(0xFFFFFFFF) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes None = int32(0x00000000) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicParameterlessConstructor = int32(0x00000001) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicConstructors = int32(0x00000003) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicConstructors = int32(0x00000004) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicMethods = int32(0x00000008) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicMethods = int32(0x00000010) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicFields = int32(0x00000020) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicFields = int32(0x00000040) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicNestedTypes = int32(0x00000080) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicNestedTypes = int32(0x00000100) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicProperties = int32(0x00000200) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicProperties = int32(0x00000400) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes PublicEvents = int32(0x00000800) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes NonPublicEvents = int32(0x00001000) - .field public static literal valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes Interfaces = int32(0x00002000) -} - -.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute - extends [runtime]System.Attribute -{ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field private valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType@ - .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 ) - .field private class [runtime]System.Type Type@ - .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 ) - .method public specialname rtspecialname - instance void .ctor(valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberType, - class [runtime]System.Type Type) 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 - IL_0001: call instance void [runtime]System.Attribute::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ - IL_0014: ret - } - - .method public hidebysig specialname instance class [runtime]System.Type - get_Type() 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 - IL_0001: ldfld class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::Type@ - IL_0006: ret - } - - .method public hidebysig specialname instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes - get_MemberType() 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 - IL_0001: ldfld valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::MemberType@ - IL_0006: ret - } - - .property instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes - MemberType() - { - .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 ) - .get instance valuetype System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_MemberType() - } - .property instance class [runtime]System.Type - Type() - { - .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 ) - .get instance class [runtime]System.Type System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::get_Type() - } -} - -.class private auto ansi beforefieldinit System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute - extends [runtime]System.Attribute -{ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field private bool ReturnValue@ - .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 ) - .field private string[] Members@ - .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 ) - .method public specialname rtspecialname - instance void .ctor(bool ReturnValue, - string[] Members) 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 - IL_0001: call instance void [runtime]System.Attribute::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::ReturnValue@ - IL_000d: ldarg.0 - IL_000e: ldarg.2 - IL_000f: stfld string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::Members@ - IL_0014: ret - } - - .method public hidebysig specialname instance string[] - get_Members() 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 - IL_0001: ldfld string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::Members@ - IL_0006: ret - } - - .method public hidebysig specialname instance bool - get_ReturnValue() 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 - IL_0001: ldfld bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::ReturnValue@ - IL_0006: ret - } - - .property instance bool ReturnValue() - { - .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 ) - .get instance bool System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::get_ReturnValue() - } - .property instance string[] Members() - { - .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 ) - .get instance string[] System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::get_Members() - } -} - -.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableAttribute - extends [runtime]System.Attribute -{ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field public uint8[] NullableFlags - .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 ) - .method public specialname rtspecialname - instance void .ctor(uint8 scalarByteValue) 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 - IL_0001: call instance void [runtime]System.Attribute::.ctor() - IL_0006: ldarg.0 - IL_0007: ldc.i4.1 - IL_0008: newarr [runtime]System.Byte - IL_000d: dup - IL_000e: ldc.i4.0 - IL_000f: ldarg.1 - IL_0010: stelem.i1 - IL_0011: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags - IL_0016: ret - } - - .method public specialname rtspecialname - instance void .ctor(uint8[] NullableFlags) 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 - IL_0001: call instance void [runtime]System.Attribute::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld uint8[] System.Runtime.CompilerServices.NullableAttribute::NullableFlags - IL_000d: ret - } - -} - -.class private auto ansi beforefieldinit System.Runtime.CompilerServices.NullableContextAttribute - extends [runtime]System.Attribute -{ - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .field public uint8 Flag - .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 ) - .method public specialname rtspecialname - instance void .ctor(uint8 Flag) 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 - IL_0001: call instance void [runtime]System.Attribute::.ctor() - IL_0006: ldarg.0 - IL_0007: ldarg.1 - IL_0008: stfld uint8 System.Runtime.CompilerServices.NullableContextAttribute::Flag - IL_000d: ret - } - -} - - - - - - From 334b118dfbc6a654b23b422ec30bf842199bd016 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 12:15:27 +0100 Subject: [PATCH 19/48] fantomas --- src/Compiler/CodeGen/EraseUnions.fs | 5 +++-- src/Compiler/CodeGen/IlxGen.fs | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 97358a54091..783ce2d43af 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -872,11 +872,12 @@ let convAlternativeDef let baseTesterMeths, baseTesterProps = if - (* g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible && + (* g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible && cud.HasHelpers = AllHelpers then [], [] - elif *) cud.UnionCases.Length <= 1 then + elif *) cud.UnionCases.Length <= 1 + then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index ebb20080349..6680057750a 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -11422,15 +11422,17 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = (cuinfo.HasHelpers = SpecialFSharpListHelpers && (md.Name = "get_Empty" || md.Name = "Cons" || md.Name = "get_IsEmpty")) || (cuinfo.HasHelpers = SpecialFSharpOptionHelpers - && (md.Name = "get_Value" || md.Name = "get_None" || md.Name = "Some")) - || (cuinfo.HasHelpers = AllHelpers && (md.Name.StartsWith("get_Is") && not (tdef2.Methods.FindByName(md.Name).IsEmpty)))), + && (md.Name = "get_Value" || md.Name = "get_None" || md.Name = "Some")) + || (cuinfo.HasHelpers = AllHelpers + && (md.Name.StartsWith("get_Is") && not (tdef2.Methods.FindByName(md.Name).IsEmpty)))), (fun (pd: ILPropertyDef) -> (cuinfo.HasHelpers = SpecialFSharpListHelpers && (pd.Name = "Empty" || pd.Name = "IsEmpty")) || (cuinfo.HasHelpers = SpecialFSharpOptionHelpers && (pd.Name = "Value" || pd.Name = "None")) - || (cuinfo.HasHelpers = AllHelpers && (pd.Name.StartsWith("Is") && not (tdef2.Properties.LookupByName(pd.Name).IsEmpty)))) + || (cuinfo.HasHelpers = AllHelpers + && (pd.Name.StartsWith("Is") && not (tdef2.Properties.LookupByName(pd.Name).IsEmpty)))) ) tdef2, tdefDiscards From f16054e2e045799488c41539942f67c0d74eeed5 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 12:30:23 +0100 Subject: [PATCH 20/48] fantomas one more time --- src/Compiler/Checking/import.fs | 4 ++-- src/Compiler/CodeGen/EraseUnions.fs | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index 2b26bf968dc..cb44389c2ba 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -447,7 +447,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( let g = env.g if st.PUntaint((fun st -> st.IsArray), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) - let nullness = Nullness.knownAmbivalent // TODO nullness type providers Nullness.ImportNullness env.g + let nullness = Nullness.knownAmbivalent // TODO nullness import :: type providers Nullness.ImportNullness env.g mkArrayTy g (st.PUntaint((fun st -> st.GetArrayRank()), m)) nullness elemTy m elif st.PUntaint((fun st -> st.IsByRef), m) then let elemTy = ImportProvidedType env m (* tinst *) (st.PApply((fun st -> st.GetElementType()), m)) @@ -520,7 +520,7 @@ let rec ImportProvidedType (env: ImportMap) (m: range) (* (tinst: TypeInst) *) ( else genericArg) - let nullness = Nullness.knownAmbivalent // TODO nullness type providers Nullness.ImportNullnessForTyconRef env.g m tcref + let nullness = Nullness.knownAmbivalent // TODO nullness import :: type providers Nullness.ImportNullnessForTyconRef env.g m tcref ImportTyconRefApp env tcref genericArgs nullness diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 783ce2d43af..c500f8ae511 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -871,13 +871,7 @@ let convAlternativeDef | SpecialFSharpListHelpers -> let baseTesterMeths, baseTesterProps = - if - (* g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible && - cud.HasHelpers = AllHelpers - then - [], [] - elif *) cud.UnionCases.Length <= 1 - then + if cud.UnionCases.Length <= 1 then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] From 4ebb2cb60cf8adc643d9cecde728c1c0e4f18500 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 14 Dec 2023 13:08:54 +0100 Subject: [PATCH 21/48] importing nullness for generic typars --- src/Compiler/Checking/import.fs | 50 ++++++++++++++------------------ src/Compiler/Checking/import.fsi | 48 ++++++++++++++++-------------- src/Compiler/Checking/infos.fs | 8 +++-- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index cb44389c2ba..db91007ff80 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -246,6 +246,12 @@ module Nullness = [] type NullableFlags = {Data : byte[]; Idx : int } +(* Nullness logic for generic arguments: +The data which comes from NullableAttribute back might be a flat array, or a scalar (which represents a virtual array of unknown size) +The array is passed trough all generic typars depth first , e.g. List,Uri>> + -- see here how the array indexes map to types above: [| 0 1 2 3 4 5 |] +For value types, a value is passed even though it is always 0 +*) with member this.GetNullness() = match this.Data.Length with @@ -270,26 +276,6 @@ module Nullness = | ILType.Value _ -> KnownWithoutNull, flags.Advance() | _ -> flags.GetNullness(), flags.Advance() -(* Support full cascade trough the metadata hierarchy, as neeeded by the following existing calls: -">" in the below logic means a fallback in case of attribute missing -ImportParameterTypeFromMetadata : Parameter>Method>Class (+ extension method 'this') -ImportReturnTypeFromMetadata : Return>Method>Class -ImportILTypeFromMetadata : Field>Class -ImportILTypeFromMetadata : Property>Class (property return type) -ImportILTypeFromMetadata : Property arg> Property >Class (property indexer param) - - -ImportILTypeFromMetadata : Event > Class (DelegateType of an event) - -ImportReturnTypeFromMetadata : SlotSlig Param,Method,Class - - -The data which falls back might be a flat array, or a scalar (which represents an array of previously unknown size) -The array is passed trough all generic typars depth first , e.g. List,Uri>> - -- see here how the array indexes map to types above: [| 0 1 2 3 4 5 |] -For value types, a value is passed even though it is always 0 -*) - /// Import an IL type as an F# type. let rec ImportILType (env: ImportMap) m tinst ty = match ty with @@ -573,7 +559,7 @@ let ImportProvidedMethodBaseAsILMethodRef (env: ImportMap) (m: range) (mbase: Ta let formalParamTysAfterInst = [ for p in ctor.PApplyArray((fun x -> x.GetParameters()), "GetParameters", m) do let ilFormalTy = ImportProvidedTypeAsILType env m (p.PApply((fun p -> p.ParameterType), m)) - // TODO import of Nullness in type providers + // TODO nullness import :: of Nullness in type providers yield ImportILType env m actualGenericArgs ilFormalTy ] (formalParamTysAfterInst, actualParamTys) ||> List.lengthsEqAndForall2 (typeEquiv env.g)) @@ -620,7 +606,7 @@ let ImportProvidedMethodBaseAsILMethodRef (env: ImportMap) (m: range) (mbase: Ta /// /// Fixup the constraints so that any references to the generic parameters /// in the constraints now refer to the new generic parameters. -let ImportILGenericParameters amap m scoref tinst (gps: ILGenericParameterDefs) = +let ImportILGenericParameters amap m scoref tinst (nullableFallback:Nullness.NullableContextSource) (gps: ILGenericParameterDefs) = match gps with | [] -> [] | _ -> @@ -631,11 +617,17 @@ let ImportILGenericParameters amap m scoref tinst (gps: ILGenericParameterDefs) let importInst = tinst@tptys (tps, gps) ||> List.iter2 (fun tp gp -> let constraints = - [ (* - let nullness = gp.CustomAttrs Nullable |> orElse ('nullable context from parent in metadata hierarchy') - if nullness = 1 -> without null -> TyparConstraint.NotSupportsNull - if nullness = 2 -> with null -> TyparConstraint.SupportsNull - *) + [ + if amap.g.langFeatureNullness && amap.g.checkNullness then + let nullness = + { Nullness.DirectAttributes = Nullness.AttributesFromIL(gp.MetadataIndex,gp.CustomAttrsStored) + Nullness.Fallback = nullableFallback } + + match nullness.GetFlags(amap.g) with + | [|1uy|] -> TyparConstraint.NotSupportsNull(m) + | [|2uy|] -> TyparConstraint.SupportsNull(m) + | _ -> () + if gp.CustomAttrs |> TryFindILAttribute amap.g.attrib_IsUnmanagedAttribute then TyparConstraint.IsUnmanaged(m) if gp.HasDefaultConstructorConstraint then @@ -687,13 +679,15 @@ let rec ImportILTypeDef amap m scoref (cpath: CompilationPath) enc nm (tdef: ILT ImportILTypeDefs amap m scoref cpath (enc@[tdef]) tdef.NestedTypes ) + let nullableFallback = Nullness.FromClass(Nullness.AttributesFromIL(tdef.MetadataIndex,tdef.CustomAttrsStored)) + // Add the type itself. Construct.NewILTycon (Some cpath) (nm, m) // The read of the type parameters may fail to resolve types. We pick up a new range from the point where that read is forced // Make sure we reraise the original exception one occurs - see findOriginalException. - (LazyWithContext.Create((fun m -> ImportILGenericParameters amap m scoref [] tdef.GenericParams), findOriginalException)) + (LazyWithContext.Create((fun m -> ImportILGenericParameters amap m scoref [] nullableFallback tdef.GenericParams), findOriginalException)) (scoref, enc, tdef) (MaybeLazy.Lazy lazyModuleOrNamespaceTypeForNestedTypes) diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index 5316c1b0e99..fb1f191effc 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -51,6 +51,26 @@ type ImportMap = /// The TcGlobals for the import context member g: TcGlobals +module Nullness = + + [] + type AttributesFromIL = + | AttributesFromIL of metadataIndex: int * attrs: ILAttributesStored + + member Read: unit -> ILAttributes + + [] + type NullableContextSource = + | FromClass of AttributesFromIL + | FromMethodAndClass of methodAttrs: AttributesFromIL * classAttrs: AttributesFromIL + + [] + type NullableAttributesSource = + { DirectAttributes: AttributesFromIL + Fallback: NullableContextSource } + + static member Empty: NullableAttributesSource + /// Import a reference to a type definition, given an AbstractIL ILTypeRef, with caching val internal ImportILTypeRef: ImportMap -> range -> ILTypeRef -> TyconRef @@ -79,7 +99,13 @@ val internal ImportProvidedMethodBaseAsILMethodRef: ImportMap -> range -> Tainte /// Import a set of Abstract IL generic parameter specifications as a list of new F# generic parameters. val internal ImportILGenericParameters: - (unit -> ImportMap) -> range -> ILScopeRef -> TType list -> ILGenericParameterDef list -> Typar list + (unit -> ImportMap) -> + range -> + ILScopeRef -> + TType list -> + Nullness.NullableContextSource -> + ILGenericParameterDef list -> + Typar list /// Import an IL assembly as a new TAST CCU val internal ImportILAssembly: @@ -98,26 +124,6 @@ val internal ImportILAssembly: val internal ImportILAssemblyTypeForwarders: (unit -> ImportMap) * range * ILExportedTypesAndForwarders -> CcuTypeForwarderTable -module Nullness = - - [] - type AttributesFromIL = - | AttributesFromIL of metadataIndex: int * attrs: ILAttributesStored - - member Read: unit -> ILAttributes - - [] - type NullableContextSource = - | FromClass of AttributesFromIL - | FromMethodAndClass of methodAttrs: AttributesFromIL * classAttrs: AttributesFromIL - - [] - type NullableAttributesSource = - { DirectAttributes: AttributesFromIL - Fallback: NullableContextSource } - - static member Empty: NullableAttributesSource - /// Import an IL type as an F# type, first rescoping to view the metadata from the current assembly /// being compiled. importInst gives the context for interpreting type variables. /// This function fully skips the 'nullness checking' metadata flags. diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index c1583d3f20a..7d22ae9cec8 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -1077,14 +1077,18 @@ type MethInfo = /// Build IL method infos. static member CreateILMeth (amap: ImportMap, m, ty: TType, md: ILMethodDef) = let tinfo = ILTypeInfo.FromType amap.g ty - let mtps = ImportILGenericParameters (fun () -> amap) m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata md.GenericParams + let nullableFallback = FromMethodAndClass(AttributesFromIL(md.MetadataIndex,md.CustomAttrsStored),tinfo.NullableAttributes) + let mtps = ImportILGenericParameters (fun () -> amap) m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata nullableFallback md.GenericParams ILMeth (amap.g, ILMethInfo(amap.g, IlType tinfo, md, mtps), None) /// Build IL method infos for a C#-style extension method static member CreateILExtensionMeth (amap:ImportMap, m, apparentTy: TType, declaringTyconRef: TyconRef, extMethPri, md: ILMethodDef) = let scoref = declaringTyconRef.CompiledRepresentationForNamedType.Scope let typeInfo = CSharpStyleExtension(declaringTyconRef,apparentTy) - let mtps = ImportILGenericParameters (fun () -> amap) m scoref [] md.GenericParams + let declaringMetadata = declaringTyconRef.ILTyconRawMetadata + let declaringAttributes = AttributesFromIL(declaringMetadata.MetadataIndex,declaringMetadata.CustomAttrsStored) + let nullableFallback = FromMethodAndClass(AttributesFromIL(md.MetadataIndex,md.CustomAttrsStored),declaringAttributes) + let mtps = ImportILGenericParameters (fun () -> amap) m scoref [] nullableFallback md.GenericParams ILMeth (amap.g, ILMethInfo(amap.g, typeInfo, md, mtps), extMethPri) /// Tests whether two method infos have the same underlying definition. From 0d6d764167cdd1906102aaeccdc2dbe8b1220832 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 15 Dec 2023 10:11:26 +0100 Subject: [PATCH 22/48] print failing ivals, let's see --- src/Compiler/TypedTree/TypedTreePickle.fs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 84ed2bf70d2..66a234c0241 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -437,14 +437,15 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // ctxt is for debugging let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) - //if ((idx = 0) && outMap.Name = "oentities") then - // let msg = - // sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" - // idx (outMap.NodeStamp x) - // outMap.Name (outMap.NodeName x) - // (stringOfRange (outMap.GetRange x)) - // _ctxt - // System.Diagnostics.Debug.Assert(false, msg ) + if ((idx >= 6432 && idx < 6440) && outMap.Name = "ivals") then + let msg = + sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" + idx (outMap.NodeStamp x) + outMap.Name (outMap.NodeName x) + (stringOfRange (outMap.GetRange x)) + _ctxt + System.Diagnostics.Debug.Assert(false, msg ) + printfn "%s" msg p_int idx st let p_osgn_decl (outMap : NodeOutTable<_, _>) p x st = From 4b9b4b27072739f0f5d03d822b1323675e89d306 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 15 Dec 2023 12:25:50 +0100 Subject: [PATCH 23/48] write even more! --- src/Compiler/TypedTree/TypedTreePickle.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 66a234c0241..dc930ef3beb 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -437,7 +437,7 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // ctxt is for debugging let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) - if ((idx >= 6432 && idx < 6440) && outMap.Name = "ivals") then + if ((idx >= 6432 && idx < 6440)) then let msg = sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" idx (outMap.NodeStamp x) From 14cf8fa62e4cdfe9dc46e8c1bfd20359bee65a7d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 19 Dec 2023 21:32:04 +0100 Subject: [PATCH 24/48] isolated failing test - combo of module rec, signature file, IVT --- src/Compiler/TypedTree/TypedTreePickle.fs | 3 +- .../Language/DiscriminatedUnionTests.fs | 37 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index dc930ef3beb..3b6e895f1da 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -437,7 +437,7 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // ctxt is for debugging let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) - if ((idx >= 6432 && idx < 6440)) then + if ((idx >= 6400 && idx < 6450) && outMap.Name = "ovals") then let msg = sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" idx (outMap.NodeStamp x) @@ -445,6 +445,7 @@ let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = (stringOfRange (outMap.GetRange x)) _ctxt System.Diagnostics.Debug.Assert(false, msg ) + System.IO.File.AppendAllLines(@"D:\protobuild.log",[msg]) printfn "%s" msg p_int idx st diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs index abd5fb6e3b6..943cac20c46 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs @@ -49,6 +49,43 @@ if foo.IsA then failwith "Should not be A" |> compileExeAndRun |> shouldSucceed + [] + let ``Is* DU property roundtrip over pickled metadata and with fsi file`` () = + let libCode = """module rec TestLib + +//ivt comment out [] +//ivt comment out do () + +[] +type internal X = +| A +| a of int""" + let appCode = """ +open TestLib +let someFunction () = + let x = X.a 42 + printfn "%A" x.IsA + +printfn "%s" "exit" """ + + let lib = + Fsi(libCode) + |> withAdditionalSourceFile (FsSource (libCode.Replace("internal","").Replace("//ivt comment out ",""))) + |> withLangVersionPreview + |> withName "fsLib" + + FSharp appCode + |> asExe + |> withReferences [lib] + |> withWarnOn 3186 + |> withOptions ["--warnaserror+"] + |> withName "AppCodeProjectName" + |> withLangVersionPreview + |> compile + |> shouldSucceed + + + [] let ``Is* discriminated union properties with backticks are visible, proper values are returned`` () = Fsx """ From 01d06711a8b5023258a1cd6d93cbf5e95215df10 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 20 Dec 2023 13:30:34 +0100 Subject: [PATCH 25/48] another attempt --- src/Compiler/Checking/CheckDeclarations.fs | 16 ++++++------ src/Compiler/CodeGen/EraseUnions.fs | 8 +++++- .../Language/DiscriminatedUnionTests.fs | 25 +++++++------------ 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index c393012d631..8e6f82a5bf5 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4708,14 +4708,14 @@ module TcDeclarations = MutRecBindingChecking.TcMutRecDefns_UpdateModuleContents mutRecNSInfo mutRecDefnsAfterVals // Generate the union augmentation values for all tycons. - (envMutRec, mutRecDefnsAfterCore) ||> MutRecShapes.iterTyconsWithEnv (fun envForDecls ((tyconCore, _, _), tyconOpt, _, _, _) -> - let (MutRecDefnsPhase1DataForTycon (isAtOriginalTyconDefn=isAtOriginalTyconDefn)) = tyconCore - match tyconOpt with - | Some tycon when isAtOriginalTyconDefn -> - if tycon.IsUnionTycon && AddAugmentationDeclarations.ShouldAugmentUnion cenv.g tycon then - let vspecs = AddAugmentationDeclarations.AddUnionAugmentationValues cenv envForDecls tycon - ignore vspecs - | _ -> ()) + //(envMutRec, mutRecDefnsAfterCore) ||> MutRecShapes.iterTyconsWithEnv (fun envForDecls ((tyconCore, _, _), tyconOpt, _, _, _) -> + // let (MutRecDefnsPhase1DataForTycon (isAtOriginalTyconDefn=isAtOriginalTyconDefn)) = tyconCore + // match tyconOpt with + // | Some tycon when isAtOriginalTyconDefn -> + // if tycon.IsUnionTycon && AddAugmentationDeclarations.ShouldAugmentUnion cenv.g tycon then + // let vspecs = AddAugmentationDeclarations.AddUnionAugmentationValues cenv envForDecls tycon + // ignore vspecs + // | _ -> ()) envMutRec diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index c500f8ae511..8f3f935fd3a 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -871,7 +871,12 @@ let convAlternativeDef | SpecialFSharpListHelpers -> let baseTesterMeths, baseTesterProps = - if cud.UnionCases.Length <= 1 then + if + false //g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible + && cud.HasHelpers = AllHelpers + then + [], [] + elif cud.UnionCases.Length <= 1 then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] @@ -918,6 +923,7 @@ let convAlternativeDef ) )) .With(customAttrs = additionalAttributes) + .WithSpecialName |> addMethodGeneratedAttrs ], [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs index 943cac20c46..d2850e292ad 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs @@ -53,27 +53,20 @@ if foo.IsA then failwith "Should not be A" let ``Is* DU property roundtrip over pickled metadata and with fsi file`` () = let libCode = """module rec TestLib -//ivt comment out [] -//ivt comment out do () - -[] -type internal X = -| A -| a of int""" - let appCode = """ -open TestLib -let someFunction () = - let x = X.a 42 - printfn "%A" x.IsA - -printfn "%s" "exit" """ - +type X = A | B""" + let appCode = """printfn "%s" "exit" """ let lib = Fsi(libCode) - |> withAdditionalSourceFile (FsSource (libCode.Replace("internal","").Replace("//ivt comment out ",""))) + |> withAdditionalSourceFile (FsSource libCode) |> withLangVersionPreview + |> asLibrary |> withName "fsLib" + lib + |> compile + |> verifyIL [""".method public hidebysig specialname +instance bool get_IsA() cil managed """] + FSharp appCode |> asExe |> withReferences [lib] From e0e7c2802ee0cba9b50d5f0f51505a77a9dae8cc Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 20 Dec 2023 13:31:07 +0100 Subject: [PATCH 26/48] format --- src/Compiler/CodeGen/EraseUnions.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 8f3f935fd3a..1b7034a82e5 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -876,7 +876,7 @@ let convAlternativeDef && cud.HasHelpers = AllHelpers then [], [] - elif cud.UnionCases.Length <= 1 then + elif cud.UnionCases.Length <= 1 then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] From 92267fc041e5420974fdbe204171a625e8742ee0 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 3 Jan 2024 19:09:06 +0100 Subject: [PATCH 27/48] test --- .../Language/DiscriminatedUnionTests.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs index d2850e292ad..cea3ba41dca 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs @@ -54,7 +54,10 @@ if foo.IsA then failwith "Should not be A" let libCode = """module rec TestLib type X = A | B""" - let appCode = """printfn "%s" "exit" """ + let appCode = """ +let x = TestLib.X.A +let isA = x.IsA +printfn "%A" isA """ let lib = Fsi(libCode) |> withAdditionalSourceFile (FsSource libCode) @@ -75,7 +78,8 @@ instance bool get_IsA() cil managed """] |> withName "AppCodeProjectName" |> withLangVersionPreview |> compile - |> shouldSucceed + |> shouldFail + |> withDiagnosticMessageMatches "does not define the field, constructor or member 'IsA'" From 3d2ed8b103750a9e94adc8f3ef304e38a2b94132 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 4 Jan 2024 13:41:29 +0100 Subject: [PATCH 28/48] hide tests --- .../Language/DiscriminatedUnionTests.fs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs index cea3ba41dca..194284177cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DiscriminatedUnionTests.fs @@ -49,7 +49,8 @@ if foo.IsA then failwith "Should not be A" |> compileExeAndRun |> shouldSucceed - [] + // TODO nullness - wait for https://github.com/fsharp/fslang-design/discussions/760 + // [] let ``Is* DU property roundtrip over pickled metadata and with fsi file`` () = let libCode = """module rec TestLib @@ -164,7 +165,8 @@ let isFoo = foo.IsFoo |> withErrorMessage "The type 'Foo' does not define the field, constructor or member 'IsFoo'. Maybe you want one of the following: Foo" - [] + // TODO nullness - wait for https://github.com/fsharp/fslang-design/discussions/760 + //[] let ``Is* discriminated union properties are unavailable on voption`` () = Fsx """ let x = (ValueSome 1).IsSome From affe0c8489e7bbc45542b73814ae424b4c3b279a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 4 Jan 2024 19:22:00 +0100 Subject: [PATCH 29/48] Remove 'specialname' for DU case tester --- src/Compiler/CodeGen/EraseUnions.fs | 3 +-- .../Language/NullableCsharpImportTests.fs | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 1b7034a82e5..470d8554e41 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -922,8 +922,7 @@ let convAlternativeDef imports ) )) - .With(customAttrs = additionalAttributes) - .WithSpecialName + .With(customAttrs = additionalAttributes) |> addMethodGeneratedAttrs ], [ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs index 78984796666..2302850ee36 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -70,6 +70,8 @@ let ``Consumption of nullable C# - no generics, just strings in methods and fiel |> withLangVersionPreview |> withReferences [csharpLib] |> withCheckNulls + |> withWarnOn 3261 + |> withOptions ["--warnaserror+"] |> compile |> shouldFail |> withDiagnostics [ From bba75217f6c611ce5af692bfcfa4341409ae1d4d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 4 Jan 2024 19:58:57 +0100 Subject: [PATCH 30/48] format --- src/Compiler/CodeGen/EraseUnions.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index 470d8554e41..eb471c074ab 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -922,7 +922,7 @@ let convAlternativeDef imports ) )) - .With(customAttrs = additionalAttributes) + .With(customAttrs = additionalAttributes) |> addMethodGeneratedAttrs ], [ From 00553761e729945baff7be9a857c32f3835c1dfb Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 4 Jan 2024 20:11:42 +0100 Subject: [PATCH 31/48] warning as error --- .../Language/NullableCsharpImportTests.fs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs index 2302850ee36..c958d16387d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -75,11 +75,11 @@ let ``Consumption of nullable C# - no generics, just strings in methods and fiel |> compile |> shouldFail |> withDiagnostics [ - Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability." - Warning 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Warning 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Warning 3261, Line 16, Col 35, Line 16, Col 39, "Nullness warning: The type 'string' does not support 'null'." - Warning 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Warning 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." - Warning 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] + Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have compatible nullability." + Error 3261, Line 5, Col 40, Line 5, Col 85, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 14, Col 34, Line 14, Col 62, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 16, Col 35, Line 16, Col 39, "Nullness warning: The type 'string' does not support 'null'." + Error 3261, Line 25, Col 85, Line 25, Col 97, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 28, Col 99, Line 28, Col 111, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability." + Error 3261, Line 30, Col 97, Line 30, Col 109, "Nullness warning: The types 'string' and 'string | null' do not have equivalent nullability."] From 939f6da2dee50e6e41839c3129a160902f89a40c Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 4 Jan 2024 20:12:11 +0100 Subject: [PATCH 32/48] update baseline netcore --- .../NullAsTrueValue.fs.il.netcore.bsl | 423 ------------------ 1 file changed, 423 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl index c6f79604801..31eb914a6f2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/NullAsTrueValue.fs.il.netcore.bsl @@ -515,426 +515,3 @@ -.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field assembly int32 _tag - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 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 ) - .method public static valuetype TestModule/MyStructOption`1 - get_MyStructNone() cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 08 00 00 00 00 00 00 00 00 00 ) - - .maxstack 8 - IL_0000: ldc.i4.0 - IL_0001: newobj instance void valuetype TestModule/MyStructOption`1::.ctor(int32) - IL_0006: ret - } - - .method public hidebysig instance bool - get_IsMyStructNone() 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 - IL_0001: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0006: ldc.i4.0 - IL_0007: ceq - IL_0009: ret - } - - .method public static valuetype TestModule/MyStructOption`1 - NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> _nestedGenericField, - string _notNullField2, - string _canBeNullField, - !T _notNullField1) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32) = ( 01 00 08 00 00 00 01 00 00 00 00 00 ) - .param [1] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 01 01 02 00 00 ) - .param [3] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 5 - .locals init (valuetype TestModule/MyStructOption`1 V_0) - IL_0000: ldloca.s V_0 - IL_0002: initobj valuetype TestModule/MyStructOption`1 - IL_0008: ldloca.s V_0 - IL_000a: ldc.i4.1 - IL_000b: stfld int32 valuetype TestModule/MyStructOption`1::_tag - IL_0010: ldloca.s V_0 - IL_0012: ldarg.0 - IL_0013: stfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0018: ldloca.s V_0 - IL_001a: ldarg.1 - IL_001b: stfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0020: ldloca.s V_0 - IL_0022: ldarg.2 - IL_0023: stfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_0028: ldloca.s V_0 - IL_002a: ldarg.3 - IL_002b: stfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_0030: ldloc.0 - IL_0031: ret - } - - .method public hidebysig instance bool - get_IsMyStructSome() cil managed - { - .custom instance void [runtime]System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, - string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 - 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 - 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C - 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 - 31 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: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0006: ldc.i4.1 - IL_0007: ceq - IL_0009: ret - } - - .method assembly specialname rtspecialname - instance void .ctor(int32 _tag) cil managed - { - .custom instance void [runtime]System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::.ctor(valuetype [runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, - class [runtime]System.Type) = ( 01 00 60 06 00 00 1B 54 65 73 74 4D 6F 64 75 6C - 65 2B 4D 79 53 74 72 75 63 74 4F 70 74 69 6F 6E - 60 31 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: stfld int32 valuetype TestModule/MyStructOption`1::_tag - IL_0007: ret - } - - .method public hidebysig instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - get_nestedGenericField() 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 ) - .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0006: ret - } - - .method public hidebysig instance string - get_notNullField2() 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 ) - .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0006: ret - } - - .method public hidebysig instance string - get_canBeNullField() 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 ) - .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_0006: ret - } - - .method public hidebysig instance !T - get_notNullField1() 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 ) - .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_0006: ret - } - - .method public hidebysig instance int32 - get_Tag() 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 - IL_0001: ldfld int32 valuetype TestModule/MyStructOption`1::_tag - IL_0006: ret - } - - .method assembly hidebysig specialname - instance object __DebugDisplay() 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: ldstr "%+0.8A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,string>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: ldobj valuetype TestModule/MyStructOption`1 - IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) - IL_001a: ret - } - - .method public strict virtual instance string - ToString() cil managed - { - .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) - - .maxstack 8 - IL_0000: ldstr "%+A" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,string>,class [FSharp.Core]Microsoft.FSharp.Core.Unit,string,string,valuetype TestModule/MyStructOption`1>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatToString,string>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_000f: ldarg.0 - IL_0010: ldobj valuetype TestModule/MyStructOption`1 - IL_0015: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,string>::Invoke(!0) - IL_001a: ret - } - - .property instance int32 Tag() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance int32 TestModule/MyStructOption`1::get_Tag() - } - .property valuetype TestModule/MyStructOption`1 - MyStructNone() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get valuetype TestModule/MyStructOption`1 TestModule/MyStructOption`1::get_MyStructNone() - } - .property instance bool IsMyStructNone() - { - .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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance bool TestModule/MyStructOption`1::get_IsMyStructNone() - } - .property instance bool IsMyStructSome() - { - .custom instance void [runtime]System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute::.ctor(bool, - string[]) = ( 01 00 01 04 00 00 00 0D 6E 6F 74 4E 75 6C 6C 46 - 69 65 6C 64 32 0D 6E 6F 74 4E 75 6C 6C 46 69 65 - 6C 64 31 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C - 64 32 0E 5F 6E 6F 74 4E 75 6C 6C 46 69 65 6C 64 - 31 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 ) - .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .get instance bool TestModule/MyStructOption`1::get_IsMyStructSome() - } - .property instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - nestedGenericField() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 00 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8[]) = ( 01 00 03 00 00 00 02 01 02 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 ) - .get instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> TestModule/MyStructOption`1::get_nestedGenericField() - } - .property instance string notNullField2() - { - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 01 00 00 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 ) - .get instance string TestModule/MyStructOption`1::get_notNullField2() - } - .property instance string canBeNullField() - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 02 00 00 00 00 00 ) - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 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 ) - .get instance string TestModule/MyStructOption`1::get_canBeNullField() - } - .property instance !T notNullField1() - { - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags, - int32, - int32) = ( 01 00 04 00 00 00 01 00 00 00 03 00 00 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 ) - .get instance !T TestModule/MyStructOption`1::get_notNullField1() - } - } - - .method public static class TestModule/MyNullableOption`1 - mapPossiblyNullable(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class TestModule/MyNullableOption`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 02 00 00 ) - .param type b - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - - .maxstack 4 - .locals init (class TestModule/MyNullableOption`1 V_0, - class TestModule/MyNullableOption`1 V_1, - !!a V_2) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: brfalse.s IL_0007 - - IL_0005: br.s IL_0009 - - IL_0007: ldnull - IL_0008: ret - - IL_0009: ldloc.0 - IL_000a: stloc.1 - IL_000b: ldloc.1 - IL_000c: ldfld !0 class TestModule/MyNullableOption`1::_value - IL_0011: stloc.2 - IL_0012: ldarg.0 - IL_0013: ldloc.2 - IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0019: call class TestModule/MyNullableOption`1 class TestModule/MyNullableOption`1::NewMySome(!0) - IL_001e: ret - } - - .method public static class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 - mapNotNullableContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type b - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - - .maxstack 4 - .locals init (class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_0, - class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 V_1, - !!a V_2) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloc.0 - IL_0003: brfalse.s IL_0007 - - IL_0005: br.s IL_0009 - - IL_0007: ldnull - IL_0008: ret - - IL_0009: ldloc.0 - IL_000a: stloc.1 - IL_000b: ldloc.1 - IL_000c: ldfld !0 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::_value - IL_0011: stloc.2 - IL_0012: ldarg.0 - IL_0013: ldloc.2 - IL_0014: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0019: call class TestModule/MyOptionWhichCannotHaveNullInTheInside`1 class TestModule/MyOptionWhichCannotHaveNullInTheInside`1::NewMyNotNullSome(!0) - IL_001e: ret - } - - .method public static valuetype TestModule/MyStructOption`1 - mapStructContents(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, - valuetype TestModule/MyStructOption`1 myOpt) cil managed - { - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) - .param type a - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param type b - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 01 00 00 ) - .param [0] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - .param [2] - .custom instance void [runtime]System.Runtime.CompilerServices.NullableAttribute::.ctor(uint8) = ( 01 00 00 00 00 ) - - .maxstack 7 - .locals init (valuetype TestModule/MyStructOption`1 V_0, - !!a V_1, - string V_2, - string V_3, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4) - IL_0000: ldarg.1 - IL_0001: stloc.0 - IL_0002: ldloca.s V_0 - IL_0004: call instance int32 valuetype TestModule/MyStructOption`1::get_Tag() - IL_0009: ldc.i4.1 - IL_000a: bne.un.s IL_000e - - IL_000c: br.s IL_0014 - - IL_000e: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::get_MyStructNone() - IL_0013: ret - - IL_0014: ldloca.s V_0 - IL_0016: ldfld !0 valuetype TestModule/MyStructOption`1::_notNullField1 - IL_001b: stloc.1 - IL_001c: ldloca.s V_0 - IL_001e: ldfld string valuetype TestModule/MyStructOption`1::_notNullField2 - IL_0023: stloc.2 - IL_0024: ldloca.s V_0 - IL_0026: ldfld string valuetype TestModule/MyStructOption`1::_canBeNullField - IL_002b: stloc.3 - IL_002c: ldloca.s V_0 - IL_002e: ldfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> valuetype TestModule/MyStructOption`1::_nestedGenericField - IL_0033: stloc.s V_4 - IL_0035: ldloc.s V_4 - IL_0037: ldloc.2 - IL_0038: ldloc.3 - IL_0039: ldarg.0 - IL_003a: ldloc.1 - IL_003b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0040: call valuetype TestModule/MyStructOption`1 valuetype TestModule/MyStructOption`1::NewMyStructSome(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, - string, - string, - !0) - IL_0045: ret - } - -} - -.class private abstract auto ansi sealed ''.$TestModule - extends [runtime]System.Object -{ -} - - - - - - From c781a6a4f3be7a69b93a5f14d915fee1e5332fff Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 5 Jan 2024 10:21:59 +0100 Subject: [PATCH 33/48] nullable errors not in desktop framework --- .../Language/NullableCsharpImportTests.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs index c958d16387d..60930ad56dd 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/NullableCsharpImportTests.fs @@ -4,7 +4,7 @@ open FSharp.Test open Xunit open FSharp.Test.Compiler -[] +[] let ``Consumption of nullable C# - no generics, just strings in methods and fields`` () = let csharpLib = CSharp """ From 384cc32c4a344a628f4e48dedbe3cb3d54b18743 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 5 Jan 2024 10:23:29 +0100 Subject: [PATCH 34/48] surface area, trimming --- tests/AheadOfTime/Trimming/check.ps1 | 2 +- ...ervice.SurfaceArea.netstandard20.debug.bsl | 151 ++++++++++++++++++ 2 files changed, 152 insertions(+), 1 deletion(-) diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index 373cd534ce2..8d2d17adef2 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -40,7 +40,7 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { # error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher. # Check net7.0 trimmed assemblies -CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len 288256 +CheckTrim -root "SelfContained_Trimming_Test" -tfm "net8.0" -outputfile "FSharp.Core.dll" -expected_len 288768 # Check net7.0 trimmed assemblies CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net8.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 8822272 diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 25a540db859..15b58c9aea1 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -296,10 +296,30 @@ FSharp.Compiler.AbstractIL.IL+ILAttribute: Int32 get_Tag() FSharp.Compiler.AbstractIL.IL+ILAttribute: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILAttributes: ILAttribute[] AsArray() FSharp.Compiler.AbstractIL.IL+ILAttributes: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILAttribute] AsList() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given: ILAttributes Item +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given: ILAttributes get_Item() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader: Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]] Item +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader: Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]] get_Item() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags: Int32 Given +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags: Int32 Reader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean IsGiven +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean IsReader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean get_IsGiven() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean get_IsReader() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributes GetCustomAttrs(Int32) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributesStored NewGiven(ILAttributes) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributesStored NewReader(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]]) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Int32 Tag +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Int32 get_Tag() FSharp.Compiler.AbstractIL.IL+ILAttributesStored: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(ILCallingConv) FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(System.Object) FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean IsCallconv +FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean get_IsCallconv() FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILArgConvention Item2 FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILArgConvention get_Item2() FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILCallingConv Instance @@ -390,10 +410,14 @@ FSharp.Compiler.AbstractIL.IL+ILEventDef: Boolean get_IsRTSpecialName() FSharp.Compiler.AbstractIL.IL+ILEventDef: Boolean get_IsSpecialName() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef AddMethod FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef RemoveMethod FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef get_AddMethod() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef get_RemoveMethod() +FSharp.Compiler.AbstractIL.IL+ILEventDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILEventDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] OtherMethods FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] get_OtherMethods() FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] FireMethod @@ -445,10 +469,14 @@ FSharp.Compiler.AbstractIL.IL+ILFieldDef: Boolean get_IsStatic() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Boolean get_NotSerialized() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILMemberAccess Access FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILMemberAccess get_Access() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILType FieldType FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILType get_FieldType() +FSharp.Compiler.AbstractIL.IL+ILFieldDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILFieldDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] LiteralValue FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] get_LiteralValue() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILNativeType] Marshal @@ -762,6 +790,8 @@ FSharp.Compiler.AbstractIL.IL+ILMethodDef: Boolean get_IsVirtual() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Boolean get_IsZeroInit() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingConv CallingConv FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingConv get_CallingConv() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingSignature GetCallingSignature() @@ -774,7 +804,9 @@ FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILReturn get_Return() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILSecurityDecls SecurityDecls FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILSecurityDecls get_SecurityDecls() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 MaxStack +FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 MetadataIndex FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 get_MaxStack() +FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILMethodDef: MethodBody Body FSharp.Compiler.AbstractIL.IL+ILMethodDef: MethodBody get_Body() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] GenericParams @@ -1230,10 +1262,14 @@ FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Boolean get_IsRTSpecialName() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Boolean get_IsSpecialName() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILThisConvention CallingConv FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILThisConvention get_CallingConv() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILType PropertyType FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILType get_PropertyType() +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] Args FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] get_Args() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] Init @@ -1490,6 +1526,8 @@ FSharp.Compiler.AbstractIL.IL+ILTypeDef: Boolean get_IsStruct() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Boolean get_IsStructOrEnum() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILDefaultPInvokeEncoding Encoding FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILDefaultPInvokeEncoding get_Encoding() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILEventDefs Events @@ -1511,6 +1549,8 @@ FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefLayout Layout FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefLayout get_Layout() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefs NestedTypes FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefs get_NestedTypes() +FSharp.Compiler.AbstractIL.IL+ILTypeDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILTypeDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] GenericParams FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] get_GenericParams() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] Implements @@ -4231,6 +4271,8 @@ FSharp.Compiler.EditorServices.ToolTipElementData: Void .ctor(Microsoft.FSharp.C FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipText) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.EditorServices.ToolTipText: Boolean IsToolTipText +FSharp.Compiler.EditorServices.ToolTipText: Boolean get_IsToolTipText() FSharp.Compiler.EditorServices.ToolTipText: FSharp.Compiler.EditorServices.ToolTipText NewToolTipText(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.ToolTipElement]) FSharp.Compiler.EditorServices.ToolTipText: Int32 GetHashCode() FSharp.Compiler.EditorServices.ToolTipText: Int32 GetHashCode(System.Collections.IEqualityComparer) @@ -4274,6 +4316,8 @@ FSharp.Compiler.EditorServices.XmlDocParser: Microsoft.FSharp.Collections.FSharp FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(FSharp.Compiler.EditorServices.XmlDocable) FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(System.Object) FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.EditorServices.XmlDocable: Boolean IsXmlDocable +FSharp.Compiler.EditorServices.XmlDocable: Boolean get_IsXmlDocable() FSharp.Compiler.EditorServices.XmlDocable: FSharp.Compiler.EditorServices.XmlDocable NewXmlDocable(Int32, Int32, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.EditorServices.XmlDocable: Int32 CompareTo(FSharp.Compiler.EditorServices.XmlDocable) FSharp.Compiler.EditorServices.XmlDocable: Int32 CompareTo(System.Object) @@ -5298,21 +5342,25 @@ FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Symbols.FSharpField,FSharp.Compiler.Symbols.FSharpType]] |Field|_|(FSharp.Compiler.Symbols.FSharpSymbol) FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[FSharp.Compiler.Symbols.FSharpEntity,FSharp.Compiler.Symbols.FSharpEntity,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpType]]] |FSharpEntity|_|(FSharp.Compiler.Symbols.FSharpSymbol) FSharp.Compiler.Symbols.FSharpType: Boolean Equals(System.Object) +FSharp.Compiler.Symbols.FSharpType: Boolean HasNullAnnotation FSharp.Compiler.Symbols.FSharpType: Boolean HasTypeDefinition FSharp.Compiler.Symbols.FSharpType: Boolean IsAbbreviation FSharp.Compiler.Symbols.FSharpType: Boolean IsAnonRecordType FSharp.Compiler.Symbols.FSharpType: Boolean IsFunctionType FSharp.Compiler.Symbols.FSharpType: Boolean IsGenericParameter FSharp.Compiler.Symbols.FSharpType: Boolean IsMeasureType +FSharp.Compiler.Symbols.FSharpType: Boolean IsNullAmbivalent FSharp.Compiler.Symbols.FSharpType: Boolean IsStructTupleType FSharp.Compiler.Symbols.FSharpType: Boolean IsTupleType FSharp.Compiler.Symbols.FSharpType: Boolean IsUnresolved +FSharp.Compiler.Symbols.FSharpType: Boolean get_HasNullAnnotation() FSharp.Compiler.Symbols.FSharpType: Boolean get_HasTypeDefinition() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAbbreviation() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAnonRecordType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsFunctionType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsGenericParameter() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsMeasureType() +FSharp.Compiler.Symbols.FSharpType: Boolean get_IsNullAmbivalent() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsStructTupleType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsTupleType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsUnresolved() @@ -5508,6 +5556,8 @@ FSharp.Compiler.Syntax.DebugPointAtInOrTo: System.String ToString() FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(FSharp.Compiler.Syntax.DebugPointAtLeafExpr) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(System.Object) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean IsYes +FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean get_IsYes() FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Syntax.DebugPointAtLeafExpr NewYes(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Text.Range Item FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Text.Range get_Item() @@ -5642,6 +5692,8 @@ FSharp.Compiler.Syntax.Ident: System.String ToString() FSharp.Compiler.Syntax.Ident: System.String get_idText() FSharp.Compiler.Syntax.Ident: System.String idText FSharp.Compiler.Syntax.Ident: Void .ctor(System.String, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.ParsedHashDirective: Boolean IsParsedHashDirective +FSharp.Compiler.Syntax.ParsedHashDirective: Boolean get_IsParsedHashDirective() FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Syntax.ParsedHashDirective NewParsedHashDirective(System.String, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirectiveArgument], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Text.Range range @@ -5680,6 +5732,8 @@ FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: FSharp.Compiler.Text.Range g FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: Int32 Tag FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: System.String ToString() +FSharp.Compiler.Syntax.ParsedImplFile: Boolean IsParsedImplFile +FSharp.Compiler.Syntax.ParsedImplFile: Boolean get_IsParsedImplFile() FSharp.Compiler.Syntax.ParsedImplFile: FSharp.Compiler.Syntax.ParsedImplFile NewParsedImplFile(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedImplFileFragment]) FSharp.Compiler.Syntax.ParsedImplFile: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFile: Int32 get_Tag() @@ -5731,9 +5785,11 @@ FSharp.Compiler.Syntax.ParsedImplFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedImplFileFragment: System.String ToString() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsExe FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsLastCompiland +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsParsedImplFileInput FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsScript FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsExe() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsLastCompiland() +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsParsedImplFileInput() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_isScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean isScript @@ -5797,6 +5853,8 @@ FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[Sys FSharp.Compiler.Syntax.ParsedInput: System.String FileName FSharp.Compiler.Syntax.ParsedInput: System.String ToString() FSharp.Compiler.Syntax.ParsedInput: System.String get_FileName() +FSharp.Compiler.Syntax.ParsedScriptInteraction: Boolean IsDefinitions +FSharp.Compiler.Syntax.ParsedScriptInteraction: Boolean get_IsDefinitions() FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Syntax.ParsedScriptInteraction NewDefinitions(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Text.Range range @@ -5805,6 +5863,8 @@ FSharp.Compiler.Syntax.ParsedScriptInteraction: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedScriptInteraction: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl] defns FSharp.Compiler.Syntax.ParsedScriptInteraction: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl] get_defns() FSharp.Compiler.Syntax.ParsedScriptInteraction: System.String ToString() +FSharp.Compiler.Syntax.ParsedSigFile: Boolean IsParsedSigFile +FSharp.Compiler.Syntax.ParsedSigFile: Boolean get_IsParsedSigFile() FSharp.Compiler.Syntax.ParsedSigFile: FSharp.Compiler.Syntax.ParsedSigFile NewParsedSigFile(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedSigFileFragment]) FSharp.Compiler.Syntax.ParsedSigFile: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFile: Int32 get_Tag() @@ -5854,6 +5914,8 @@ FSharp.Compiler.Syntax.ParsedSigFileFragment: FSharp.Compiler.Syntax.ParsedSigFi FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileFragment: System.String ToString() +FSharp.Compiler.Syntax.ParsedSigFileInput: Boolean IsParsedSigFileInput +FSharp.Compiler.Syntax.ParsedSigFileInput: Boolean get_IsParsedSigFileInput() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() @@ -5926,6 +5988,8 @@ FSharp.Compiler.Syntax.PrettyNaming: System.String FormatAndOtherOverloadsString FSharp.Compiler.Syntax.PrettyNaming: System.String FsiDynamicModulePrefix FSharp.Compiler.Syntax.PrettyNaming: System.String NormalizeIdentifierBackticks(System.String) FSharp.Compiler.Syntax.PrettyNaming: System.String get_FsiDynamicModulePrefix() +FSharp.Compiler.Syntax.QualifiedNameOfFile: Boolean IsQualifiedNameOfFile +FSharp.Compiler.Syntax.QualifiedNameOfFile: Boolean get_IsQualifiedNameOfFile() FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident Id FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident Item FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident get_Id() @@ -5941,6 +6005,8 @@ FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String get_Text() FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma) FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object) FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.ScopedPragma: Boolean IsWarningOff +FSharp.Compiler.Syntax.ScopedPragma: Boolean get_IsWarningOff() FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Syntax.ScopedPragma NewWarningOff(FSharp.Compiler.Text.Range, Int32) FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range range @@ -5954,7 +6020,9 @@ FSharp.Compiler.Syntax.ScopedPragma: System.String ToString() FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.SeqExprOnly: Boolean IsSeqExprOnly FSharp.Compiler.Syntax.SeqExprOnly: Boolean Item +FSharp.Compiler.Syntax.SeqExprOnly: Boolean get_IsSeqExprOnly() FSharp.Compiler.Syntax.SeqExprOnly: Boolean get_Item() FSharp.Compiler.Syntax.SeqExprOnly: FSharp.Compiler.Syntax.SeqExprOnly NewSeqExprOnly(Boolean) FSharp.Compiler.Syntax.SeqExprOnly: Int32 CompareTo(FSharp.Compiler.Syntax.SeqExprOnly) @@ -5997,6 +6065,8 @@ FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode(System.Collections.IEquality FSharp.Compiler.Syntax.SynAccess: Int32 Tag FSharp.Compiler.Syntax.SynAccess: Int32 get_Tag() FSharp.Compiler.Syntax.SynAccess: System.String ToString() +FSharp.Compiler.Syntax.SynArgInfo: Boolean IsSynArgInfo +FSharp.Compiler.Syntax.SynArgInfo: Boolean get_IsSynArgInfo() FSharp.Compiler.Syntax.SynArgInfo: Boolean get_optional() FSharp.Compiler.Syntax.SynArgInfo: Boolean optional FSharp.Compiler.Syntax.SynArgInfo: FSharp.Compiler.Syntax.SynArgInfo NewSynArgInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident]) @@ -6053,6 +6123,8 @@ FSharp.Compiler.Syntax.SynAttributeList: Microsoft.FSharp.Collections.FSharpList FSharp.Compiler.Syntax.SynAttributeList: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttribute] get_Attributes() FSharp.Compiler.Syntax.SynAttributeList: System.String ToString() FSharp.Compiler.Syntax.SynAttributeList: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttribute], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynBinding: Boolean IsSynBinding +FSharp.Compiler.Syntax.SynBinding: Boolean get_IsSynBinding() FSharp.Compiler.Syntax.SynBinding: Boolean get_isInline() FSharp.Compiler.Syntax.SynBinding: Boolean get_isMutable() FSharp.Compiler.Syntax.SynBinding: Boolean isInline @@ -6116,6 +6188,8 @@ FSharp.Compiler.Syntax.SynBindingKind: Int32 GetHashCode(System.Collections.IEqu FSharp.Compiler.Syntax.SynBindingKind: Int32 Tag FSharp.Compiler.Syntax.SynBindingKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynBindingKind: System.String ToString() +FSharp.Compiler.Syntax.SynBindingReturnInfo: Boolean IsSynBindingReturnInfo +FSharp.Compiler.Syntax.SynBindingReturnInfo: Boolean get_IsSynBindingReturnInfo() FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynBindingReturnInfo NewSynBindingReturnInfo(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.SyntaxTrivia.SynBindingReturnInfoTrivia) FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynType get_typeName() FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynType typeName @@ -6150,6 +6224,8 @@ FSharp.Compiler.Syntax.SynByteStringKind: Int32 GetHashCode(System.Collections.I FSharp.Compiler.Syntax.SynByteStringKind: Int32 Tag FSharp.Compiler.Syntax.SynByteStringKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynByteStringKind: System.String ToString() +FSharp.Compiler.Syntax.SynComponentInfo: Boolean IsSynComponentInfo +FSharp.Compiler.Syntax.SynComponentInfo: Boolean get_IsSynComponentInfo() FSharp.Compiler.Syntax.SynComponentInfo: Boolean get_preferPostfix() FSharp.Compiler.Syntax.SynComponentInfo: Boolean preferPostfix FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Syntax.SynComponentInfo NewSynComponentInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) @@ -6349,6 +6425,8 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Text.Range Range(FSharp.Compile FSharp.Compiler.Syntax.SynConst: Int32 Tag FSharp.Compiler.Syntax.SynConst: Int32 get_Tag() FSharp.Compiler.Syntax.SynConst: System.String ToString() +FSharp.Compiler.Syntax.SynEnumCase: Boolean IsSynEnumCase +FSharp.Compiler.Syntax.SynEnumCase: Boolean get_IsSynEnumCase() FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynEnumCase NewSynEnumCase(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynEnumCaseTrivia) FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynExpr get_valueExpr() FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynExpr valueExpr @@ -6367,6 +6445,8 @@ FSharp.Compiler.Syntax.SynEnumCase: Int32 get_Tag() FSharp.Compiler.Syntax.SynEnumCase: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynEnumCase: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() FSharp.Compiler.Syntax.SynEnumCase: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionDefn: Boolean IsSynExceptionDefn +FSharp.Compiler.Syntax.SynExceptionDefn: Boolean get_IsSynExceptionDefn() FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefn NewSynExceptionDefn(FSharp.Compiler.Syntax.SynExceptionDefnRepr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefnRepr exnRepr FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefnRepr get_exnRepr() @@ -6381,6 +6461,8 @@ FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Collections.FSharpList FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_withKeyword() FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] withKeyword FSharp.Compiler.Syntax.SynExceptionDefn: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionDefnRepr: Boolean IsSynExceptionDefnRepr +FSharp.Compiler.Syntax.SynExceptionDefnRepr: Boolean get_IsSynExceptionDefnRepr() FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynExceptionDefnRepr NewSynExceptionDefnRepr(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynUnionCase, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]], FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynUnionCase caseName FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynUnionCase get_caseName() @@ -6399,6 +6481,8 @@ FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption` FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]] get_longId() FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]] longId FSharp.Compiler.Syntax.SynExceptionDefnRepr: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionSig: Boolean IsSynExceptionSig +FSharp.Compiler.Syntax.SynExceptionSig: Boolean get_IsSynExceptionSig() FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionDefnRepr exnRepr FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionDefnRepr get_exnRepr() FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionSig NewSynExceptionSig(FSharp.Compiler.Syntax.SynExceptionDefnRepr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range) @@ -7333,6 +7417,8 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Text.Range get_RangeWithoutAnyEx FSharp.Compiler.Syntax.SynExpr: Int32 Tag FSharp.Compiler.Syntax.SynExpr: Int32 get_Tag() FSharp.Compiler.Syntax.SynExpr: System.String ToString() +FSharp.Compiler.Syntax.SynExprAndBang: Boolean IsSynExprAndBang +FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_IsSynExprAndBang() FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_isFromSource() FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_isUse() FSharp.Compiler.Syntax.SynExprAndBang: Boolean isFromSource @@ -7351,6 +7437,8 @@ FSharp.Compiler.Syntax.SynExprAndBang: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExprAndBang: Int32 Tag FSharp.Compiler.Syntax.SynExprAndBang: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprAndBang: System.String ToString() +FSharp.Compiler.Syntax.SynExprRecordField: Boolean IsSynExprRecordField +FSharp.Compiler.Syntax.SynExprRecordField: Boolean get_IsSynExprRecordField() FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) FSharp.Compiler.Syntax.SynExprRecordField: Int32 Tag FSharp.Compiler.Syntax.SynExprRecordField: Int32 get_Tag() @@ -7363,6 +7451,8 @@ FSharp.Compiler.Syntax.SynExprRecordField: Microsoft.FSharp.Core.FSharpOption`1[ FSharp.Compiler.Syntax.SynExprRecordField: System.String ToString() FSharp.Compiler.Syntax.SynExprRecordField: System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean] fieldName FSharp.Compiler.Syntax.SynExprRecordField: System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean] get_fieldName() +FSharp.Compiler.Syntax.SynField: Boolean IsSynField +FSharp.Compiler.Syntax.SynField: Boolean get_IsSynField() FSharp.Compiler.Syntax.SynField: Boolean get_isMutable() FSharp.Compiler.Syntax.SynField: Boolean get_isStatic() FSharp.Compiler.Syntax.SynField: Boolean isMutable @@ -7387,6 +7477,8 @@ FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Com FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynField: System.String ToString() +FSharp.Compiler.Syntax.SynIdent: Boolean IsSynIdent +FSharp.Compiler.Syntax.SynIdent: Boolean get_IsSynIdent() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident get_ident() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.SynIdent NewSynIdent(FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]) @@ -7395,6 +7487,8 @@ FSharp.Compiler.Syntax.SynIdent: Int32 get_Tag() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] get_trivia() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] trivia FSharp.Compiler.Syntax.SynIdent: System.String ToString() +FSharp.Compiler.Syntax.SynInterfaceImpl: Boolean IsSynInterfaceImpl +FSharp.Compiler.Syntax.SynInterfaceImpl: Boolean get_IsSynInterfaceImpl() FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynInterfaceImpl NewSynInterfaceImpl(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynType get_interfaceTy() FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynType interfaceTy @@ -7431,7 +7525,9 @@ FSharp.Compiler.Syntax.SynInterpolatedStringPart: FSharp.Compiler.Syntax.SynInte FSharp.Compiler.Syntax.SynInterpolatedStringPart: Int32 Tag FSharp.Compiler.Syntax.SynInterpolatedStringPart: Int32 get_Tag() FSharp.Compiler.Syntax.SynInterpolatedStringPart: System.String ToString() +FSharp.Compiler.Syntax.SynLongIdent: Boolean IsSynLongIdent FSharp.Compiler.Syntax.SynLongIdent: Boolean ThereIsAnExtraDotAtTheEnd +FSharp.Compiler.Syntax.SynLongIdent: Boolean get_IsSynLongIdent() FSharp.Compiler.Syntax.SynLongIdent: Boolean get_ThereIsAnExtraDotAtTheEnd() FSharp.Compiler.Syntax.SynLongIdent: FSharp.Compiler.Syntax.SynLongIdent NewSynLongIdent(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]]) FSharp.Compiler.Syntax.SynLongIdent: FSharp.Compiler.Text.Range Range @@ -7457,6 +7553,8 @@ FSharp.Compiler.Syntax.SynLongIdent: Microsoft.FSharp.Collections.FSharpList`1[M FSharp.Compiler.Syntax.SynLongIdent: System.String ToString() FSharp.Compiler.Syntax.SynLongIdentHelpers: FSharp.Compiler.Syntax.SynLongIdent LongIdentWithDots(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.Syntax.SynLongIdentHelpers: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident],Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]] |LongIdentWithDots|(FSharp.Compiler.Syntax.SynLongIdent) +FSharp.Compiler.Syntax.SynMatchClause: Boolean IsSynMatchClause +FSharp.Compiler.Syntax.SynMatchClause: Boolean get_IsSynMatchClause() FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.DebugPointAtTarget debugPoint FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.DebugPointAtTarget get_debugPoint() FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.SynExpr get_resultExpr() @@ -7954,6 +8052,8 @@ FSharp.Compiler.Syntax.SynModuleDecl: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynModuleDecl: Int32 Tag FSharp.Compiler.Syntax.SynModuleDecl: Int32 get_Tag() FSharp.Compiler.Syntax.SynModuleDecl: System.String ToString() +FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean IsSynModuleOrNamespace +FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean get_IsSynModuleOrNamespace() FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean get_isRecursive() FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean isRecursive FSharp.Compiler.Syntax.SynModuleOrNamespace: FSharp.Compiler.Syntax.SynModuleOrNamespace NewSynModuleOrNamespace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Boolean, FSharp.Compiler.Syntax.SynModuleOrNamespaceKind, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl], FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynModuleOrNamespaceTrivia) @@ -8012,6 +8112,8 @@ FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 GetHashCode(System.Collec FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 Tag FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: System.String ToString() +FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean IsSynModuleOrNamespaceSig +FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean get_IsSynModuleOrNamespaceSig() FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean get_isRecursive() FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean isRecursive FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: FSharp.Compiler.Syntax.SynModuleOrNamespaceKind get_kind() @@ -8412,6 +8514,8 @@ FSharp.Compiler.Syntax.SynRationalConst: FSharp.Compiler.Syntax.SynRationalConst FSharp.Compiler.Syntax.SynRationalConst: Int32 Tag FSharp.Compiler.Syntax.SynRationalConst: Int32 get_Tag() FSharp.Compiler.Syntax.SynRationalConst: System.String ToString() +FSharp.Compiler.Syntax.SynReturnInfo: Boolean IsSynReturnInfo +FSharp.Compiler.Syntax.SynReturnInfo: Boolean get_IsSynReturnInfo() FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Syntax.SynReturnInfo NewSynReturnInfo(System.Tuple`2[FSharp.Compiler.Syntax.SynType,FSharp.Compiler.Syntax.SynArgInfo], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Text.Range get_Range() @@ -8485,6 +8589,8 @@ FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: FSharp.Compiler.Syntax.Syn FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: Int32 Tag FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: Int32 get_Tag() FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: System.String ToString() +FSharp.Compiler.Syntax.SynSimplePats: Boolean IsSimplePats +FSharp.Compiler.Syntax.SynSimplePats: Boolean get_IsSimplePats() FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Syntax.SynSimplePats NewSimplePats(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynSimplePat], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Text.Range get_Range() @@ -8575,6 +8681,8 @@ FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Text.Range get_Range FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 Tag FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 get_Tag() FSharp.Compiler.Syntax.SynTupleTypeSegment: System.String ToString() +FSharp.Compiler.Syntax.SynTypar: Boolean IsSynTypar +FSharp.Compiler.Syntax.SynTypar: Boolean get_IsSynTypar() FSharp.Compiler.Syntax.SynTypar: Boolean get_isCompGen() FSharp.Compiler.Syntax.SynTypar: Boolean isCompGen FSharp.Compiler.Syntax.SynTypar: FSharp.Compiler.Syntax.Ident get_ident() @@ -8587,6 +8695,8 @@ FSharp.Compiler.Syntax.SynTypar: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypar: Int32 Tag FSharp.Compiler.Syntax.SynTypar: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypar: System.String ToString() +FSharp.Compiler.Syntax.SynTyparDecl: Boolean IsSynTyparDecl +FSharp.Compiler.Syntax.SynTyparDecl: Boolean get_IsSynTyparDecl() FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTyparDecl NewSynTyparDecl(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynTypar, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.SyntaxTrivia.SynTyparDeclTrivia) @@ -8746,6 +8856,8 @@ FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Syntax.SynTy FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Syntax.SynType value FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType+Tags: Int32 Anon FSharp.Compiler.Syntax.SynType+Tags: Int32 AnonRecd FSharp.Compiler.Syntax.SynType+Tags: Int32 App @@ -8763,9 +8875,11 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 SignatureParameter FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstant FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantExpr FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNamed +FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNull FSharp.Compiler.Syntax.SynType+Tags: Int32 Tuple FSharp.Compiler.Syntax.SynType+Tags: Int32 Var FSharp.Compiler.Syntax.SynType+Tags: Int32 WithGlobalConstraints +FSharp.Compiler.Syntax.SynType+Tags: Int32 WithNull FSharp.Compiler.Syntax.SynType+Tuple: Boolean get_isStruct() FSharp.Compiler.Syntax.SynType+Tuple: Boolean isStruct FSharp.Compiler.Syntax.SynType+Tuple: FSharp.Compiler.Text.Range get_range() @@ -8782,6 +8896,12 @@ FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: FSharp.Compiler.Text.Range FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint] constraints FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint] get_constraints() +FSharp.Compiler.Syntax.SynType+WithNull: Boolean ambivalent +FSharp.Compiler.Syntax.SynType+WithNull: Boolean get_ambivalent() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType get_innerType() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType innerType +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType: Boolean IsAnon FSharp.Compiler.Syntax.SynType: Boolean IsAnonRecd FSharp.Compiler.Syntax.SynType: Boolean IsApp @@ -8799,9 +8919,11 @@ FSharp.Compiler.Syntax.SynType: Boolean IsSignatureParameter FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstant FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantExpr FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNamed +FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNull FSharp.Compiler.Syntax.SynType: Boolean IsTuple FSharp.Compiler.Syntax.SynType: Boolean IsVar FSharp.Compiler.Syntax.SynType: Boolean IsWithGlobalConstraints +FSharp.Compiler.Syntax.SynType: Boolean IsWithNull FSharp.Compiler.Syntax.SynType: Boolean get_IsAnon() FSharp.Compiler.Syntax.SynType: Boolean get_IsAnonRecd() FSharp.Compiler.Syntax.SynType: Boolean get_IsApp() @@ -8819,9 +8941,11 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsSignatureParameter() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstant() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantExpr() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNamed() +FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNull() FSharp.Compiler.Syntax.SynType: Boolean get_IsTuple() FSharp.Compiler.Syntax.SynType: Boolean get_IsVar() FSharp.Compiler.Syntax.SynType: Boolean get_IsWithGlobalConstraints() +FSharp.Compiler.Syntax.SynType: Boolean get_IsWithNull() FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewAnon(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewAnonRecd(Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[FSharp.Compiler.Syntax.Ident,FSharp.Compiler.Syntax.SynType]], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewApp(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Boolean, FSharp.Compiler.Text.Range) @@ -8839,9 +8963,11 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewSignatureParam FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNull(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTupleTypeSegment], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewVar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithGlobalConstraints(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithNull(FSharp.Compiler.Syntax.SynType, Boolean, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Anon FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+AnonRecd FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+App @@ -8859,10 +8985,12 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+SignatureParamete FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstant FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantExpr FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNamed +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNull FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Tags FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Tuple FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Var FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+WithGlobalConstraints +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+WithNull FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynType: Int32 Tag @@ -8877,6 +9005,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsNull @@ -8922,6 +9051,10 @@ FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler. FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar genericName +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar get_genericName() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynType get_typeName() @@ -8947,6 +9080,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsNull @@ -8959,6 +9093,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsEquatable() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsReferenceType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsUnmanaged() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsValueType() +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparNotSupportsNull() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSubtypeOfType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsMember() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsNull() @@ -8971,6 +9106,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstrai FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsReferenceType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsUnmanaged(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsValueType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparNotSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSubtypeOfType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsMember(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) @@ -8984,6 +9120,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstrai FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull @@ -8992,6 +9129,8 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeConstraint: Int32 Tag FSharp.Compiler.Syntax.SynTypeConstraint: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeConstraint: System.String ToString() +FSharp.Compiler.Syntax.SynTypeDefn: Boolean IsSynTypeDefn +FSharp.Compiler.Syntax.SynTypeDefn: Boolean get_IsSynTypeDefn() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo typeInfo FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynTypeDefn NewSynTypeDefn(FSharp.Compiler.Syntax.SynComponentInfo, FSharp.Compiler.Syntax.SynTypeDefnRepr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia) @@ -9108,6 +9247,8 @@ FSharp.Compiler.Syntax.SynTypeDefnRepr: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeDefnRepr: Int32 Tag FSharp.Compiler.Syntax.SynTypeDefnRepr: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeDefnRepr: System.String ToString() +FSharp.Compiler.Syntax.SynTypeDefnSig: Boolean IsSynTypeDefnSig +FSharp.Compiler.Syntax.SynTypeDefnSig: Boolean get_IsSynTypeDefnSig() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo typeInfo FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSig NewSynTypeDefnSig(FSharp.Compiler.Syntax.SynComponentInfo, FSharp.Compiler.Syntax.SynTypeDefnSigRepr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia) @@ -9249,6 +9390,8 @@ FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: FSharp.Compiler.Text.Range get_Ran FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: Int32 Tag FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: System.String ToString() +FSharp.Compiler.Syntax.SynUnionCase: Boolean IsSynUnionCase +FSharp.Compiler.Syntax.SynUnionCase: Boolean get_IsSynUnionCase() FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynIdent get_ident() FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynIdent ident FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynUnionCase NewSynUnionCase(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynUnionCaseKind, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynUnionCaseTrivia) @@ -9289,6 +9432,8 @@ FSharp.Compiler.Syntax.SynUnionCaseKind: FSharp.Compiler.Syntax.SynUnionCaseKind FSharp.Compiler.Syntax.SynUnionCaseKind: Int32 Tag FSharp.Compiler.Syntax.SynUnionCaseKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynUnionCaseKind: System.String ToString() +FSharp.Compiler.Syntax.SynValData: Boolean IsSynValData +FSharp.Compiler.Syntax.SynValData: Boolean get_IsSynValData() FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValData NewSynValData(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags], FSharp.Compiler.Syntax.SynValInfo, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident]) FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValInfo SynValInfo FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValInfo get_SynValInfo() @@ -9301,6 +9446,8 @@ FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.C FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags] get_memberFlags() FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags] memberFlags FSharp.Compiler.Syntax.SynValData: System.String ToString() +FSharp.Compiler.Syntax.SynValInfo: Boolean IsSynValInfo +FSharp.Compiler.Syntax.SynValInfo: Boolean get_IsSynValInfo() FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynArgInfo get_returnInfo() FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynArgInfo returnInfo FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynValInfo NewSynValInfo(Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynArgInfo]], FSharp.Compiler.Syntax.SynArgInfo) @@ -9313,6 +9460,8 @@ FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[Mic FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[System.String] ArgNames FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_ArgNames() FSharp.Compiler.Syntax.SynValInfo: System.String ToString() +FSharp.Compiler.Syntax.SynValSig: Boolean IsSynValSig +FSharp.Compiler.Syntax.SynValSig: Boolean get_IsSynValSig() FSharp.Compiler.Syntax.SynValSig: Boolean get_isInline() FSharp.Compiler.Syntax.SynValSig: Boolean get_isMutable() FSharp.Compiler.Syntax.SynValSig: Boolean isInline @@ -9347,7 +9496,9 @@ FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Co FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] get_synExpr() FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] synExpr FSharp.Compiler.Syntax.SynValSig: System.String ToString() +FSharp.Compiler.Syntax.SynValTyparDecls: Boolean IsSynValTyparDecls FSharp.Compiler.Syntax.SynValTyparDecls: Boolean canInfer +FSharp.Compiler.Syntax.SynValTyparDecls: Boolean get_IsSynValTyparDecls() FSharp.Compiler.Syntax.SynValTyparDecls: Boolean get_canInfer() FSharp.Compiler.Syntax.SynValTyparDecls: FSharp.Compiler.Syntax.SynValTyparDecls NewSynValTyparDecls(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Boolean) FSharp.Compiler.Syntax.SynValTyparDecls: Int32 Tag From a0f19f81a10a69cd2ea182b5218dbe708d055e47 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 5 Jan 2024 11:39:46 +0100 Subject: [PATCH 35/48] surface area --- ...vice.SurfaceArea.netstandard20.release.bsl | 184 +++++++++++++++--- 1 file changed, 152 insertions(+), 32 deletions(-) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 9c8364afe22..15b58c9aea1 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -296,10 +296,30 @@ FSharp.Compiler.AbstractIL.IL+ILAttribute: Int32 get_Tag() FSharp.Compiler.AbstractIL.IL+ILAttribute: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILAttributes: ILAttribute[] AsArray() FSharp.Compiler.AbstractIL.IL+ILAttributes: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILAttribute] AsList() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given: ILAttributes Item +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given: ILAttributes get_Item() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader: Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]] Item +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader: Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]] get_Item() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags: Int32 Given +FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags: Int32 Reader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean IsGiven +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean IsReader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean get_IsGiven() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Boolean get_IsReader() +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Given +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Reader +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: FSharp.Compiler.AbstractIL.IL+ILAttributesStored+Tags +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributes GetCustomAttrs(Int32) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributesStored NewGiven(ILAttributes) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: ILAttributesStored NewReader(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,FSharp.Compiler.AbstractIL.IL+ILAttribute[]]) +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Int32 Tag +FSharp.Compiler.AbstractIL.IL+ILAttributesStored: Int32 get_Tag() FSharp.Compiler.AbstractIL.IL+ILAttributesStored: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(ILCallingConv) FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(System.Object) FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean IsCallconv +FSharp.Compiler.AbstractIL.IL+ILCallingConv: Boolean get_IsCallconv() FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILArgConvention Item2 FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILArgConvention get_Item2() FSharp.Compiler.AbstractIL.IL+ILCallingConv: ILCallingConv Instance @@ -390,10 +410,14 @@ FSharp.Compiler.AbstractIL.IL+ILEventDef: Boolean get_IsRTSpecialName() FSharp.Compiler.AbstractIL.IL+ILEventDef: Boolean get_IsSpecialName() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILEventDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef AddMethod FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef RemoveMethod FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef get_AddMethod() FSharp.Compiler.AbstractIL.IL+ILEventDef: ILMethodRef get_RemoveMethod() +FSharp.Compiler.AbstractIL.IL+ILEventDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILEventDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] OtherMethods FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] get_OtherMethods() FSharp.Compiler.AbstractIL.IL+ILEventDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILMethodRef] FireMethod @@ -445,10 +469,14 @@ FSharp.Compiler.AbstractIL.IL+ILFieldDef: Boolean get_IsStatic() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Boolean get_NotSerialized() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILMemberAccess Access FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILMemberAccess get_Access() FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILType FieldType FSharp.Compiler.AbstractIL.IL+ILFieldDef: ILType get_FieldType() +FSharp.Compiler.AbstractIL.IL+ILFieldDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILFieldDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] LiteralValue FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] get_LiteralValue() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILNativeType] Marshal @@ -762,6 +790,8 @@ FSharp.Compiler.AbstractIL.IL+ILMethodDef: Boolean get_IsVirtual() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Boolean get_IsZeroInit() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingConv CallingConv FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingConv get_CallingConv() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILCallingSignature GetCallingSignature() @@ -774,7 +804,9 @@ FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILReturn get_Return() FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILSecurityDecls SecurityDecls FSharp.Compiler.AbstractIL.IL+ILMethodDef: ILSecurityDecls get_SecurityDecls() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 MaxStack +FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 MetadataIndex FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 get_MaxStack() +FSharp.Compiler.AbstractIL.IL+ILMethodDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILMethodDef: MethodBody Body FSharp.Compiler.AbstractIL.IL+ILMethodDef: MethodBody get_Body() FSharp.Compiler.AbstractIL.IL+ILMethodDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] GenericParams @@ -1230,10 +1262,14 @@ FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Boolean get_IsRTSpecialName() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Boolean get_IsSpecialName() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILThisConvention CallingConv FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILThisConvention get_CallingConv() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILType PropertyType FSharp.Compiler.AbstractIL.IL+ILPropertyDef: ILType get_PropertyType() +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] Args FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] get_Args() FSharp.Compiler.AbstractIL.IL+ILPropertyDef: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit] Init @@ -1490,6 +1526,8 @@ FSharp.Compiler.AbstractIL.IL+ILTypeDef: Boolean get_IsStruct() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Boolean get_IsStructOrEnum() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributes CustomAttrs FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributes get_CustomAttrs() +FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributesStored CustomAttrsStored +FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILAttributesStored get_CustomAttrsStored() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILDefaultPInvokeEncoding Encoding FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILDefaultPInvokeEncoding get_Encoding() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILEventDefs Events @@ -1511,6 +1549,8 @@ FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefLayout Layout FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefLayout get_Layout() FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefs NestedTypes FSharp.Compiler.AbstractIL.IL+ILTypeDef: ILTypeDefs get_NestedTypes() +FSharp.Compiler.AbstractIL.IL+ILTypeDef: Int32 MetadataIndex +FSharp.Compiler.AbstractIL.IL+ILTypeDef: Int32 get_MetadataIndex() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] GenericParams FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILGenericParameterDef] get_GenericParams() FSharp.Compiler.AbstractIL.IL+ILTypeDef: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.AbstractIL.IL+ILType] Implements @@ -4231,6 +4271,8 @@ FSharp.Compiler.EditorServices.ToolTipElementData: Void .ctor(Microsoft.FSharp.C FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(FSharp.Compiler.EditorServices.ToolTipText) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object) FSharp.Compiler.EditorServices.ToolTipText: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.EditorServices.ToolTipText: Boolean IsToolTipText +FSharp.Compiler.EditorServices.ToolTipText: Boolean get_IsToolTipText() FSharp.Compiler.EditorServices.ToolTipText: FSharp.Compiler.EditorServices.ToolTipText NewToolTipText(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.ToolTipElement]) FSharp.Compiler.EditorServices.ToolTipText: Int32 GetHashCode() FSharp.Compiler.EditorServices.ToolTipText: Int32 GetHashCode(System.Collections.IEqualityComparer) @@ -4274,6 +4316,8 @@ FSharp.Compiler.EditorServices.XmlDocParser: Microsoft.FSharp.Collections.FSharp FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(FSharp.Compiler.EditorServices.XmlDocable) FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(System.Object) FSharp.Compiler.EditorServices.XmlDocable: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.EditorServices.XmlDocable: Boolean IsXmlDocable +FSharp.Compiler.EditorServices.XmlDocable: Boolean get_IsXmlDocable() FSharp.Compiler.EditorServices.XmlDocable: FSharp.Compiler.EditorServices.XmlDocable NewXmlDocable(Int32, Int32, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.EditorServices.XmlDocable: Int32 CompareTo(FSharp.Compiler.EditorServices.XmlDocable) FSharp.Compiler.EditorServices.XmlDocable: Int32 CompareTo(System.Object) @@ -5298,21 +5342,25 @@ FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Symbols.FSharpField,FSharp.Compiler.Symbols.FSharpType]] |Field|_|(FSharp.Compiler.Symbols.FSharpSymbol) FSharp.Compiler.Symbols.FSharpSymbolPatterns: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[FSharp.Compiler.Symbols.FSharpEntity,FSharp.Compiler.Symbols.FSharpEntity,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpType]]] |FSharpEntity|_|(FSharp.Compiler.Symbols.FSharpSymbol) FSharp.Compiler.Symbols.FSharpType: Boolean Equals(System.Object) +FSharp.Compiler.Symbols.FSharpType: Boolean HasNullAnnotation FSharp.Compiler.Symbols.FSharpType: Boolean HasTypeDefinition FSharp.Compiler.Symbols.FSharpType: Boolean IsAbbreviation FSharp.Compiler.Symbols.FSharpType: Boolean IsAnonRecordType FSharp.Compiler.Symbols.FSharpType: Boolean IsFunctionType FSharp.Compiler.Symbols.FSharpType: Boolean IsGenericParameter FSharp.Compiler.Symbols.FSharpType: Boolean IsMeasureType +FSharp.Compiler.Symbols.FSharpType: Boolean IsNullAmbivalent FSharp.Compiler.Symbols.FSharpType: Boolean IsStructTupleType FSharp.Compiler.Symbols.FSharpType: Boolean IsTupleType FSharp.Compiler.Symbols.FSharpType: Boolean IsUnresolved +FSharp.Compiler.Symbols.FSharpType: Boolean get_HasNullAnnotation() FSharp.Compiler.Symbols.FSharpType: Boolean get_HasTypeDefinition() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAbbreviation() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsAnonRecordType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsFunctionType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsGenericParameter() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsMeasureType() +FSharp.Compiler.Symbols.FSharpType: Boolean get_IsNullAmbivalent() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsStructTupleType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsTupleType() FSharp.Compiler.Symbols.FSharpType: Boolean get_IsUnresolved() @@ -5508,6 +5556,8 @@ FSharp.Compiler.Syntax.DebugPointAtInOrTo: System.String ToString() FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(FSharp.Compiler.Syntax.DebugPointAtLeafExpr) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(System.Object) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean IsYes +FSharp.Compiler.Syntax.DebugPointAtLeafExpr: Boolean get_IsYes() FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Syntax.DebugPointAtLeafExpr NewYes(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Text.Range Item FSharp.Compiler.Syntax.DebugPointAtLeafExpr: FSharp.Compiler.Text.Range get_Item() @@ -5642,6 +5692,8 @@ FSharp.Compiler.Syntax.Ident: System.String ToString() FSharp.Compiler.Syntax.Ident: System.String get_idText() FSharp.Compiler.Syntax.Ident: System.String idText FSharp.Compiler.Syntax.Ident: Void .ctor(System.String, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.ParsedHashDirective: Boolean IsParsedHashDirective +FSharp.Compiler.Syntax.ParsedHashDirective: Boolean get_IsParsedHashDirective() FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Syntax.ParsedHashDirective NewParsedHashDirective(System.String, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirectiveArgument], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ParsedHashDirective: FSharp.Compiler.Text.Range range @@ -5680,6 +5732,8 @@ FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: FSharp.Compiler.Text.Range g FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: Int32 Tag FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedHashDirectiveArgument: System.String ToString() +FSharp.Compiler.Syntax.ParsedImplFile: Boolean IsParsedImplFile +FSharp.Compiler.Syntax.ParsedImplFile: Boolean get_IsParsedImplFile() FSharp.Compiler.Syntax.ParsedImplFile: FSharp.Compiler.Syntax.ParsedImplFile NewParsedImplFile(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedImplFileFragment]) FSharp.Compiler.Syntax.ParsedImplFile: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFile: Int32 get_Tag() @@ -5731,9 +5785,11 @@ FSharp.Compiler.Syntax.ParsedImplFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedImplFileFragment: System.String ToString() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsExe FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsLastCompiland +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsParsedImplFileInput FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean IsScript FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsExe() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsLastCompiland() +FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsParsedImplFileInput() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_isScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean isScript @@ -5797,6 +5853,8 @@ FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[Sys FSharp.Compiler.Syntax.ParsedInput: System.String FileName FSharp.Compiler.Syntax.ParsedInput: System.String ToString() FSharp.Compiler.Syntax.ParsedInput: System.String get_FileName() +FSharp.Compiler.Syntax.ParsedScriptInteraction: Boolean IsDefinitions +FSharp.Compiler.Syntax.ParsedScriptInteraction: Boolean get_IsDefinitions() FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Syntax.ParsedScriptInteraction NewDefinitions(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ParsedScriptInteraction: FSharp.Compiler.Text.Range range @@ -5805,6 +5863,8 @@ FSharp.Compiler.Syntax.ParsedScriptInteraction: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedScriptInteraction: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl] defns FSharp.Compiler.Syntax.ParsedScriptInteraction: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl] get_defns() FSharp.Compiler.Syntax.ParsedScriptInteraction: System.String ToString() +FSharp.Compiler.Syntax.ParsedSigFile: Boolean IsParsedSigFile +FSharp.Compiler.Syntax.ParsedSigFile: Boolean get_IsParsedSigFile() FSharp.Compiler.Syntax.ParsedSigFile: FSharp.Compiler.Syntax.ParsedSigFile NewParsedSigFile(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedSigFileFragment]) FSharp.Compiler.Syntax.ParsedSigFile: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFile: Int32 get_Tag() @@ -5854,6 +5914,8 @@ FSharp.Compiler.Syntax.ParsedSigFileFragment: FSharp.Compiler.Syntax.ParsedSigFi FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileFragment: System.String ToString() +FSharp.Compiler.Syntax.ParsedSigFileInput: Boolean IsParsedSigFileInput +FSharp.Compiler.Syntax.ParsedSigFileInput: Boolean get_IsParsedSigFileInput() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() @@ -5926,6 +5988,8 @@ FSharp.Compiler.Syntax.PrettyNaming: System.String FormatAndOtherOverloadsString FSharp.Compiler.Syntax.PrettyNaming: System.String FsiDynamicModulePrefix FSharp.Compiler.Syntax.PrettyNaming: System.String NormalizeIdentifierBackticks(System.String) FSharp.Compiler.Syntax.PrettyNaming: System.String get_FsiDynamicModulePrefix() +FSharp.Compiler.Syntax.QualifiedNameOfFile: Boolean IsQualifiedNameOfFile +FSharp.Compiler.Syntax.QualifiedNameOfFile: Boolean get_IsQualifiedNameOfFile() FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident Id FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident Item FSharp.Compiler.Syntax.QualifiedNameOfFile: FSharp.Compiler.Syntax.Ident get_Id() @@ -5941,6 +6005,8 @@ FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String get_Text() FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma) FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object) FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.ScopedPragma: Boolean IsWarningOff +FSharp.Compiler.Syntax.ScopedPragma: Boolean get_IsWarningOff() FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Syntax.ScopedPragma NewWarningOff(FSharp.Compiler.Text.Range, Int32) FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range range @@ -5954,7 +6020,9 @@ FSharp.Compiler.Syntax.ScopedPragma: System.String ToString() FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.Syntax.SeqExprOnly: Boolean IsSeqExprOnly FSharp.Compiler.Syntax.SeqExprOnly: Boolean Item +FSharp.Compiler.Syntax.SeqExprOnly: Boolean get_IsSeqExprOnly() FSharp.Compiler.Syntax.SeqExprOnly: Boolean get_Item() FSharp.Compiler.Syntax.SeqExprOnly: FSharp.Compiler.Syntax.SeqExprOnly NewSeqExprOnly(Boolean) FSharp.Compiler.Syntax.SeqExprOnly: Int32 CompareTo(FSharp.Compiler.Syntax.SeqExprOnly) @@ -5997,6 +6065,8 @@ FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode(System.Collections.IEquality FSharp.Compiler.Syntax.SynAccess: Int32 Tag FSharp.Compiler.Syntax.SynAccess: Int32 get_Tag() FSharp.Compiler.Syntax.SynAccess: System.String ToString() +FSharp.Compiler.Syntax.SynArgInfo: Boolean IsSynArgInfo +FSharp.Compiler.Syntax.SynArgInfo: Boolean get_IsSynArgInfo() FSharp.Compiler.Syntax.SynArgInfo: Boolean get_optional() FSharp.Compiler.Syntax.SynArgInfo: Boolean optional FSharp.Compiler.Syntax.SynArgInfo: FSharp.Compiler.Syntax.SynArgInfo NewSynArgInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident]) @@ -6053,6 +6123,8 @@ FSharp.Compiler.Syntax.SynAttributeList: Microsoft.FSharp.Collections.FSharpList FSharp.Compiler.Syntax.SynAttributeList: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttribute] get_Attributes() FSharp.Compiler.Syntax.SynAttributeList: System.String ToString() FSharp.Compiler.Syntax.SynAttributeList: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttribute], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynBinding: Boolean IsSynBinding +FSharp.Compiler.Syntax.SynBinding: Boolean get_IsSynBinding() FSharp.Compiler.Syntax.SynBinding: Boolean get_isInline() FSharp.Compiler.Syntax.SynBinding: Boolean get_isMutable() FSharp.Compiler.Syntax.SynBinding: Boolean isInline @@ -6116,6 +6188,8 @@ FSharp.Compiler.Syntax.SynBindingKind: Int32 GetHashCode(System.Collections.IEqu FSharp.Compiler.Syntax.SynBindingKind: Int32 Tag FSharp.Compiler.Syntax.SynBindingKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynBindingKind: System.String ToString() +FSharp.Compiler.Syntax.SynBindingReturnInfo: Boolean IsSynBindingReturnInfo +FSharp.Compiler.Syntax.SynBindingReturnInfo: Boolean get_IsSynBindingReturnInfo() FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynBindingReturnInfo NewSynBindingReturnInfo(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.SyntaxTrivia.SynBindingReturnInfoTrivia) FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynType get_typeName() FSharp.Compiler.Syntax.SynBindingReturnInfo: FSharp.Compiler.Syntax.SynType typeName @@ -6150,6 +6224,8 @@ FSharp.Compiler.Syntax.SynByteStringKind: Int32 GetHashCode(System.Collections.I FSharp.Compiler.Syntax.SynByteStringKind: Int32 Tag FSharp.Compiler.Syntax.SynByteStringKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynByteStringKind: System.String ToString() +FSharp.Compiler.Syntax.SynComponentInfo: Boolean IsSynComponentInfo +FSharp.Compiler.Syntax.SynComponentInfo: Boolean get_IsSynComponentInfo() FSharp.Compiler.Syntax.SynComponentInfo: Boolean get_preferPostfix() FSharp.Compiler.Syntax.SynComponentInfo: Boolean preferPostfix FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Syntax.SynComponentInfo NewSynComponentInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) @@ -6349,6 +6425,8 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Text.Range Range(FSharp.Compile FSharp.Compiler.Syntax.SynConst: Int32 Tag FSharp.Compiler.Syntax.SynConst: Int32 get_Tag() FSharp.Compiler.Syntax.SynConst: System.String ToString() +FSharp.Compiler.Syntax.SynEnumCase: Boolean IsSynEnumCase +FSharp.Compiler.Syntax.SynEnumCase: Boolean get_IsSynEnumCase() FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynEnumCase NewSynEnumCase(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Xml.PreXmlDoc, FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynEnumCaseTrivia) FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynExpr get_valueExpr() FSharp.Compiler.Syntax.SynEnumCase: FSharp.Compiler.Syntax.SynExpr valueExpr @@ -6367,6 +6445,8 @@ FSharp.Compiler.Syntax.SynEnumCase: Int32 get_Tag() FSharp.Compiler.Syntax.SynEnumCase: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynEnumCase: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() FSharp.Compiler.Syntax.SynEnumCase: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionDefn: Boolean IsSynExceptionDefn +FSharp.Compiler.Syntax.SynExceptionDefn: Boolean get_IsSynExceptionDefn() FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefn NewSynExceptionDefn(FSharp.Compiler.Syntax.SynExceptionDefnRepr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefnRepr exnRepr FSharp.Compiler.Syntax.SynExceptionDefn: FSharp.Compiler.Syntax.SynExceptionDefnRepr get_exnRepr() @@ -6381,6 +6461,8 @@ FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Collections.FSharpList FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_withKeyword() FSharp.Compiler.Syntax.SynExceptionDefn: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] withKeyword FSharp.Compiler.Syntax.SynExceptionDefn: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionDefnRepr: Boolean IsSynExceptionDefnRepr +FSharp.Compiler.Syntax.SynExceptionDefnRepr: Boolean get_IsSynExceptionDefnRepr() FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynExceptionDefnRepr NewSynExceptionDefnRepr(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynUnionCase, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]], FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynUnionCase caseName FSharp.Compiler.Syntax.SynExceptionDefnRepr: FSharp.Compiler.Syntax.SynUnionCase get_caseName() @@ -6399,6 +6481,8 @@ FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption` FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]] get_longId() FSharp.Compiler.Syntax.SynExceptionDefnRepr: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident]] longId FSharp.Compiler.Syntax.SynExceptionDefnRepr: System.String ToString() +FSharp.Compiler.Syntax.SynExceptionSig: Boolean IsSynExceptionSig +FSharp.Compiler.Syntax.SynExceptionSig: Boolean get_IsSynExceptionSig() FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionDefnRepr exnRepr FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionDefnRepr get_exnRepr() FSharp.Compiler.Syntax.SynExceptionSig: FSharp.Compiler.Syntax.SynExceptionSig NewSynExceptionSig(FSharp.Compiler.Syntax.SynExceptionDefnRepr, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range) @@ -7333,6 +7417,8 @@ FSharp.Compiler.Syntax.SynExpr: FSharp.Compiler.Text.Range get_RangeWithoutAnyEx FSharp.Compiler.Syntax.SynExpr: Int32 Tag FSharp.Compiler.Syntax.SynExpr: Int32 get_Tag() FSharp.Compiler.Syntax.SynExpr: System.String ToString() +FSharp.Compiler.Syntax.SynExprAndBang: Boolean IsSynExprAndBang +FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_IsSynExprAndBang() FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_isFromSource() FSharp.Compiler.Syntax.SynExprAndBang: Boolean get_isUse() FSharp.Compiler.Syntax.SynExprAndBang: Boolean isFromSource @@ -7351,6 +7437,8 @@ FSharp.Compiler.Syntax.SynExprAndBang: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExprAndBang: Int32 Tag FSharp.Compiler.Syntax.SynExprAndBang: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprAndBang: System.String ToString() +FSharp.Compiler.Syntax.SynExprRecordField: Boolean IsSynExprRecordField +FSharp.Compiler.Syntax.SynExprRecordField: Boolean get_IsSynExprRecordField() FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) FSharp.Compiler.Syntax.SynExprRecordField: Int32 Tag FSharp.Compiler.Syntax.SynExprRecordField: Int32 get_Tag() @@ -7363,6 +7451,8 @@ FSharp.Compiler.Syntax.SynExprRecordField: Microsoft.FSharp.Core.FSharpOption`1[ FSharp.Compiler.Syntax.SynExprRecordField: System.String ToString() FSharp.Compiler.Syntax.SynExprRecordField: System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean] fieldName FSharp.Compiler.Syntax.SynExprRecordField: System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean] get_fieldName() +FSharp.Compiler.Syntax.SynField: Boolean IsSynField +FSharp.Compiler.Syntax.SynField: Boolean get_IsSynField() FSharp.Compiler.Syntax.SynField: Boolean get_isMutable() FSharp.Compiler.Syntax.SynField: Boolean get_isStatic() FSharp.Compiler.Syntax.SynField: Boolean isMutable @@ -7387,6 +7477,8 @@ FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Com FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] accessibility FSharp.Compiler.Syntax.SynField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynField: System.String ToString() +FSharp.Compiler.Syntax.SynIdent: Boolean IsSynIdent +FSharp.Compiler.Syntax.SynIdent: Boolean get_IsSynIdent() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident get_ident() FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.Ident ident FSharp.Compiler.Syntax.SynIdent: FSharp.Compiler.Syntax.SynIdent NewSynIdent(FSharp.Compiler.Syntax.Ident, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]) @@ -7395,6 +7487,8 @@ FSharp.Compiler.Syntax.SynIdent: Int32 get_Tag() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] get_trivia() FSharp.Compiler.Syntax.SynIdent: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia] trivia FSharp.Compiler.Syntax.SynIdent: System.String ToString() +FSharp.Compiler.Syntax.SynInterfaceImpl: Boolean IsSynInterfaceImpl +FSharp.Compiler.Syntax.SynInterfaceImpl: Boolean get_IsSynInterfaceImpl() FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynInterfaceImpl NewSynInterfaceImpl(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynBinding], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynType get_interfaceTy() FSharp.Compiler.Syntax.SynInterfaceImpl: FSharp.Compiler.Syntax.SynType interfaceTy @@ -7431,7 +7525,9 @@ FSharp.Compiler.Syntax.SynInterpolatedStringPart: FSharp.Compiler.Syntax.SynInte FSharp.Compiler.Syntax.SynInterpolatedStringPart: Int32 Tag FSharp.Compiler.Syntax.SynInterpolatedStringPart: Int32 get_Tag() FSharp.Compiler.Syntax.SynInterpolatedStringPart: System.String ToString() +FSharp.Compiler.Syntax.SynLongIdent: Boolean IsSynLongIdent FSharp.Compiler.Syntax.SynLongIdent: Boolean ThereIsAnExtraDotAtTheEnd +FSharp.Compiler.Syntax.SynLongIdent: Boolean get_IsSynLongIdent() FSharp.Compiler.Syntax.SynLongIdent: Boolean get_ThereIsAnExtraDotAtTheEnd() FSharp.Compiler.Syntax.SynLongIdent: FSharp.Compiler.Syntax.SynLongIdent NewSynLongIdent(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.SyntaxTrivia.IdentTrivia]]) FSharp.Compiler.Syntax.SynLongIdent: FSharp.Compiler.Text.Range Range @@ -7457,6 +7553,8 @@ FSharp.Compiler.Syntax.SynLongIdent: Microsoft.FSharp.Collections.FSharpList`1[M FSharp.Compiler.Syntax.SynLongIdent: System.String ToString() FSharp.Compiler.Syntax.SynLongIdentHelpers: FSharp.Compiler.Syntax.SynLongIdent LongIdentWithDots(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.Syntax.SynLongIdentHelpers: System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident],Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]] |LongIdentWithDots|(FSharp.Compiler.Syntax.SynLongIdent) +FSharp.Compiler.Syntax.SynMatchClause: Boolean IsSynMatchClause +FSharp.Compiler.Syntax.SynMatchClause: Boolean get_IsSynMatchClause() FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.DebugPointAtTarget debugPoint FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.DebugPointAtTarget get_debugPoint() FSharp.Compiler.Syntax.SynMatchClause: FSharp.Compiler.Syntax.SynExpr get_resultExpr() @@ -7954,6 +8052,8 @@ FSharp.Compiler.Syntax.SynModuleDecl: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynModuleDecl: Int32 Tag FSharp.Compiler.Syntax.SynModuleDecl: Int32 get_Tag() FSharp.Compiler.Syntax.SynModuleDecl: System.String ToString() +FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean IsSynModuleOrNamespace +FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean get_IsSynModuleOrNamespace() FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean get_isRecursive() FSharp.Compiler.Syntax.SynModuleOrNamespace: Boolean isRecursive FSharp.Compiler.Syntax.SynModuleOrNamespace: FSharp.Compiler.Syntax.SynModuleOrNamespace NewSynModuleOrNamespace(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], Boolean, FSharp.Compiler.Syntax.SynModuleOrNamespaceKind, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleDecl], FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynModuleOrNamespaceTrivia) @@ -8012,6 +8112,8 @@ FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 GetHashCode(System.Collec FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 Tag FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynModuleOrNamespaceKind: System.String ToString() +FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean IsSynModuleOrNamespaceSig +FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean get_IsSynModuleOrNamespaceSig() FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean get_isRecursive() FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: Boolean isRecursive FSharp.Compiler.Syntax.SynModuleOrNamespaceSig: FSharp.Compiler.Syntax.SynModuleOrNamespaceKind get_kind() @@ -8412,6 +8514,8 @@ FSharp.Compiler.Syntax.SynRationalConst: FSharp.Compiler.Syntax.SynRationalConst FSharp.Compiler.Syntax.SynRationalConst: Int32 Tag FSharp.Compiler.Syntax.SynRationalConst: Int32 get_Tag() FSharp.Compiler.Syntax.SynRationalConst: System.String ToString() +FSharp.Compiler.Syntax.SynReturnInfo: Boolean IsSynReturnInfo +FSharp.Compiler.Syntax.SynReturnInfo: Boolean get_IsSynReturnInfo() FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Syntax.SynReturnInfo NewSynReturnInfo(System.Tuple`2[FSharp.Compiler.Syntax.SynType,FSharp.Compiler.Syntax.SynArgInfo], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynReturnInfo: FSharp.Compiler.Text.Range get_Range() @@ -8485,6 +8589,8 @@ FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: FSharp.Compiler.Syntax.Syn FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: Int32 Tag FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: Int32 get_Tag() FSharp.Compiler.Syntax.SynSimplePatAlternativeIdInfo: System.String ToString() +FSharp.Compiler.Syntax.SynSimplePats: Boolean IsSimplePats +FSharp.Compiler.Syntax.SynSimplePats: Boolean get_IsSimplePats() FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Syntax.SynSimplePats NewSimplePats(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynSimplePat], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynSimplePats: FSharp.Compiler.Text.Range get_Range() @@ -8575,6 +8681,8 @@ FSharp.Compiler.Syntax.SynTupleTypeSegment: FSharp.Compiler.Text.Range get_Range FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 Tag FSharp.Compiler.Syntax.SynTupleTypeSegment: Int32 get_Tag() FSharp.Compiler.Syntax.SynTupleTypeSegment: System.String ToString() +FSharp.Compiler.Syntax.SynTypar: Boolean IsSynTypar +FSharp.Compiler.Syntax.SynTypar: Boolean get_IsSynTypar() FSharp.Compiler.Syntax.SynTypar: Boolean get_isCompGen() FSharp.Compiler.Syntax.SynTypar: Boolean isCompGen FSharp.Compiler.Syntax.SynTypar: FSharp.Compiler.Syntax.Ident get_ident() @@ -8587,6 +8695,8 @@ FSharp.Compiler.Syntax.SynTypar: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypar: Int32 Tag FSharp.Compiler.Syntax.SynTypar: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypar: System.String ToString() +FSharp.Compiler.Syntax.SynTyparDecl: Boolean IsSynTyparDecl +FSharp.Compiler.Syntax.SynTyparDecl: Boolean get_IsSynTyparDecl() FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTyparDecl: FSharp.Compiler.Syntax.SynTyparDecl NewSynTyparDecl(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynTypar, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.SyntaxTrivia.SynTyparDeclTrivia) @@ -8746,6 +8856,8 @@ FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Syntax.SynTy FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Syntax.SynType value FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynType+StaticConstantNamed: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType+Tags: Int32 Anon FSharp.Compiler.Syntax.SynType+Tags: Int32 AnonRecd FSharp.Compiler.Syntax.SynType+Tags: Int32 App @@ -8763,9 +8875,11 @@ FSharp.Compiler.Syntax.SynType+Tags: Int32 SignatureParameter FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstant FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantExpr FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNamed +FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNull FSharp.Compiler.Syntax.SynType+Tags: Int32 Tuple FSharp.Compiler.Syntax.SynType+Tags: Int32 Var FSharp.Compiler.Syntax.SynType+Tags: Int32 WithGlobalConstraints +FSharp.Compiler.Syntax.SynType+Tags: Int32 WithNull FSharp.Compiler.Syntax.SynType+Tuple: Boolean get_isStruct() FSharp.Compiler.Syntax.SynType+Tuple: Boolean isStruct FSharp.Compiler.Syntax.SynType+Tuple: FSharp.Compiler.Text.Range get_range() @@ -8782,6 +8896,12 @@ FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: FSharp.Compiler.Text.Range FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint] constraints FSharp.Compiler.Syntax.SynType+WithGlobalConstraints: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint] get_constraints() +FSharp.Compiler.Syntax.SynType+WithNull: Boolean ambivalent +FSharp.Compiler.Syntax.SynType+WithNull: Boolean get_ambivalent() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType get_innerType() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType innerType +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynType: Boolean IsAnon FSharp.Compiler.Syntax.SynType: Boolean IsAnonRecd FSharp.Compiler.Syntax.SynType: Boolean IsApp @@ -8799,9 +8919,11 @@ FSharp.Compiler.Syntax.SynType: Boolean IsSignatureParameter FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstant FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantExpr FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNamed +FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNull FSharp.Compiler.Syntax.SynType: Boolean IsTuple FSharp.Compiler.Syntax.SynType: Boolean IsVar FSharp.Compiler.Syntax.SynType: Boolean IsWithGlobalConstraints +FSharp.Compiler.Syntax.SynType: Boolean IsWithNull FSharp.Compiler.Syntax.SynType: Boolean get_IsAnon() FSharp.Compiler.Syntax.SynType: Boolean get_IsAnonRecd() FSharp.Compiler.Syntax.SynType: Boolean get_IsApp() @@ -8819,9 +8941,11 @@ FSharp.Compiler.Syntax.SynType: Boolean get_IsSignatureParameter() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstant() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantExpr() FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNamed() +FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNull() FSharp.Compiler.Syntax.SynType: Boolean get_IsTuple() FSharp.Compiler.Syntax.SynType: Boolean get_IsVar() FSharp.Compiler.Syntax.SynType: Boolean get_IsWithGlobalConstraints() +FSharp.Compiler.Syntax.SynType: Boolean get_IsWithNull() FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewAnon(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewAnonRecd(Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[FSharp.Compiler.Syntax.Ident,FSharp.Compiler.Syntax.SynType]], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewApp(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynType], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Boolean, FSharp.Compiler.Text.Range) @@ -8839,9 +8963,11 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewSignatureParam FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstant(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantExpr(FSharp.Compiler.Syntax.SynExpr, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNamed(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNull(FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewTuple(Boolean, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTupleTypeSegment], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewVar(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithGlobalConstraints(FSharp.Compiler.Syntax.SynType, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithNull(FSharp.Compiler.Syntax.SynType, Boolean, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Anon FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+AnonRecd FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+App @@ -8859,10 +8985,12 @@ FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+SignatureParamete FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstant FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantExpr FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNamed +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNull FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Tags FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Tuple FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+Var FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+WithGlobalConstraints +FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+WithNull FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynType: Int32 Tag @@ -8877,6 +9005,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparSupportsNull @@ -8922,6 +9051,10 @@ FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler. FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Text.Range get_range() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar genericName +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar get_genericName() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynTypar get_typar() FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynTypar typar FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType: FSharp.Compiler.Syntax.SynType get_typeName() @@ -8947,6 +9080,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsEquatable FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparSupportsNull @@ -8959,6 +9093,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsEquatable() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsReferenceType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsUnmanaged() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparIsValueType() +FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparNotSupportsNull() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSubtypeOfType() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsMember() FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparSupportsNull() @@ -8971,6 +9106,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstrai FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsReferenceType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsUnmanaged(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparIsValueType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparNotSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSubtypeOfType(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsMember(FSharp.Compiler.Syntax.SynType, FSharp.Compiler.Syntax.SynMemberSig, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) @@ -8984,6 +9120,7 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstrai FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsReferenceType FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsUnmanaged FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparIsValueType +FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSubtypeOfType FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsMember FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparSupportsNull @@ -8992,6 +9129,8 @@ FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeConstraint: Int32 Tag FSharp.Compiler.Syntax.SynTypeConstraint: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeConstraint: System.String ToString() +FSharp.Compiler.Syntax.SynTypeDefn: Boolean IsSynTypeDefn +FSharp.Compiler.Syntax.SynTypeDefn: Boolean get_IsSynTypeDefn() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynComponentInfo typeInfo FSharp.Compiler.Syntax.SynTypeDefn: FSharp.Compiler.Syntax.SynTypeDefn NewSynTypeDefn(FSharp.Compiler.Syntax.SynComponentInfo, FSharp.Compiler.Syntax.SynTypeDefnRepr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberDefn], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberDefn], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeDefnTrivia) @@ -9108,6 +9247,8 @@ FSharp.Compiler.Syntax.SynTypeDefnRepr: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynTypeDefnRepr: Int32 Tag FSharp.Compiler.Syntax.SynTypeDefnRepr: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeDefnRepr: System.String ToString() +FSharp.Compiler.Syntax.SynTypeDefnSig: Boolean IsSynTypeDefnSig +FSharp.Compiler.Syntax.SynTypeDefnSig: Boolean get_IsSynTypeDefnSig() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo get_typeInfo() FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynComponentInfo typeInfo FSharp.Compiler.Syntax.SynTypeDefnSig: FSharp.Compiler.Syntax.SynTypeDefnSig NewSynTypeDefnSig(FSharp.Compiler.Syntax.SynComponentInfo, FSharp.Compiler.Syntax.SynTypeDefnSigRepr, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynMemberSig], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynTypeDefnSigTrivia) @@ -9249,6 +9390,8 @@ FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: FSharp.Compiler.Text.Range get_Ran FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: Int32 Tag FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: Int32 get_Tag() FSharp.Compiler.Syntax.SynTypeDefnSimpleRepr: System.String ToString() +FSharp.Compiler.Syntax.SynUnionCase: Boolean IsSynUnionCase +FSharp.Compiler.Syntax.SynUnionCase: Boolean get_IsSynUnionCase() FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynIdent get_ident() FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynIdent ident FSharp.Compiler.Syntax.SynUnionCase: FSharp.Compiler.Syntax.SynUnionCase NewSynUnionCase(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], FSharp.Compiler.Syntax.SynIdent, FSharp.Compiler.Syntax.SynUnionCaseKind, FSharp.Compiler.Xml.PreXmlDoc, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range, FSharp.Compiler.SyntaxTrivia.SynUnionCaseTrivia) @@ -9289,6 +9432,8 @@ FSharp.Compiler.Syntax.SynUnionCaseKind: FSharp.Compiler.Syntax.SynUnionCaseKind FSharp.Compiler.Syntax.SynUnionCaseKind: Int32 Tag FSharp.Compiler.Syntax.SynUnionCaseKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynUnionCaseKind: System.String ToString() +FSharp.Compiler.Syntax.SynValData: Boolean IsSynValData +FSharp.Compiler.Syntax.SynValData: Boolean get_IsSynValData() FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValData NewSynValData(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags], FSharp.Compiler.Syntax.SynValInfo, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.Ident]) FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValInfo SynValInfo FSharp.Compiler.Syntax.SynValData: FSharp.Compiler.Syntax.SynValInfo get_SynValInfo() @@ -9301,6 +9446,8 @@ FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.C FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags] get_memberFlags() FSharp.Compiler.Syntax.SynValData: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynMemberFlags] memberFlags FSharp.Compiler.Syntax.SynValData: System.String ToString() +FSharp.Compiler.Syntax.SynValInfo: Boolean IsSynValInfo +FSharp.Compiler.Syntax.SynValInfo: Boolean get_IsSynValInfo() FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynArgInfo get_returnInfo() FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynArgInfo returnInfo FSharp.Compiler.Syntax.SynValInfo: FSharp.Compiler.Syntax.SynValInfo NewSynValInfo(Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynArgInfo]], FSharp.Compiler.Syntax.SynArgInfo) @@ -9313,6 +9460,8 @@ FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[Mic FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[System.String] ArgNames FSharp.Compiler.Syntax.SynValInfo: Microsoft.FSharp.Collections.FSharpList`1[System.String] get_ArgNames() FSharp.Compiler.Syntax.SynValInfo: System.String ToString() +FSharp.Compiler.Syntax.SynValSig: Boolean IsSynValSig +FSharp.Compiler.Syntax.SynValSig: Boolean get_IsSynValSig() FSharp.Compiler.Syntax.SynValSig: Boolean get_isInline() FSharp.Compiler.Syntax.SynValSig: Boolean get_isMutable() FSharp.Compiler.Syntax.SynValSig: Boolean isInline @@ -9347,7 +9496,9 @@ FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Co FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] get_synExpr() FSharp.Compiler.Syntax.SynValSig: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] synExpr FSharp.Compiler.Syntax.SynValSig: System.String ToString() +FSharp.Compiler.Syntax.SynValTyparDecls: Boolean IsSynValTyparDecls FSharp.Compiler.Syntax.SynValTyparDecls: Boolean canInfer +FSharp.Compiler.Syntax.SynValTyparDecls: Boolean get_IsSynValTyparDecls() FSharp.Compiler.Syntax.SynValTyparDecls: Boolean get_canInfer() FSharp.Compiler.Syntax.SynValTyparDecls: FSharp.Compiler.Syntax.SynValTyparDecls NewSynValTyparDecls(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Boolean) FSharp.Compiler.Syntax.SynValTyparDecls: Int32 Tag @@ -11718,37 +11869,6 @@ FSharp.Compiler.Xml.XmlDoc: System.String[] GetElaboratedXmlLines() FSharp.Compiler.Xml.XmlDoc: System.String[] UnprocessedLines FSharp.Compiler.Xml.XmlDoc: System.String[] get_UnprocessedLines() FSharp.Compiler.Xml.XmlDoc: Void .ctor(System.String[], FSharp.Compiler.Text.Range) -FSharp.Compiler.Symbols.FSharpType: Boolean HasNullAnnotation -FSharp.Compiler.Symbols.FSharpType: Boolean IsNullAmbivalent -FSharp.Compiler.Symbols.FSharpType: Boolean get_HasNullAnnotation() -FSharp.Compiler.Symbols.FSharpType: Boolean get_IsNullAmbivalent() -FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynType+StaticConstantNull: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynType+Tags: Int32 StaticConstantNull -FSharp.Compiler.Syntax.SynType+Tags: Int32 WithNull -FSharp.Compiler.Syntax.SynType+WithNull: Boolean ambivalent -FSharp.Compiler.Syntax.SynType+WithNull: Boolean get_ambivalent() -FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType get_innerType() -FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Syntax.SynType innerType -FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynType+WithNull: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynType: Boolean IsStaticConstantNull -FSharp.Compiler.Syntax.SynType: Boolean IsWithNull -FSharp.Compiler.Syntax.SynType: Boolean get_IsStaticConstantNull() -FSharp.Compiler.Syntax.SynType: Boolean get_IsWithNull() -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewStaticConstantNull(FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType NewWithNull(FSharp.Compiler.Syntax.SynType, Boolean, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+StaticConstantNull -FSharp.Compiler.Syntax.SynType: FSharp.Compiler.Syntax.SynType+WithNull -FSharp.Compiler.Syntax.SynTypeConstraint+Tags: Int32 WhereTyparNotSupportsNull -FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar genericName -FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Syntax.SynTypar get_genericName() -FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynTypeConstraint: Boolean IsWhereTyparNotSupportsNull -FSharp.Compiler.Syntax.SynTypeConstraint: Boolean get_IsWhereTyparNotSupportsNull() -FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint NewWhereTyparNotSupportsNull(FSharp.Compiler.Syntax.SynTypar, FSharp.Compiler.Text.Range) -FSharp.Compiler.Syntax.SynTypeConstraint: FSharp.Compiler.Syntax.SynTypeConstraint+WhereTyparNotSupportsNull Internal.Utilities.Library.DelayInitArrayMap`3[T,TDictKey,TDictValue]: System.Collections.Generic.IDictionary`2[TDictKey,TDictValue] CreateDictionary(T[]) Internal.Utilities.Library.DelayInitArrayMap`3[T,TDictKey,TDictValue]: System.Collections.Generic.IDictionary`2[TDictKey,TDictValue] GetDictionary() Internal.Utilities.Library.DelayInitArrayMap`3[T,TDictKey,TDictValue]: T[] GetArray() @@ -11760,4 +11880,4 @@ Internal.Utilities.Library.InterruptibleLazy`1[T]: Internal.Utilities.Library.In Internal.Utilities.Library.InterruptibleLazy`1[T]: T Force() Internal.Utilities.Library.InterruptibleLazy`1[T]: T Value Internal.Utilities.Library.InterruptibleLazy`1[T]: T get_Value() -Internal.Utilities.Library.InterruptibleLazy`1[T]: Void .ctor(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) +Internal.Utilities.Library.InterruptibleLazy`1[T]: Void .ctor(Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T]) \ No newline at end of file From 356776528a47889761b974c8ac86d3cf9d8ece7e Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 5 Jan 2024 12:05:19 +0100 Subject: [PATCH 36/48] cosmetic cleanup & annotations --- src/Compiler/Checking/CheckDeclarations.fs | 2 ++ src/Compiler/CodeGen/EraseUnions.fs | 7 +------ src/Compiler/TypedTree/TypedTreePickle.fs | 18 ++++++++---------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 8e6f82a5bf5..1a958832ce6 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -4708,6 +4708,8 @@ module TcDeclarations = MutRecBindingChecking.TcMutRecDefns_UpdateModuleContents mutRecNSInfo mutRecDefnsAfterVals // Generate the union augmentation values for all tycons. + // TODO nullness :: this is the handling of DU .Is* properties WITHIN signature files. + // Watch https://github.com/fsharp/fslang-design/discussions //(envMutRec, mutRecDefnsAfterCore) ||> MutRecShapes.iterTyconsWithEnv (fun envForDecls ((tyconCore, _, _), tyconOpt, _, _, _) -> // let (MutRecDefnsPhase1DataForTycon (isAtOriginalTyconDefn=isAtOriginalTyconDefn)) = tyconCore // match tyconOpt with diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index eb471c074ab..c500f8ae511 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -871,12 +871,7 @@ let convAlternativeDef | SpecialFSharpListHelpers -> let baseTesterMeths, baseTesterProps = - if - false //g.langVersion.SupportsFeature LanguageFeature.UnionIsPropertiesVisible - && cud.HasHelpers = AllHelpers - then - [], [] - elif cud.UnionCases.Length <= 1 then + if cud.UnionCases.Length <= 1 then [], [] elif repr.RepresentOneAlternativeAsNull info then [], [] diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 3b6e895f1da..84ed2bf70d2 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -437,16 +437,14 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // ctxt is for debugging let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) - if ((idx >= 6400 && idx < 6450) && outMap.Name = "ovals") then - let msg = - sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" - idx (outMap.NodeStamp x) - outMap.Name (outMap.NodeName x) - (stringOfRange (outMap.GetRange x)) - _ctxt - System.Diagnostics.Debug.Assert(false, msg ) - System.IO.File.AppendAllLines(@"D:\protobuild.log",[msg]) - printfn "%s" msg + //if ((idx = 0) && outMap.Name = "oentities") then + // let msg = + // sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" + // idx (outMap.NodeStamp x) + // outMap.Name (outMap.NodeName x) + // (stringOfRange (outMap.GetRange x)) + // _ctxt + // System.Diagnostics.Debug.Assert(false, msg ) p_int idx st let p_osgn_decl (outMap : NodeOutTable<_, _>) p x st = From cc37881eebbef36fca06cbd68c67c87796f02b6c Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 10 Jan 2024 10:07:21 +0100 Subject: [PATCH 37/48] Rename to ILMethParentTypeInfo --- src/Compiler/Checking/infos.fs | 4 ++-- src/Compiler/Checking/infos.fsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 7d22ae9cec8..99d0fe97cd2 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -471,7 +471,7 @@ type ILTypeInfo = failwith ("ILTypeInfo.FromType - no IL metadata for type" + System.Environment.StackTrace) [] -type ILMethodsType = +type ILMethParentTypeInfo = | IlType of ILTypeInfo | CSharpStyleExtension of declaring:TyconRef * apparent:TType @@ -487,7 +487,7 @@ type ILMethInfo = /// /// If ilDeclaringTyconRefOpt is 'Some' then this is an F# use of an C#-style extension method. /// If ilDeclaringTyconRefOpt is 'None' then ilApparentType is an IL type definition. - | ILMethInfo of g: TcGlobals * ilType:ILMethodsType * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of g: TcGlobals * ilType:ILMethParentTypeInfo * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars member x.TcGlobals = match x with ILMethInfo(g, _, _, _) -> g diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 65374fb655b..9f1ad624298 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -179,7 +179,7 @@ type ILTypeInfo = member TypeInstOfRawMetadata: TypeInst [] -type ILMethodsType = +type ILMethParentTypeInfo = | IlType of ILTypeInfo | CSharpStyleExtension of declaring: TyconRef * apparent: TType @@ -188,7 +188,7 @@ type ILMethodsType = /// Describes an F# use of an IL method. [] type ILMethInfo = - | ILMethInfo of g: TcGlobals * ilType: ILMethodsType * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of g: TcGlobals * ilType: ILMethParentTypeInfo * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member ApparentEnclosingAppType: TType From 3c588614568c8ceec9338f661197a9bd70bfbd81 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 10 Jan 2024 10:48:12 +0100 Subject: [PATCH 38/48] making vMapFold tail recursive --- src/Compiler/Utilities/illib.fs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 7689f251f26..6bf85595108 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -422,6 +422,9 @@ module Option = with _ -> None +module internal ValueTuple = + let inline map1Of2 ([]f) struct(a1, a2) = struct(f a1, a2) + module List = let sortWithOrder (c: IComparer<'T>) elements = @@ -648,18 +651,21 @@ module List = | Some x -> x :: l | _ -> l - let rec vMapFold<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list : struct('Result list * 'State) = + + [] + let rec private vMapFoldWithAcc<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list acc : struct('Result list * 'State) = match list with - | [] -> [], state + | [] -> acc, state | [h] -> - let struct(x', s') = mapping state h - [x'], s' + mapping state h + |> ValueTuple.map1Of2 (fun x -> x::acc) | h :: t -> let struct(mappedHead, stateHead) = mapping state h - let struct(mappedTail,stateTail) = vMapFold mapping stateHead t - (mappedHead :: mappedTail), stateTail + vMapFoldWithAcc mapping stateHead t (mappedHead :: acc) - + let vMapFold<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list : struct('Result list * 'State) = + vMapFoldWithAcc mapping state list [] + |> ValueTuple.map1Of2 List.rev module ResizeArray = From ab076994da79da05777a1c3fef0760b32f668087 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 10 Jan 2024 11:00:51 +0100 Subject: [PATCH 39/48] physical nullnessEquiv --- src/Compiler/TypedTree/TypedTree.fs | 3 ++- src/Compiler/TypedTree/TypedTree.fsi | 3 ++- src/Compiler/TypedTree/TypedTreeBasics.fs | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 11351308987..5e7c01094d9 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -4210,7 +4210,7 @@ type RecdFieldRef = override x.ToString() = x.FieldName -[] +[] type Nullness = | Known of NullnessInfo | Variable of NullnessVar @@ -4228,6 +4228,7 @@ type Nullness = override n.ToString() = match n.Evaluate() with NullnessInfo.WithNull -> "?" | NullnessInfo.WithoutNull -> "" | NullnessInfo.AmbivalentToNull -> "%" // Note, nullness variables are only created if the nullness checking feature is on +[] type NullnessVar() = let mutable solution: Nullness option = None diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 1d606257b9a..7bf31df184c 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -3034,7 +3034,7 @@ type NullnessInfo = /// we know we don't care | AmbivalentToNull -[] +[] type Nullness = | Known of NullnessInfo | Variable of NullnessVar @@ -3043,6 +3043,7 @@ type Nullness = member TryEvaluate: unit -> NullnessInfo voption +[] type NullnessVar = new: unit -> NullnessVar member Evaluate: unit -> NullnessInfo diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index cab59a529ab..f716ea69914 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -252,17 +252,19 @@ let combineNullness (nullnessOrig: Nullness) (nullnessNew: Nullness) = | NullnessInfo.AmbivalentToNull -> nullnessNew | NullnessInfo.WithNull -> nullnessOrig +let nullnessEquiv (nullnessOrig: Nullness) (nullnessNew: Nullness) = LanguagePrimitives.PhysicalEquality nullnessOrig nullnessNew + let tryAddNullnessToTy nullnessNew (ty:TType) = match ty with | TType_var (tp, nullnessOrig) -> let nullnessAfter = combineNullness nullnessOrig nullnessNew - if nullnessAfter = nullnessOrig then + if nullnessEquiv nullnessAfter nullnessOrig then Some ty else Some (TType_var (tp, nullnessAfter)) | TType_app (tcr, tinst, nullnessOrig) -> let nullnessAfter = combineNullness nullnessOrig nullnessNew - if nullnessAfter = nullnessOrig then + if nullnessEquiv nullnessAfter nullnessOrig then Some ty else Some (TType_app (tcr, tinst, nullnessAfter)) @@ -271,7 +273,7 @@ let tryAddNullnessToTy nullnessNew (ty:TType) = | TType_anon _ -> None // TODO NULLNESS | TType_fun (d, r, nullnessOrig) -> let nullnessAfter = combineNullness nullnessOrig nullnessNew - if nullnessAfter = nullnessOrig then + if nullnessEquiv nullnessAfter nullnessOrig then Some ty else Some (TType_fun (d, r, nullnessAfter)) From b5522c808761c053a1270a4fbbaade65ed1602e7 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 10 Jan 2024 11:07:28 +0100 Subject: [PATCH 40/48] format --- src/Compiler/Checking/infos.fsi | 6 +++++- src/Compiler/TypedTree/TypedTree.fsi | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 9f1ad624298..41998e5253c 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -188,7 +188,11 @@ type ILMethParentTypeInfo = /// Describes an F# use of an IL method. [] type ILMethInfo = - | ILMethInfo of g: TcGlobals * ilType: ILMethParentTypeInfo * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of + g: TcGlobals * + ilType: ILMethParentTypeInfo * + ilMethodDef: ILMethodDef * + ilGenericMethodTyArgs: Typars /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member ApparentEnclosingAppType: TType diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 7bf31df184c..19a815daff9 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -3034,7 +3034,7 @@ type NullnessInfo = /// we know we don't care | AmbivalentToNull -[] +[] type Nullness = | Known of NullnessInfo | Variable of NullnessVar @@ -3043,7 +3043,7 @@ type Nullness = member TryEvaluate: unit -> NullnessInfo voption -[] +[] type NullnessVar = new: unit -> NullnessVar member Evaluate: unit -> NullnessInfo From 0e4a3e2ba3d0a1a676bf2d39915aa345b735ead8 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 15 Jan 2024 12:57:00 +0100 Subject: [PATCH 41/48] Commenting SkipNullness usages --- src/Compiler/Checking/AttributeChecking.fs | 3 +++ src/Compiler/Checking/TypeHierarchy.fs | 2 ++ src/Compiler/Checking/infos.fs | 3 +++ src/Compiler/Symbols/Exprs.fs | 2 ++ 4 files changed, 10 insertions(+) diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index ccfb744618c..977d0ecccc6 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -90,6 +90,7 @@ type AttribInfo = match x with | FSAttribInfo(_g, Attrib(tcref, _, _, _, _, _, _)) -> tcref | ILAttribInfo (g, amap, scoref, a, m) -> + // We are skipping nullness check here because this reference is an attribute usage, nullness does not apply. let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] a.Method.DeclaringType tcrefOfAppTy g ty @@ -104,6 +105,7 @@ type AttribInfo = | ILAttribInfo (_g, amap, scoref, cattr, m) -> let parms, _args = decodeILAttribData cattr [ for argTy, arg in Seq.zip cattr.Method.FormalArgTypes parms -> + // We are skipping nullness check here because this reference is an attribute usage, nullness does not apply. let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] argTy let obj = evalILAttribElem arg ty, obj ] @@ -119,6 +121,7 @@ type AttribInfo = | ILAttribInfo (_g, amap, scoref, cattr, m) -> let _parms, namedArgs = decodeILAttribData cattr [ for nm, argTy, isProp, arg in namedArgs -> + // We are skipping nullness check here because this reference is an attribute usage, nullness does not apply. let ty = RescopeAndImportILTypeSkipNullness scoref amap m [] argTy let obj = evalILAttribElem arg let isField = not isProp diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index 7fb2eca7964..a629857245a 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -55,6 +55,7 @@ let GetSuperTypeOfType g amap m ty = let tinst = argsOfAppTy g ty match tdef.Extends with | None -> None + // 'inherit' cannot refer to a nullable type | Some ilTy -> Some (RescopeAndImportILTypeSkipNullness scoref amap m tinst ilTy) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> @@ -115,6 +116,7 @@ let GetImmediateInterfacesOfMetadataType g amap m skipUnref ty (tcref: TyconRef) // assume those are present. for intfTy in tdef.Implements do if skipUnref = SkipUnrefInterfaces.No || CanRescopeAndImportILType scoref amap m intfTy then + // Implementing an interface cannot refer to a nullable type RescopeAndImportILTypeSkipNullness scoref amap m tinst intfTy | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> for intfTy in tcref.ImmediateInterfaceTypesOfFSharpTycon do diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 99d0fe97cd2..022a0c6e4c9 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -217,6 +217,7 @@ type OptionalArgInfo = else MissingValue else DefaultValue + // See above - the typpe is imported only in order to be analyzed for optional default value, nullness is irrelevant here. CallerSide (analyze (ImportILTypeFromMetadataSkipNullness amap m ilScope ilTypeInst [] ilParam.Type)) | Some v -> CallerSide (Constant v) @@ -1701,6 +1702,7 @@ type ILPropInfo = else if x.HasSetter then x.SetterMethod.GetParamNamesAndTypes(amap,m,tinfo.TypeInstOfRawMetadata) else + // Fallback-only for invalid properties pdef.Args |> List.map (fun ty -> ParamNameAndType(None, ImportILTypeFromMetadataSkipNullness amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) ) /// Get the types of the indexer arguments associated with the IL property. @@ -1713,6 +1715,7 @@ type ILPropInfo = else if x.HasSetter then x.SetterMethod.GetParamTypes(amap,m,tinfo.TypeInstOfRawMetadata) else + // Fallback-only for invalid properties pdef.Args |> List.map (fun ty -> ImportILTypeFromMetadataSkipNullness amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] ty) /// Get the return type of the IL property. diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 084e590838a..5ad053b2d9f 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -1149,6 +1149,8 @@ module FSharpExprConvert = // TODO: this will not work for curried methods in F# classes. // This is difficult to solve as the information in the ILMethodRef // is not sufficient to resolve to a symbol unambiguously in these cases. + + // If this was an ILTycon with potential nullness, try1 is Some(..) and this branch not hit let argTys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadataSkipNullness cenv.amap m scoref tinst1 tinst2) ] let retTy = let nullableAttributes = Import.Nullness.NullableAttributesSource.Empty From 04ec256647408b88c0fe8a221d1a222163c3bfdc Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 15 Jan 2024 13:41:21 +0100 Subject: [PATCH 42/48] Nullness work - activity module --- src/Compiler/Utilities/Activity.fs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 79697eae494..3d1fe2bfe68 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -54,20 +54,22 @@ module internal Activity = module Events = let cacheHit = "cacheHit" - type System.Diagnostics.Activity with + type Diagnostics.Activity with member this.RootId = let rec rootID (act: Activity) = - if isNull act.ParentId then act.Id else rootID act.Parent + match act.Parent with + | NonNull parent -> rootID parent + | Null -> act.Id + rootID this member this.Depth = let rec depth (act: Activity) acc = - if isNull act.ParentId then - acc - else - depth act.Parent (acc + 1) + match act.Parent with + | NonNull parent -> depth parent (acc+1) + | Null -> acc depth this 0 @@ -77,8 +79,8 @@ module internal Activity = let activity = activitySource.CreateActivity(name, ActivityKind.Internal) match activity with - | null -> activity - | activity -> + | Null -> activity + | NonNull activity -> for key, value in tags do activity.AddTag(key, value) |> ignore @@ -87,8 +89,11 @@ module internal Activity = let startNoTags (name: string) : IDisposable = activitySource.StartActivity name let addEvent name = - if (not (isNull Activity.Current)) && Activity.Current.Source = activitySource then - Activity.Current.AddEvent(ActivityEvent name) |> ignore + match Activity.Current with + | NonNull activity when activity.Source = activitySource -> + activity.AddEvent(ActivityEvent name) |> ignore + | _ -> () + module Profiling = @@ -200,7 +205,7 @@ module internal Activity = let private createCsvRow (a: Activity) = let sb = new StringBuilder(128) - let appendWithLeadingComma (s: string) = + let appendWithLeadingComma (s: string | null) = sb.Append(',') |> ignore sb.Append(s) |> ignore From cd4632f321b0ef1f6eea1718197b9dc8c64c4700 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 16 Jan 2024 11:35:28 +0100 Subject: [PATCH 43/48] Remove strict generic 'T:null' import --- src/Compiler/Checking/import.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index db91007ff80..f629df6c5e9 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -625,7 +625,8 @@ let ImportILGenericParameters amap m scoref tinst (nullableFallback:Nullness.Nul match nullness.GetFlags(amap.g) with | [|1uy|] -> TyparConstraint.NotSupportsNull(m) - | [|2uy|] -> TyparConstraint.SupportsNull(m) + // In F#, 'SupportsNull' has the meaning of "must support null as a value". In C#, Nullable(2) is an allowance, not a requirement. + //| [|2uy|] -> TyparConstraint.SupportsNull(m) | _ -> () if gp.CustomAttrs |> TryFindILAttribute amap.g.attrib_IsUnmanagedAttribute then From 45a6bdfba3e7cbcec7c5abd881e4982871d1f940 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 16 Jan 2024 12:48:44 +0100 Subject: [PATCH 44/48] Null|NonNull pattern also for regular compilation --- src/FSharp.Core/prim-types.fs | 6 ++++++ src/FSharp.Core/prim-types.fsi | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index e2b76c37dab..daae35ec3d9 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -4294,6 +4294,12 @@ namespace Microsoft.FSharp.Core match value with | null -> raise (new ArgumentNullException(argumentName)) | _ -> (# "" value : 'T #) +#else + [] + let inline (|Null|NonNull|) (value : 'T when 'T : not struct) = + match value with + | null -> Null () + | _ -> NonNull (# "" value : 'T #) #endif [] diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 5339a5a4d59..ab1b3c5826f 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -3476,6 +3476,13 @@ namespace Microsoft.FSharp.Core [] [] val inline isNullV : value:Nullable<'T> -> bool +#else + /// Determines whether the given value is null. + /// The value to check. + /// A choice indicating whether the value is null or not-null. + [] + [] + val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : not struct #endif /// Determines whether the given value is not null. From abe07b27ce683e51b17cf412b81e302e55db0d9a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 16 Jan 2024 14:03:06 +0100 Subject: [PATCH 45/48] Backported Null|NonNull active pattern --- src/FSharp.Core/prim-types.fs | 2 +- src/FSharp.Core/prim-types.fsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index daae35ec3d9..dcf5d351c9b 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -4296,7 +4296,7 @@ namespace Microsoft.FSharp.Core | _ -> (# "" value : 'T #) #else [] - let inline (|Null|NonNull|) (value : 'T when 'T : not struct) = + let inline (|Null|NonNull|) (value : 'T when 'T : null) = match value with | null -> Null () | _ -> NonNull (# "" value : 'T #) diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index ab1b3c5826f..a70329ae471 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -3482,7 +3482,7 @@ namespace Microsoft.FSharp.Core /// A choice indicating whether the value is null or not-null. [] [] - val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : not struct + val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : null #endif /// Determines whether the given value is not null. From 7a4dbf69ae11cc02951e869d4e109f7a385148be Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 16 Jan 2024 18:05:50 +0100 Subject: [PATCH 46/48] one more time --- src/Compiler/Utilities/Activity.fs | 7 ++----- src/FSharp.Core/prim-types.fs | 2 +- src/FSharp.Core/prim-types.fsi | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 3d1fe2bfe68..7fbcfcff560 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -62,13 +62,12 @@ module internal Activity = | NonNull parent -> rootID parent | Null -> act.Id - rootID this member this.Depth = let rec depth (act: Activity) acc = match act.Parent with - | NonNull parent -> depth parent (acc+1) + | NonNull parent -> depth parent (acc + 1) | Null -> acc depth this 0 @@ -90,11 +89,9 @@ module internal Activity = let addEvent name = match Activity.Current with - | NonNull activity when activity.Source = activitySource -> - activity.AddEvent(ActivityEvent name) |> ignore + | NonNull activity when activity.Source = activitySource -> activity.AddEvent(ActivityEvent name) |> ignore | _ -> () - module Profiling = module Tags = diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index dcf5d351c9b..d44fa86610b 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -4296,7 +4296,7 @@ namespace Microsoft.FSharp.Core | _ -> (# "" value : 'T #) #else [] - let inline (|Null|NonNull|) (value : 'T when 'T : null) = + let inline (|Null|NonNull|) (value : 'T) : Choice when 'T : null and 'T : not struct = match value with | null -> Null () | _ -> NonNull (# "" value : 'T #) diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index a70329ae471..13fb9e46ff9 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -3482,7 +3482,7 @@ namespace Microsoft.FSharp.Core /// A choice indicating whether the value is null or not-null. [] [] - val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : null + val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : null and 'T : not struct #endif /// Determines whether the given value is not null. From 1141fe4916dbd470e26c213bb347b64e62efa27d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 16 Jan 2024 18:23:33 +0100 Subject: [PATCH 47/48] revert --- src/Compiler/Utilities/Activity.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 7fbcfcff560..22405544e2f 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -202,7 +202,7 @@ module internal Activity = let private createCsvRow (a: Activity) = let sb = new StringBuilder(128) - let appendWithLeadingComma (s: string | null) = + let appendWithLeadingComma (s: string) = sb.Append(',') |> ignore sb.Append(s) |> ignore From eb3a61269e4b936be8d08a0b64dfb1eaccffca43 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 19 Jan 2024 14:07:27 +0100 Subject: [PATCH 48/48] Show nullness in quickinfo and in general in type representations --- src/Compiler/Symbols/SymbolHelpers.fs | 2 +- src/Compiler/TypedTree/TypedTree.fs | 2 ++ src/Compiler/TypedTree/TypedTree.fsi | 2 ++ src/Compiler/TypedTree/TypedTreeOps.fs | 24 ++++++++++++------------ 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index c5eded88ba7..8e69702800c 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -546,7 +546,7 @@ module internal SymbolHelpers = let SimplerDisplayEnv denv = { denv with shortConstraints=true showStaticallyResolvedTyparAnnotations=false - showNullnessAnnotations = Some false + showNullnessAnnotations = Some true abbreviateAdditionalConstraints=false suppressNestedTypes=true maxMembers=Some EnvMisc2.maxMembers } diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 5e7c01094d9..e377213c329 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -4227,6 +4227,8 @@ type Nullness = override n.ToString() = match n.Evaluate() with NullnessInfo.WithNull -> "?" | NullnessInfo.WithoutNull -> "" | NullnessInfo.AmbivalentToNull -> "%" + member n.ToFsharpCodeString() = match n.Evaluate() with NullnessInfo.WithNull -> " | null " | NullnessInfo.WithoutNull -> "" | NullnessInfo.AmbivalentToNull -> "" + // Note, nullness variables are only created if the nullness checking feature is on [] type NullnessVar() = diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 19a815daff9..a2f167130e6 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -3043,6 +3043,8 @@ type Nullness = member TryEvaluate: unit -> NullnessInfo voption + member ToFsharpCodeString: unit -> string + [] type NullnessVar = new: unit -> NullnessVar diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 71db5c461f2..1af0df92d43 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -8776,26 +8776,26 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = let ety = destNativePtrTy g ty typeEnc g (gtpsType, gtpsMethod) ety + "*" - | _ when isArrayTy g ty -> - let tcref, tinst = destAppTy g ty + | TType_app (_, _, nullness) when isArrayTy g ty -> + let tcref, tinst = destAppTy g ty let rank = rankOfArrayTyconRef g tcref let arraySuffix = "[" + String.concat ", " (List.replicate (rank-1) "0:") + "]" - typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + arraySuffix + typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + arraySuffix + nullness.ToFsharpCodeString() | TType_ucase (_, tinst) | TType_app (_, tinst, _) -> - let tyName = + let tyName,nullness = let ty = stripTyEqnsAndMeasureEqns g ty match ty with - | TType_app (tcref, _tinst, _) -> + | TType_app (tcref, _tinst, nullness) -> // Generic type names are (name + "`" + digits) where name does not contain "`". // In XML doc, when used in type instances, these do not use the ticks. let path = Array.toList (fullMangledPathToTyconRef tcref) @ [tcref.CompiledName] - textOfPath (List.map DemangleGenericTypeName path) + textOfPath (List.map DemangleGenericTypeName path),nullness | _ -> assert false failwith "impossible" - tyName + tyargsEnc g (gtpsType, gtpsMethod) tinst + tyName + tyargsEnc g (gtpsType, gtpsMethod) tinst + nullness.ToFsharpCodeString() | TType_anon (anonInfo, tinst) -> sprintf "%s%s" anonInfo.ILTypeRef.FullName (tyargsEnc g (gtpsType, gtpsMethod) tinst) @@ -8806,11 +8806,11 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = else sprintf "System.Tuple%s"(tyargsEnc g (gtpsType, gtpsMethod) tys) - | TType_fun (domainTy, rangeTy, _) -> - "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [domainTy; rangeTy] + | TType_fun (domainTy, rangeTy, nullness) -> + "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [domainTy; rangeTy] + nullness.ToFsharpCodeString() - | TType_var (typar, _) -> - typarEnc g (gtpsType, gtpsMethod) typar + | TType_var (typar, nullness) -> + typarEnc g (gtpsType, gtpsMethod) typar + nullness.ToFsharpCodeString() | TType_measure _ -> "?" @@ -8822,7 +8822,7 @@ and tyargsEnc g (gtpsType, gtpsMethod) args = let XmlDocArgsEnc g (gtpsType, gtpsMethod) argTys = if isNil argTys then "" - else "(" + String.concat "," (List.map (typeEnc g (gtpsType, gtpsMethod)) argTys) + ")" + else "(" + String.concat "," (List.map (typeEnc g (gtpsType, gtpsMethod)) argTys) + ")" let buildAccessPath (cp: CompilationPath option) = match cp with