From cb85ff1eb54d7ddea47456e82083fe0b5bedbe18 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 13 Dec 2023 11:06:33 +0100 Subject: [PATCH 1/2] Enable warnings for FS1178 --- src/Compiler/AbstractIL/il.fs | 17 ++++-- src/Compiler/AbstractIL/il.fsi | 8 ++- src/Compiler/AbstractIL/ilpars.fsy | 1 + src/Compiler/AbstractIL/ilprint.fs | 1 + src/Compiler/AbstractIL/ilread.fs | 1 + src/Compiler/AbstractIL/ilread.fsi | 1 + src/Compiler/AbstractIL/ilreflect.fs | 3 +- src/Compiler/AbstractIL/ilreflect.fsi | 1 + src/Compiler/AbstractIL/ilwrite.fs | 2 + src/Compiler/AbstractIL/ilwrite.fsi | 1 + src/Compiler/AbstractIL/ilx.fs | 10 +++- src/Compiler/AbstractIL/ilx.fsi | 9 +++- src/Compiler/Checking/AttributeChecking.fs | 1 + src/Compiler/Checking/AttributeChecking.fsi | 1 + src/Compiler/Checking/CheckBasics.fs | 12 ++++- src/Compiler/Checking/CheckBasics.fsi | 13 ++++- src/Compiler/Checking/CheckDeclarations.fs | 18 ++++++- src/Compiler/Checking/CheckDeclarations.fsi | 1 + src/Compiler/Checking/CheckExpressions.fs | 52 ++++++++++++++++++- src/Compiler/Checking/CheckExpressions.fsi | 45 +++++++++++++++- src/Compiler/Checking/CheckFormatStrings.fs | 1 + .../Checking/CheckIncrementalClasses.fs | 6 +++ .../Checking/CheckIncrementalClasses.fsi | 6 +++ src/Compiler/Checking/ConstraintSolver.fs | 25 +++++++-- src/Compiler/Checking/ConstraintSolver.fsi | 22 +++++++- src/Compiler/Checking/FindUnsolved.fs | 1 + src/Compiler/Checking/InfoReader.fs | 3 +- src/Compiler/Checking/InfoReader.fsi | 1 + src/Compiler/Checking/MethodCalls.fs | 17 ++++-- src/Compiler/Checking/MethodCalls.fsi | 13 ++++- src/Compiler/Checking/MethodOverrides.fs | 6 ++- src/Compiler/Checking/MethodOverrides.fsi | 4 ++ src/Compiler/Checking/NameResolution.fs | 14 +++-- src/Compiler/Checking/NameResolution.fsi | 12 +++-- .../Checking/PatternMatchCompilation.fs | 13 +++-- .../Checking/PatternMatchCompilation.fsi | 4 +- src/Compiler/Checking/PostInferenceChecks.fs | 2 + src/Compiler/Checking/QuotationTranslator.fs | 2 + src/Compiler/Checking/QuotationTranslator.fsi | 2 +- src/Compiler/Checking/SignatureConformance.fs | 7 +++ .../Checking/SignatureConformance.fsi | 7 +++ src/Compiler/Checking/TailCallChecks.fs | 1 + src/Compiler/Checking/infos.fs | 4 ++ src/Compiler/Checking/infos.fsi | 4 ++ src/Compiler/CodeGen/EraseClosures.fs | 1 + src/Compiler/CodeGen/IlxGen.fs | 15 +++--- src/Compiler/CodeGen/IlxGen.fsi | 2 + src/Compiler/Driver/CompilerConfig.fs | 9 +++- src/Compiler/Driver/CompilerConfig.fsi | 5 +- src/Compiler/Driver/CompilerDiagnostics.fs | 6 +-- src/Compiler/Driver/CompilerDiagnostics.fsi | 6 +-- src/Compiler/Driver/CompilerImports.fs | 5 ++ src/Compiler/Driver/CompilerImports.fsi | 6 ++- src/Compiler/Driver/CompilerOptions.fs | 5 +- src/Compiler/Driver/CompilerOptions.fsi | 5 +- .../Driver/GraphChecking/GraphProcessing.fs | 1 + src/Compiler/Driver/GraphChecking/Types.fs | 4 ++ src/Compiler/Driver/GraphChecking/Types.fsi | 4 ++ src/Compiler/Driver/OptimizeInputs.fs | 4 ++ src/Compiler/Driver/ParseAndCheckInputs.fs | 1 + src/Compiler/Driver/ParseAndCheckInputs.fsi | 2 +- src/Compiler/Driver/ScriptClosure.fs | 6 ++- src/Compiler/Driver/ScriptClosure.fsi | 4 +- src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Facilities/DiagnosticsLogger.fs | 3 +- src/Compiler/Facilities/DiagnosticsLogger.fsi | 2 + src/Compiler/Facilities/ReferenceResolver.fs | 1 + src/Compiler/Facilities/ReferenceResolver.fsi | 1 + src/Compiler/Facilities/prim-parsing.fs | 2 +- src/Compiler/Facilities/prim-parsing.fsi | 1 + src/Compiler/Interactive/fsi.fs | 5 +- .../Legacy/LegacyHostedCompilerForTesting.fs | 2 +- src/Compiler/Optimize/DetupleArgs.fs | 7 ++- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 6 ++- src/Compiler/Optimize/LowerLocalMutables.fs | 1 + src/Compiler/Optimize/LowerSequences.fs | 2 +- src/Compiler/Optimize/LowerStateMachines.fs | 4 ++ src/Compiler/Optimize/LowerStateMachines.fsi | 2 + src/Compiler/Optimize/Optimizer.fs | 5 ++ src/Compiler/Service/ExternalSymbol.fs | 4 +- src/Compiler/Service/ExternalSymbol.fsi | 4 +- src/Compiler/Service/FSharpCheckerResults.fs | 7 +-- src/Compiler/Service/FSharpCheckerResults.fsi | 4 +- .../Service/FSharpParseFileResults.fs | 6 +-- src/Compiler/Service/FSharpSource.fs | 2 +- src/Compiler/Service/FSharpSource.fsi | 2 +- src/Compiler/Service/IncrementalBuild.fs | 2 + .../Service/SemanticClassification.fs | 3 +- .../Service/SemanticClassification.fsi | 3 +- src/Compiler/Service/ServiceAnalysis.fs | 3 ++ src/Compiler/Service/ServiceAnalysis.fsi | 1 + .../Service/ServiceAssemblyContent.fs | 2 + .../Service/ServiceAssemblyContent.fsi | 1 + .../Service/ServiceDeclarationLists.fs | 6 ++- .../Service/ServiceDeclarationLists.fsi | 6 ++- src/Compiler/Service/ServiceNavigation.fs | 1 + src/Compiler/Service/ServiceNavigation.fsi | 1 + .../Service/ServiceParamInfoLocations.fs | 2 + .../Service/ServiceParamInfoLocations.fsi | 1 + src/Compiler/Service/ServiceParseTreeWalk.fs | 2 +- src/Compiler/Service/ServiceParseTreeWalk.fsi | 2 +- src/Compiler/Service/ServiceParsedInputOps.fs | 8 +-- .../Service/ServiceParsedInputOps.fsi | 8 +-- src/Compiler/Service/service.fs | 2 + src/Compiler/Service/service.fsi | 1 + src/Compiler/Symbols/Exprs.fs | 4 +- src/Compiler/Symbols/Exprs.fsi | 2 +- src/Compiler/Symbols/SymbolHelpers.fs | 2 +- src/Compiler/Symbols/SymbolHelpers.fsi | 2 +- src/Compiler/Symbols/Symbols.fs | 2 + src/Compiler/SyntaxTree/LexFilter.fs | 1 + src/Compiler/SyntaxTree/LexHelpers.fs | 2 + src/Compiler/SyntaxTree/LexHelpers.fsi | 2 + src/Compiler/SyntaxTree/ParseHelpers.fs | 2 + src/Compiler/SyntaxTree/ParseHelpers.fsi | 2 + src/Compiler/SyntaxTree/PrettyNaming.fs | 1 + src/Compiler/SyntaxTree/PrettyNaming.fsi | 1 + src/Compiler/SyntaxTree/SyntaxTree.fs | 30 ++++++----- src/Compiler/SyntaxTree/SyntaxTree.fsi | 30 ++++++----- src/Compiler/SyntaxTree/XmlDoc.fs | 1 + src/Compiler/SyntaxTree/XmlDoc.fsi | 2 +- src/Compiler/TypedTree/QuotationPickler.fs | 2 + src/Compiler/TypedTree/TypeProviders.fs | 6 ++- src/Compiler/TypedTree/TypeProviders.fsi | 5 +- src/Compiler/TypedTree/TypedTree.fs | 13 ++++- src/Compiler/TypedTree/TypedTree.fsi | 13 ++++- src/Compiler/TypedTree/TypedTreeOps.fs | 9 +++- src/Compiler/TypedTree/TypedTreeOps.fsi | 7 ++- src/Compiler/TypedTree/tainted.fs | 3 +- src/Compiler/Utilities/Cancellable.fs | 4 +- src/Compiler/Utilities/Cancellable.fsi | 4 +- src/Compiler/Utilities/FileSystem.fs | 1 + src/Compiler/Utilities/FileSystem.fsi | 2 +- src/Compiler/Utilities/illib.fs | 2 +- src/Compiler/Utilities/illib.fsi | 2 +- src/Compiler/Utilities/lib.fs | 2 +- src/Compiler/Utilities/lib.fsi | 2 +- ...ervice.SurfaceArea.netstandard20.debug.bsl | 18 ------- ...vice.SurfaceArea.netstandard20.release.bsl | 18 ------- 139 files changed, 599 insertions(+), 196 deletions(-) diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 5e475d96193..f0fb59543fa 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -1497,6 +1497,7 @@ type ILDebugImport = //| ReferenceAlias of string //| OpenXmlNamespace of prefix: string * xmlNamespace: string +[] type ILDebugImports = { Parent: ILDebugImports option @@ -1819,7 +1820,7 @@ type ILMethodVirtualInfo = IsAbstract: bool } -[] +[] type MethodBody = | IL of InterruptibleLazy | PInvoke of Lazy (* platform invoke to native *) @@ -2450,6 +2451,7 @@ type ILFieldDef override x.ToString() = "field " + x.Name // Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation. +[] type ILFieldDefs = | ILFields of LazyOrderedMultiMap @@ -2466,6 +2468,7 @@ type ILMethodImplDef = } // Index table by name and arity. +[] type ILMethodImplDefs = | ILMethodImpls of InterruptibleLazy @@ -2897,13 +2900,14 @@ and [] ILPreTypeDefImpl(nameSpace: string list, name: string, metadataIn Monitor.Exit(syncObj) | _ -> store -and ILTypeDefStored = +and [] ILTypeDefStored = | Given of ILTypeDef | Reader of (int32 -> ILTypeDef) | Computed of (unit -> ILTypeDef) let mkILTypeDefReader f = ILTypeDefStored.Reader f +[] type ILNestedExportedType = { Name: string @@ -2917,7 +2921,7 @@ type ILNestedExportedType = override x.ToString() = "exported type " + x.Name -and ILNestedExportedTypes = +and [] ILNestedExportedTypes = | ILNestedExportedTypes of InterruptibleLazy> member x.AsList() = @@ -2941,7 +2945,7 @@ and [] ILExportedTypeOrForwarder = override x.ToString() = "exported type " + x.Name -and ILExportedTypesAndForwarders = +and [] ILExportedTypesAndForwarders = | ILExportedTypesAndForwarders of InterruptibleLazy> member x.AsList() = @@ -2962,6 +2966,7 @@ type ILResourceLocation = | File of ILModuleRef * int32 | Assembly of ILAssemblyRef +[] type ILResource = { Name: string @@ -2981,6 +2986,7 @@ type ILResource = override x.ToString() = "resource " + x.Name +[] type ILResources = | ILResources of ILResource list @@ -3000,6 +3006,7 @@ type ILAssemblyLongevity = static member Default = Unspecified +[] type ILAssemblyManifest = { Name: string @@ -3035,6 +3042,7 @@ type ILNativeResource = | In of fileName: string * linkedResourceBase: int * linkedResourceStart: int * linkedResourceLength: int | Out of unlinkedResource: byte[] +[] type ILModuleDef = { Manifest: ILAssemblyManifest option @@ -5225,6 +5233,7 @@ type ILReferences = FieldReferences: ILFieldRef[] } +[] type ILReferencesAccumulator = { ilg: ILGlobals diff --git a/src/Compiler/AbstractIL/il.fsi b/src/Compiler/AbstractIL/il.fsi index 5ba803fb757..ef753d54b4b 100644 --- a/src/Compiler/AbstractIL/il.fsi +++ b/src/Compiler/AbstractIL/il.fsi @@ -785,6 +785,7 @@ type ILDebugImport = /// Defines a set of opened namespace, type relevant to a code location. /// /// Emitted to the PortablePDB format. +[] type ILDebugImports = { Parent: ILDebugImports option Imports: ILDebugImport[] } @@ -984,7 +985,7 @@ type internal ILOverridesSpec = member MethodRef: ILMethodRef member DeclaringType: ILType -[] +[] type MethodBody = | IL of InterruptibleLazy | PInvoke of Lazy @@ -993,6 +994,7 @@ type MethodBody = | NotAvailable /// Generic parameters. Formal generic parameter declarations may include the bounds, if any, on the generic parameter. +[] type ILGenericParameterDef = { Name: string @@ -1642,6 +1644,7 @@ type ILNestedExportedTypes = /// this table, suitably nested inside another "ILExportedTypeOrForwarder" /// definition. /// these are only found in the "Nested" field of ILExportedTypeOrForwarder objects +[] type ILNestedExportedType = { Name: string Access: ILMemberAccess @@ -1697,6 +1700,7 @@ type internal ILResourceLocation = /// - the data section of the current module (byte[] of resource given directly). /// - in an external file in this assembly (offset given in the ILResourceLocation field). /// - as a resources in another assembly of the same name. +[] type internal ILResource = { Name: string Location: ILResourceLocation @@ -1727,6 +1731,7 @@ type ILAssemblyLongevity = static member Default: ILAssemblyLongevity /// The main module of an assembly is a module plus some manifest information. +[] type ILAssemblyManifest = { Name: string @@ -1788,6 +1793,7 @@ type ILNativeResource = /// /// An assembly is built by joining together a "main" module plus /// several auxiliary modules. +[] type ILModuleDef = { Manifest: ILAssemblyManifest option diff --git a/src/Compiler/AbstractIL/ilpars.fsy b/src/Compiler/AbstractIL/ilpars.fsy index 67c8e4d1fe3..9a6f4fef6e7 100644 --- a/src/Compiler/AbstractIL/ilpars.fsy +++ b/src/Compiler/AbstractIL/ilpars.fsy @@ -6,6 +6,7 @@ open Internal.Utilities.Library +[] type ResolvedAtMethodSpecScope<'T> = ResolvedAtMethodSpecScope of (ILGenericParameterDefs -> 'T) diff --git a/src/Compiler/AbstractIL/ilprint.fs b/src/Compiler/AbstractIL/ilprint.fs index 9d278dbe317..e8f51273cc1 100644 --- a/src/Compiler/AbstractIL/ilprint.fs +++ b/src/Compiler/AbstractIL/ilprint.fs @@ -26,6 +26,7 @@ let tyvar_generator = // Carry an environment because the way we print method variables // depends on the gparams of the current scope. +[] type ppenv = { ilGlobals: ILGlobals diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 78082e34ca7..651e3f2b11d 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -4874,6 +4874,7 @@ type ReduceMemoryFlag = | Yes | No +[] type ILReaderOptions = { pdbDirPath: string option diff --git a/src/Compiler/AbstractIL/ilread.fsi b/src/Compiler/AbstractIL/ilread.fsi index f2b86266063..db97a4ba766 100644 --- a/src/Compiler/AbstractIL/ilread.fsi +++ b/src/Compiler/AbstractIL/ilread.fsi @@ -39,6 +39,7 @@ type MetadataOnlyFlag = Yes | No [] type ReduceMemoryFlag = Yes | No +[] type ILReaderOptions = { pdbDirPath: string option diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 748ecafda21..143087a9203 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -458,6 +458,7 @@ let convAssemblyRef (aref: ILAssemblyRef) = asmName /// The global environment. +[] type cenv = { ilg: ILGlobals @@ -512,7 +513,7 @@ let convTypeRefAux (cenv: cenv) (tref: ILTypeRef) = /// The (local) emitter env (state). Some of these fields are effectively global accumulators /// and could be placed as hash tables in the global environment. -[] +[] type ILDynamicAssemblyEmitEnv = { emTypMap: Zmap diff --git a/src/Compiler/AbstractIL/ilreflect.fsi b/src/Compiler/AbstractIL/ilreflect.fsi index 79fb6f8535c..8939f8ea052 100644 --- a/src/Compiler/AbstractIL/ilreflect.fsi +++ b/src/Compiler/AbstractIL/ilreflect.fsi @@ -11,6 +11,7 @@ open FSharp.Compiler.AbstractIL.IL val mkDynamicAssemblyAndModule: assemblyName: string * optimize: bool * collectible: bool -> AssemblyBuilder * ModuleBuilder +[] type cenv = { ilg: ILGlobals emitTailcalls: bool diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index cd4e1bfe721..29ec18c878b 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -1582,6 +1582,7 @@ let CodeBufferCapacity = 200 /// - possible branch destinations /// - locations of embedded handles into the string table /// - the exception table +[] type CodeBuffer = { code: ByteBuffer @@ -3790,6 +3791,7 @@ let writePdb ( reportTime "Finish" pdbBytes +[] type options = { ilg: ILGlobals outfile: string diff --git a/src/Compiler/AbstractIL/ilwrite.fsi b/src/Compiler/AbstractIL/ilwrite.fsi index 986f79d53fc..7b989b1c2d3 100644 --- a/src/Compiler/AbstractIL/ilwrite.fsi +++ b/src/Compiler/AbstractIL/ilwrite.fsi @@ -8,6 +8,7 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILPdbWriter open FSharp.Compiler.AbstractIL.StrongNameSign +[] type options = { ilg: ILGlobals outfile: string diff --git a/src/Compiler/AbstractIL/ilx.fs b/src/Compiler/AbstractIL/ilx.fs index cc911ef6d48..b1204fb2ce0 100644 --- a/src/Compiler/AbstractIL/ilx.fs +++ b/src/Compiler/AbstractIL/ilx.fs @@ -26,6 +26,7 @@ type IlxUnionCaseField(fd: ILFieldDef) = override x.ToString() = x.Name +[] type IlxUnionCase = { altName: string @@ -51,8 +52,10 @@ type IlxUnionHasHelpers = | SpecialFSharpListHelpers | SpecialFSharpOptionHelpers +[] type IlxUnionRef = IlxUnionRef of boxity: ILBoxity * ILTypeRef * IlxUnionCase[] * bool (* hasHelpers: *) * IlxUnionHasHelpers +[] type IlxUnionSpec = | IlxUnionSpec of IlxUnionRef * ILGenericArgs @@ -80,6 +83,7 @@ type IlxUnionSpec = override x.ToString() = x.TypeRef.Name +[] type IlxClosureLambdas = | Lambdas_forall of ILGenericParameterDef * IlxClosureLambdas | Lambdas_lambda of ILParameter * IlxClosureLambdas @@ -124,8 +128,10 @@ let mkILFreeVar (name, compgen, ty) = fvType = ty } +[] type IlxClosureRef = IlxClosureRef of ILTypeRef * IlxClosureLambdas * IlxClosureFreeVar[] +[] type IlxClosureSpec = | IlxClosureSpec of IlxClosureRef * ILGenericArgs * ILType * useStaticField: bool @@ -161,7 +167,8 @@ type IlxClosureSpec = override x.ToString() = x.TypeRef.ToString() -// Define an extension of the IL algebra of type definitions +/// Define an extension of the IL algebra of type definitions +[] type IlxClosureInfo = { cloStructure: IlxClosureLambdas @@ -170,6 +177,7 @@ type IlxClosureInfo = cloUseStaticField: bool } +[] type IlxUnionInfo = { UnionCasesAccessibility: ILMemberAccess diff --git a/src/Compiler/AbstractIL/ilx.fsi b/src/Compiler/AbstractIL/ilx.fsi index bb4a7344d84..02c3263ca71 100644 --- a/src/Compiler/AbstractIL/ilx.fsi +++ b/src/Compiler/AbstractIL/ilx.fsi @@ -17,6 +17,7 @@ type IlxUnionCaseField = member ILField: ILFieldDef /// Union alternative +[] type IlxUnionCase = { altName: string altFields: IlxUnionCaseField[] @@ -35,6 +36,7 @@ type IlxUnionHasHelpers = | SpecialFSharpOptionHelpers /// Union references +[] type IlxUnionRef = | IlxUnionRef of boxity: ILBoxity * @@ -43,6 +45,7 @@ type IlxUnionRef = bool (* IsNullPermitted *) * IlxUnionHasHelpers (* HasHelpers *) +[] type IlxUnionSpec = | IlxUnionSpec of IlxUnionRef * ILGenericArgs @@ -69,7 +72,7 @@ type IlxUnionSpec = // -------------------------------------------------------------------- // Closure references // -------------------------------------------------------------------- - +[] type IlxClosureLambdas = | Lambdas_forall of ILGenericParameterDef * IlxClosureLambdas | Lambdas_lambda of ILParameter * IlxClosureLambdas @@ -80,9 +83,11 @@ type IlxClosureFreeVar = fvCompilerGenerated: bool fvType: ILType } +[] type IlxClosureRef = IlxClosureRef of ILTypeRef * IlxClosureLambdas * IlxClosureFreeVar[] /// Represents a usage of a closure +[] type IlxClosureSpec = | IlxClosureSpec of IlxClosureRef * ILGenericArgs * ILType * useStaticField: bool @@ -116,6 +121,7 @@ type IlxClosureApps = | Apps_done of ILType /// Represents a closure prior to erasure +[] type IlxClosureInfo = { cloStructure: IlxClosureLambdas cloFreeVars: IlxClosureFreeVar[] @@ -123,6 +129,7 @@ type IlxClosureInfo = cloUseStaticField: bool } /// Represents a discriminated union type prior to erasure +[] type IlxUnionInfo = { /// Is the representation public? diff --git a/src/Compiler/Checking/AttributeChecking.fs b/src/Compiler/Checking/AttributeChecking.fs index 2f02f794e8b..f9849a4a9a5 100644 --- a/src/Compiler/Checking/AttributeChecking.fs +++ b/src/Compiler/Checking/AttributeChecking.fs @@ -77,6 +77,7 @@ let rec private evalFSharpAttribArg g attribExpr = // TODO: | TypeDefOfExpr g ty | _ -> fail() +[] type AttribInfo = | FSAttribInfo of TcGlobals * Attrib | ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range diff --git a/src/Compiler/Checking/AttributeChecking.fsi b/src/Compiler/Checking/AttributeChecking.fsi index b4a608ef1d1..e7e69be1adf 100644 --- a/src/Compiler/Checking/AttributeChecking.fsi +++ b/src/Compiler/Checking/AttributeChecking.fsi @@ -17,6 +17,7 @@ exception ObsoleteWarning of string * range exception ObsoleteError of string * range +[] type AttribInfo = | FSAttribInfo of TcGlobals * Attrib | ILAttribInfo of TcGlobals * Import.ImportMap * ILScopeRef * ILAttribute * range diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index bbfa5557b2d..469197f4c2d 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -34,6 +34,7 @@ let TcStackGuardDepth = GetEnvInteger "FSHARP_TcStackGuardDepth" 80 #endif /// The ValReprInfo for a value, except the number of typars is not yet inferred +[] type PrelimValReprInfo = | PrelimValReprInfo of curriedArgInfos: ArgReprInfo list list * @@ -43,7 +44,7 @@ type PrelimValReprInfo = // Data structures that track the gradual accumulation of information // about values and members during inference. //------------------------------------------------------------------------- - +[] type PrelimMemberInfo = | PrelimMemberInfo of memberInfo: ValMemberInfo * @@ -60,16 +61,19 @@ type CheckConstraints = /// /// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication /// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x +[] type ExplicitTyparInfo = | ExplicitTyparInfo of rigidCopyOfDeclaredTypars: Typars * declaredTypars: Typars * infer: bool +[] type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs /// The results of preliminary pass over patterns to extract variables being declared. // We should make this a record for cleaner code +[] type PrelimVal1 = | PrelimVal1 of id: Ident * @@ -88,8 +92,10 @@ type PrelimVal1 = member x.Ident = let (PrelimVal1(id=id)) = x in id +[] type UnscopedTyparEnv = UnscopedTyparEnv of NameMap +[] type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set /// Translation of patterns is split into three phases. The first collects names. @@ -97,6 +103,7 @@ type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap /// has been resolved. The second phase is run by applying a function returned by the /// first phase. The input to the second phase is a List.map that gives the Val and type scheme /// for each value bound by the pattern. +[] type TcPatPhase2Input = | TcPatPhase2Input of NameMap * bool @@ -105,10 +112,12 @@ type TcPatPhase2Input = /// Represents information about the initialization field used to check that object constructors /// have completed before fields are accessed. +[] type SafeInitData = | SafeInitField of RecdFieldRef * RecdField | NoSafeInitInfo +[] type TcPatValFlags = | TcPatValFlags of inlineFlag: ValInline * @@ -119,6 +128,7 @@ type TcPatValFlags = isCompilerGenerated: bool /// Represents information about object constructors +[] type CtorInfo = { /// Object model constructors have a very specific form to satisfy .NET limitations. /// For "new = \arg. { new C with ... }" diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index e3ad581cb61..4b07df52ead 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -23,11 +23,13 @@ open FSharp.Compiler.TypedTreeOps /// Represents information about the initialization field used to check that object constructors /// have completed before fields are accessed. +[] type SafeInitData = | SafeInitField of RecdFieldRef * RecdField | NoSafeInitInfo /// Represents information about object constructors +[] type CtorInfo = { /// Object model constructors have a very specific form to satisfy .NET limitations. @@ -138,6 +140,7 @@ type TcEnv = /// Represents the current environment of type variables that have implicit scope /// (i.e. are without explicit declaration). +[] type UnscopedTyparEnv = UnscopedTyparEnv of NameMap /// A type to represent information associated with values to indicate what explicit (declared) type parameters @@ -145,8 +148,10 @@ type UnscopedTyparEnv = UnscopedTyparEnv of NameMap /// /// The declared type parameters, e.g. let f<'a> (x:'a) = x, plus an indication /// of whether additional polymorphism may be inferred, e.g. let f<'a, ..> (x:'a) y = x +[] type ExplicitTyparInfo = ExplicitTyparInfo of rigidCopyOfDeclaredTypars: Typars * declaredTypars: Typars * infer: bool +[] type ArgAndRetAttribs = ArgAndRetAttribs of Attribs list list * Attribs /// Indicates whether constraints should be checked when checking syntactic types @@ -155,12 +160,15 @@ type CheckConstraints = | NoCheckCxs /// Represents the ValReprInfo for a value, before the typars are fully inferred +[] type PrelimValReprInfo = PrelimValReprInfo of curriedArgInfos: ArgReprInfo list list * returnInfo: ArgReprInfo /// Holds the initial ValMemberInfo and other information before it is fully completed +[] type PrelimMemberInfo = PrelimMemberInfo of memberInfo: ValMemberInfo * logicalName: string * compiledName: string /// Represents the results of the first phase of preparing simple values from a pattern +[] type PrelimVal1 = | PrelimVal1 of id: Ident * @@ -184,15 +192,18 @@ type PrelimVal1 = /// has been resolved. The second phase is run by applying a function returned by the /// first phase. The input to the second phase is a List.map that gives the Val and type scheme /// for each value bound by the pattern. +[] type TcPatPhase2Input = | TcPatPhase2Input of NameMap * bool member WithRightPath: unit -> TcPatPhase2Input /// Represents the context flowed left-to-right through pattern checking +[] type TcPatLinearEnv = TcPatLinearEnv of tpenv: UnscopedTyparEnv * names: NameMap * takenNames: Set -/// Represents the flags passsed to TcPat regarding the binding location +/// Represents the flags passed to TcPat regarding the binding location +[] type TcPatValFlags = | TcPatValFlags of inlineFlag: ValInline * diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 09704614b81..897ba57744c 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -50,11 +50,14 @@ type cenv = TcFileState // Mutually recursive shapes //------------------------------------------------------------------------- +[] type MutRecDataForOpen = MutRecDataForOpen of SynOpenDeclTarget * range * appliedScope: range * OpenDeclaration list ref + +[] type MutRecDataForModuleAbbrev = MutRecDataForModuleAbbrev of Ident * LongIdent * range /// Represents the shape of a mutually recursive group of declarations including nested modules -[] +[] type MutRecShape<'TypeData, 'LetsData, 'ModuleData> = | Tycon of 'TypeData | Lets of 'LetsData @@ -186,18 +189,22 @@ let ModuleOrNamespaceContainerInfo modref = let TyconContainerInfo (parent, tcref, declaredTyconTypars, safeInitInfo) = ContainerInfo(parent, Some(MemberOrValContainerInfo(tcref, None, None, safeInitInfo, declaredTyconTypars))) +[] type TyconBindingDefn = TyconBindingDefn of ContainerInfo * NewSlotsOK * DeclKind * SynMemberDefn option * range type MutRecSigsInitialData = MutRecShape list type MutRecDefnsInitialData = MutRecShape list +[] type MutRecDefnsPhase1DataForTycon = MutRecDefnsPhase1DataForTycon of SynComponentInfo * SynTypeDefnSimpleRepr * (SynType * range) list * preEstablishedHasDefaultCtor: bool * hasSelfReferentialCtor: bool * isAtOriginalTyconDefn: bool type MutRecDefnsPhase1Data = MutRecShape list +[] type MutRecDefnsPhase2DataForTycon = MutRecDefnsPhase2DataForTycon of Tycon option * ParentRef * DeclKind * TyconRef * Val option * SafeInitData * Typars * SynMemberDefn list * range * NewSlotsOK * fixupFinalAttribs: (unit -> unit) +[] type MutRecDefnsPhase2DataForModule = MutRecDefnsPhase2DataForModule of ModuleOrNamespaceType ref * ModuleOrNamespace type MutRecDefnsPhase2Data = MutRecShape list - +[] type MutRecDefnsPhase2InfoForTycon = MutRecDefnsPhase2InfoForTycon of Tycon option * TyconRef * Typars * DeclKind * TyconBindingDefn list * fixupFinalAttrs: (unit -> unit) type MutRecDefnsPhase2Info = MutRecShape list @@ -885,6 +892,7 @@ module AddAugmentationDeclarations = module MutRecBindingChecking = /// Represents one element in a type definition, after the first phase + [] type TyconBindingPhase2A = /// An entry corresponding to the definition of the static constructor of a class and optional of the incremental constructor (if one exists) | Phase2AIncrClassCtor of StaticCtorInfo * IncrClassCtorInfo option @@ -914,6 +922,7 @@ module MutRecBindingChecking = | Phase2AIncrClassCtorJustAfterLastLet /// The collected syntactic input definitions for a single type or type-extension definition + [] type TyconBindingsPhase2A = | TyconBindingsPhase2A of Tycon option * DeclKind * Val list * TyconRef * Typar list * TType * TyconBindingPhase2A list @@ -921,6 +930,7 @@ module MutRecBindingChecking = type MutRecDefnsPhase2AData = MutRecShape list /// Represents one element in a type definition, after the second phase + [] type TyconBindingPhase2B = | Phase2BIncrClassCtor of staticCtorInfo: StaticCtorInfo * incrCtorInfoOpt: IncrClassCtorInfo option * safeThisValBindOpt: Binding option @@ -941,11 +951,13 @@ module MutRecBindingChecking = /// this point. | Phase2BIncrClassCtorJustAfterLastLet + [] type TyconBindingsPhase2B = TyconBindingsPhase2B of Tycon option * TyconRef * TyconBindingPhase2B list type MutRecDefnsPhase2BData = MutRecShape list /// Represents one element in a type definition, after the third phase + [] type TyconBindingPhase2C = | Phase2CIncrClassCtor of StaticCtorInfo * IncrClassCtorInfo option * Binding option @@ -960,6 +972,7 @@ module MutRecBindingChecking = | Phase2CIncrClassCtorJustAfterLastLet + [] type TyconBindingsPhase2C = TyconBindingsPhase2C of Tycon option * TyconRef * TyconBindingPhase2C list type MutRecDefnsPhase2CData = MutRecShape list @@ -5518,6 +5531,7 @@ type ConditionalDefines = /// The attributes that don't get attached to any declaration +[] type TopAttribs = { mainMethodAttrs: Attribs netModuleAttrs: Attribs diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index fb4679f2438..82dcfe40bf7 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -31,6 +31,7 @@ val AddCcuToTcEnv: internalsVisibleToAttributes: string list -> OpenDeclaration list * TcEnv +[] type TopAttribs = { mainMethodAttrs: Attribs netModuleAttrs: Attribs diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 6f169d474a8..d5b00a97ea5 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -52,68 +52,95 @@ open FSharp.Compiler.TypeProviders exception BakedInMemberConstraintName of string * range +[] exception FunctionExpected of DisplayEnv * TType * range +[] exception NotAFunction of DisplayEnv * TType * range * range +[] exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range * bool +[] exception Recursion of DisplayEnv * Ident * TType * TType * range +[] exception RecursiveUseCheckedAtRuntime of DisplayEnv * ValRef * range +[] exception LetRecEvaluatedOutOfOrder of DisplayEnv * ValRef * ValRef * range exception LetRecCheckedAtRuntime of range +[] exception LetRecUnsound of DisplayEnv * ValRef list * range +[] exception TyconBadArgs of DisplayEnv * TyconRef * int * range +[] exception UnionCaseWrongArguments of DisplayEnv * int * int * range +[] exception UnionCaseWrongNumberOfArgs of DisplayEnv * int * int * range +[] exception FieldsFromDifferentTypes of DisplayEnv * RecdFieldRef * RecdFieldRef * range +[] exception FieldGivenTwice of DisplayEnv * RecdFieldRef * range exception MissingFields of string list * range +[] exception FunctionValueUnexpected of DisplayEnv * TType * range +[] exception UnitTypeExpected of DisplayEnv * TType * range +[] exception UnitTypeExpectedWithEquality of DisplayEnv * TType * range +[] exception UnitTypeExpectedWithPossibleAssignment of DisplayEnv * TType * bool * string * range +[] exception UnitTypeExpectedWithPossiblePropertySetter of DisplayEnv * TType * string * string * range exception UnionPatternsBindDifferentNames of range +[] exception VarBoundTwice of Ident +[] exception ValueRestriction of DisplayEnv * InfoReader * bool * Val * Typar * range +[] exception ValNotMutable of DisplayEnv * ValRef * range +[] exception ValNotLocal of DisplayEnv * ValRef * range +[] exception InvalidRuntimeCoercion of DisplayEnv * TType * TType * range +[] exception IndeterminateRuntimeCoercion of DisplayEnv * TType * TType * range +[] exception IndeterminateStaticCoercion of DisplayEnv * TType * TType * range +[] exception RuntimeCoercionSourceSealed of DisplayEnv * TType * range +[] exception CoercionTargetSealed of DisplayEnv * TType * range exception UpcastUnnecessary of range exception TypeTestUnnecessary of range +[] exception StaticCoercionShouldUseBox of DisplayEnv * TType * TType * range exception SelfRefObjCtor of bool * range @@ -134,6 +161,7 @@ exception OverrideInIntrinsicAugmentation of range exception OverrideInExtrinsicAugmentation of range +[] exception NonUniqueInferredAbstractSlot of TcGlobals * DisplayEnv * string * MethInfo * MethInfo * range exception StandardOperatorRedefinitionWarning of string * range @@ -365,6 +393,7 @@ type DeclKind = /// The results of applying let-style generalization after type checking. // We should make this a record for cleaner code +[] type PrelimVal2 = PrelimVal2 of id: Ident * @@ -380,6 +409,7 @@ type PrelimVal2 = hasDeclaredTypars: bool /// The results of applying arity inference to PrelimVal2 +[] type ValScheme = | ValScheme of id: Ident * @@ -405,6 +435,7 @@ type ValScheme = /// The first phase of checking and elaborating a binding leaves a goop of information. /// This is a bit of a mess: much of this information is also carried on a per-value basis by the /// "NameMap". +[] type CheckedBindingInfo = | CheckedBindingInfo of inlineFlag: ValInline * @@ -1461,6 +1492,7 @@ let RecordUseOfRecValue (cenv: cenv) valRecInfo (vrefTgt: ValRef) vExpr m = | ValNotInRecScope -> vExpr +[] type RecursiveUseFixupPoints = RecursiveUseFixupPoints of (Expr ref * range) list /// Get all recursive references, for fixing up delayed recursion using laziness @@ -2308,6 +2340,7 @@ let ComputeInlineFlag (memFlagsOption: SynMemberFlags option) isInline isMutable // below is of the second form. However, to extract relevant information // we keep a record of the pats and optional explicit return type already pushed // into expression so we can use any user-given type information from these +[] type NormalizedBindingRhs = | NormalizedBindingRhs of simplePats: SynSimplePats list * @@ -2318,11 +2351,13 @@ let PushOnePatternToRhs (cenv: cenv) isMember synPat (NormalizedBindingRhs(simpl let simplePats, rhsExpr = PushPatternToExpr cenv.synArgNameGenerator isMember synPat rhsExpr NormalizedBindingRhs(simplePats :: simplePatsList, retTyOpt, rhsExpr) +[] type NormalizedBindingPatternInfo = NormalizedBindingPat of SynPat * NormalizedBindingRhs * SynValData * SynValTyparDecls /// Represents a syntactic, unchecked binding after the resolution of the name resolution status of pattern /// constructors and after "pushing" all complex patterns to the right hand side. +[] type NormalizedBinding = | NormalizedBinding of visibility: SynAccess option * @@ -2787,6 +2822,7 @@ let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTy /// Mark points where we decide whether an expression will support automatic /// decondensation or not. +[] type ApplicableExpr = | ApplicableExpr of // context @@ -3380,6 +3416,7 @@ type InitializationGraphAnalysisState = | MaybeLazy | DefinitelyLazy +[] type PreInitializationGraphEliminationBinding = { FixupPoints: RecursiveUseFixupPoints Binding: Binding } @@ -3788,7 +3825,7 @@ let buildApp (cenv: cenv) expr resultTy arg m = //------------------------------------------------------------------------- // Additional data structures used by type checking //------------------------------------------------------------------------- - +[] type DelayedItem = /// Represents the in "item" | DelayedTypeApp of @@ -3840,6 +3877,7 @@ type WarnOnIWSAM = | No /// Represents information about the module or type in which a member or value is declared. +[] type MemberOrValContainerInfo = | MemberOrValContainerInfo of tcref: TyconRef * @@ -3849,6 +3887,7 @@ type MemberOrValContainerInfo = declaredTyconTypars: Typars /// Provides information about the context for a value or member definition +[] type ContainerInfo = | ContainerInfo of // The nearest containing module. Used as the 'actual' parent for extension members and values @@ -3862,6 +3901,7 @@ type ContainerInfo = /// Indicates a declaration is contained in an expression let ExprContainerInfo = ContainerInfo(ParentNone, None) +[] type NormalizedRecBindingDefn = | NormalizedRecBindingDefn of containerInfo: ContainerInfo * @@ -3869,6 +3909,7 @@ type NormalizedRecBindingDefn = declKind: DeclKind * binding: NormalizedBinding +[] type ValSpecResult = | ValSpecResult of altActualParent: ParentRef * @@ -3880,13 +3921,15 @@ type ValSpecResult = prelimValReprInfo: PrelimValReprInfo * declKind: DeclKind +[] type DecodedIndexArg = | IndexArgRange of (SynExpr * bool) option * (SynExpr * bool) option * range * range | IndexArgItem of SynExpr * bool * range + //------------------------------------------------------------------------- // Additional data structures used by checking recursive bindings //------------------------------------------------------------------------- - +[] type RecDefnBindingInfo = | RecDefnBindingInfo of containerInfo: ContainerInfo * @@ -3895,6 +3938,7 @@ type RecDefnBindingInfo = synBinding: SynBinding /// RecursiveBindingInfo - flows through initial steps of TcLetrecBindings +[] type RecursiveBindingInfo = | RecursiveBindingInfo of recBindIndex: int * // index of the binding in the recursive group @@ -3920,21 +3964,25 @@ type RecursiveBindingInfo = member x.ContainerInfo = let (RecursiveBindingInfo(_, c, _, _, _, _, _, _, _, _, _, _, _, _)) = x in c member x.DeclKind = let (RecursiveBindingInfo(_, _, _, _, _, _, _, _, _, _, _, _, _, declKind)) = x in declKind +[] type PreCheckingRecursiveBinding = { SyntacticBinding: NormalizedBinding RecBindingInfo: RecursiveBindingInfo } +[] type PreGeneralizationRecursiveBinding = { ExtraGeneralizableTypars: Typars CheckedBinding: CheckedBindingInfo RecBindingInfo: RecursiveBindingInfo } +[] type PostGeneralizationRecursiveBinding = { ValScheme: ValScheme CheckedBinding: CheckedBindingInfo RecBindingInfo: RecursiveBindingInfo } member x.GeneralizedTypars = x.ValScheme.GeneralizedTypars +[] type PostSpecialValsRecursiveBinding = { ValScheme: ValScheme Binding: Binding } diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 16a759c2e3d..ac4cea9f38b 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -33,64 +33,91 @@ open FSharp.Compiler.TypeProviders exception BakedInMemberConstraintName of string * range +[] exception FunctionExpected of DisplayEnv * TType * range +[] exception NotAFunction of DisplayEnv * TType * range * range +[] exception NotAFunctionButIndexer of DisplayEnv * TType * string option * range * range * bool +[] exception Recursion of DisplayEnv * Ident * TType * TType * range +[] exception RecursiveUseCheckedAtRuntime of DisplayEnv * ValRef * range +[] exception LetRecEvaluatedOutOfOrder of DisplayEnv * ValRef * ValRef * range exception LetRecCheckedAtRuntime of range +[] exception LetRecUnsound of DisplayEnv * ValRef list * range +[] exception TyconBadArgs of DisplayEnv * TyconRef * int * range +[] exception UnionCaseWrongArguments of DisplayEnv * int * int * range +[] exception UnionCaseWrongNumberOfArgs of DisplayEnv * int * int * range +[] exception FieldsFromDifferentTypes of DisplayEnv * RecdFieldRef * RecdFieldRef * range +[] exception FieldGivenTwice of DisplayEnv * RecdFieldRef * range exception MissingFields of string list * range +[] exception UnitTypeExpected of DisplayEnv * TType * range +[] exception UnitTypeExpectedWithEquality of DisplayEnv * TType * range +[] exception UnitTypeExpectedWithPossiblePropertySetter of DisplayEnv * TType * string * string * range +[] exception UnitTypeExpectedWithPossibleAssignment of DisplayEnv * TType * bool * string * range +[] exception FunctionValueUnexpected of DisplayEnv * TType * range exception UnionPatternsBindDifferentNames of range +[] exception VarBoundTwice of Ident +[] exception ValueRestriction of DisplayEnv * InfoReader * bool * Val * Typar * range +[] exception ValNotMutable of DisplayEnv * ValRef * range +[] exception ValNotLocal of DisplayEnv * ValRef * range +[] exception InvalidRuntimeCoercion of DisplayEnv * TType * TType * range +[] exception IndeterminateRuntimeCoercion of DisplayEnv * TType * TType * range +[] exception IndeterminateStaticCoercion of DisplayEnv * TType * TType * range +[] exception StaticCoercionShouldUseBox of DisplayEnv * TType * TType * range +[] exception RuntimeCoercionSourceSealed of DisplayEnv * TType * range +[] exception CoercionTargetSealed of DisplayEnv * TType * range exception UpcastUnnecessary of range @@ -115,6 +142,7 @@ exception OverrideInIntrinsicAugmentation of range exception OverrideInExtrinsicAugmentation of range +[] exception NonUniqueInferredAbstractSlot of TcGlobals * DisplayEnv * string * MethInfo * MethInfo * range exception StandardOperatorRedefinitionWarning of string * range @@ -144,6 +172,7 @@ val dontInferTypars: ExplicitTyparInfo val noArgOrRetAttribs: ArgAndRetAttribs /// The results of applying let-style generalization after type checking. +[] type PrelimVal2 = | PrelimVal2 of id: Ident * @@ -159,6 +188,7 @@ type PrelimVal2 = hasDeclaredTypars: bool /// Represents information about the module or type in which a member or value is declared. +[] type MemberOrValContainerInfo = | MemberOrValContainerInfo of tcref: TyconRef * @@ -168,6 +198,7 @@ type MemberOrValContainerInfo = declaredTyconTypars: Typars /// Provides information about the context for a value or member definition. +[] type ContainerInfo = | ContainerInfo of ParentRef * MemberOrValContainerInfo option @@ -221,6 +252,7 @@ type IsObjExprBinding = | ValOrMemberBinding /// Represents the initial information about a recursive binding +[] type RecDefnBindingInfo = | RecDefnBindingInfo of containerInfo: ContainerInfo * @@ -229,6 +261,7 @@ type RecDefnBindingInfo = synBinding: SynBinding /// The result of checking a value or member signature +[] type ValSpecResult = | ValSpecResult of altActualParent: ParentRef * @@ -244,6 +277,7 @@ type ValSpecResult = val emptyUnscopedTyparEnv: UnscopedTyparEnv /// NormalizedBindingRhs records the r.h.s. of a binding after some munging just before type checking. +[] type NormalizedBindingRhs = | NormalizedBindingRhs of simplePats: SynSimplePats list * @@ -252,6 +286,7 @@ type NormalizedBindingRhs = /// Represents a syntactic, unchecked binding after the resolution of the name resolution status of pattern /// constructors and after "pushing" all complex patterns to the right hand side. +[] type NormalizedBinding = | NormalizedBinding of visibility: SynAccess option * @@ -268,6 +303,7 @@ type NormalizedBinding = spBinding: DebugPointAtBinding /// RecursiveBindingInfo - flows through initial steps of TcLetrec +[] type RecursiveBindingInfo = | RecursiveBindingInfo of recBindIndex: int * // index of the binding in the recursive group @@ -290,10 +326,11 @@ type RecursiveBindingInfo = member Index: int /// Represents the results of the first phase of preparing bindings -[] +[] type CheckedBindingInfo /// Represents the results of the second phase of checking simple values +[] type ValScheme = | ValScheme of id: Ident * @@ -311,6 +348,7 @@ type ValScheme = hasDeclaredTypars: bool /// Represents a recursive binding after it has been normalized but before it's info has been put together +[] type NormalizedRecBindingDefn = | NormalizedRecBindingDefn of containerInfo: ContainerInfo * @@ -319,11 +357,13 @@ type NormalizedRecBindingDefn = binding: NormalizedBinding /// Represents a recursive binding after it has been normalized but before it has been checked +[] type PreCheckingRecursiveBinding = { SyntacticBinding: NormalizedBinding RecBindingInfo: RecursiveBindingInfo } /// Represents a recursive binding after it has been checked but prior to generalization +[] type PreGeneralizationRecursiveBinding = { ExtraGeneralizableTypars: Typars CheckedBinding: CheckedBindingInfo @@ -335,6 +375,7 @@ type PreGeneralizationRecursiveBinding = type RecursiveUseFixupPoints /// Represents a recursive binding after it has been both checked and generalized +[] type PostGeneralizationRecursiveBinding = { ValScheme: ValScheme CheckedBinding: CheckedBindingInfo @@ -344,12 +385,14 @@ type PostGeneralizationRecursiveBinding = /// Represents a recursive binding after it has been both checked and generalized and after /// the special adjustments for 'as this' class initialization checks have been inserted into members. +[] type PostSpecialValsRecursiveBinding = { ValScheme: ValScheme Binding: Binding } /// Represents a recursive binding after it has been both checked and generalized, but /// before initialization recursion has been rewritten +[] type PreInitializationGraphEliminationBinding = { FixupPoints: RecursiveUseFixupPoints Binding: Binding } diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index e32d073cbd1..3bc33e62338 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -15,6 +15,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals +[] type FormatItem = Simple of TType | FuncAndVal let copyAndFixupFormatTypar g m tp = diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fs b/src/Compiler/Checking/CheckIncrementalClasses.fs index 8ef4d3734f9..412af38b843 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fs +++ b/src/Compiler/Checking/CheckIncrementalClasses.fs @@ -31,11 +31,13 @@ let TcClassRewriteStackGuardDepth = StackGuard.GetDepthOption "TcClassRewrite" exception ParameterlessStructCtor of range: range /// Represents a single group of bindings in a class with an implicit constructor +[] type IncrClassBindingGroup = | IncrClassBindingGroup of bindings: Binding list * isStatic: bool* isRecursive: bool | IncrClassDo of expr: Expr * isStatic: bool * range: Range /// Typechecked info for implicit constructor and it's arguments +[] type StaticCtorInfo = { /// The TyconRef for the type being defined @@ -60,6 +62,7 @@ type StaticCtorInfo = ctorDeclaredTypars /// Typechecked info for implicit constructor and it's arguments +[] type IncrClassCtorInfo = { /// The value representing the implicit constructor. @@ -215,6 +218,7 @@ let private MakeIncrClassField(g, cpath, formalTyparInst: TyparInstantiation, v: /// Indicates how is a 'let' bound value in a class with implicit construction is represented in /// the TAST ultimately produced by type checking. +[] type IncrClassValRepr = // e.g representation for 'let v = 3' if it is not used in anything given a method representation @@ -228,6 +232,7 @@ type IncrClassValRepr = /// IncrClassReprInfo represents the decisions we make about the representation of 'let' and 'do' bindings in a /// type defined with implicit class construction. +[] type IncrClassReprInfo = { /// Indicates the set of field names taken within one incremental class @@ -557,6 +562,7 @@ type IncrClassReprInfo = RewriteQuotations = true StackGuard = StackGuard(TcClassRewriteStackGuardDepth, "FixupIncrClassExprPhase2C") } expr +[] type IncrClassConstructionBindingsPhase2C = | Phase2CBindings of IncrClassBindingGroup list | Phase2CCtorJustAfterSuperInit diff --git a/src/Compiler/Checking/CheckIncrementalClasses.fsi b/src/Compiler/Checking/CheckIncrementalClasses.fsi index 0de56111ff9..8ba84cc078d 100644 --- a/src/Compiler/Checking/CheckIncrementalClasses.fsi +++ b/src/Compiler/Checking/CheckIncrementalClasses.fsi @@ -14,6 +14,7 @@ open FSharp.Compiler.Xml exception ParameterlessStructCtor of range: range /// Typechecked info for implicit static constructor +[] type StaticCtorInfo = { /// The TyconRef for the type being defined @@ -31,6 +32,7 @@ type StaticCtorInfo = } /// Typechecked info for implicit instance constructor and it's arguments +[] type IncrClassCtorInfo = { /// The value representing the implicit constructor. @@ -58,6 +60,7 @@ type IncrClassCtorInfo = /// Indicates how is a 'let' bound value in a class with implicit construction is represented in /// the TAST ultimately produced by type checking. +[] type IncrClassValRepr = // e.g representation for 'let v = 3' if it is not used in anything given a method representation @@ -71,6 +74,7 @@ type IncrClassValRepr = /// IncrClassReprInfo represents the decisions we make about the representation of 'let' and 'do' bindings in a /// type defined with implicit class construction. +[] type IncrClassReprInfo = { /// Indicates the set of field names taken within one incremental class @@ -107,10 +111,12 @@ type IncrClassReprInfo = Expr /// Represents a single group of bindings in a class with an implicit constructor +[] type IncrClassBindingGroup = | IncrClassBindingGroup of bindings: Binding list * isStatic: bool * isRecursive: bool | IncrClassDo of expr: Expr * isStatic: bool * range: Range +[] type IncrClassConstructionBindingsPhase2C = | Phase2CBindings of IncrClassBindingGroup list | Phase2CCtorJustAfterSuperInit diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 3c0f68c2859..ce544daed8e 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -154,7 +154,7 @@ let FreshenMethInfo m (minfo: MethInfo) = //------------------------------------------------------------------------- /// Information about the context of a type equation. -[] +[] type ContextInfo = /// No context was given. @@ -201,6 +201,7 @@ type ContextInfo = | SequenceExpression of TType /// Captures relevant information for a particular failed overload resolution. +[] type OverloadInformation = { methodSlot: CalledMeth @@ -209,6 +210,7 @@ type OverloadInformation = } /// Cases for overload resolution failure that exists in the implementation of the compiler. +[] type OverloadResolutionFailure = | NoOverloadsFound of methodName: string * @@ -219,6 +221,7 @@ type OverloadResolutionFailure = candidates: OverloadInformation list * cx: TraitConstraintInfo option +[] type OverallTy = /// Each branch of the expression must have the type indicated | MustEqual of TType @@ -232,32 +235,44 @@ type OverallTy = | MustEqual ty -> ty | MustConvertTo (_, ty) -> ty +[] exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType list * TType list * range * range +[] exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range +[] exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo +[] exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * argTy: TType * paramTy: TType * callRange: range * parameterRange: range +[] exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Typar * TyparConstraint * range * range exception ConstraintSolverError of string * range * range +[] exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * error: exn * range: range +[] exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * expectedTy: TType * actualTy: TType * error: exn * range: range +[] exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * expectedTy: TType * actualTy: TType * error: exn * ctxtInfo: ContextInfo * parameterRange: range +[] exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * error: exn * range: range +[] exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range: range +[] exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range type TcValF = ValRef -> ValUseFlag -> TType list -> range -> Expr * TType +[] type ConstraintSolverState = { g: TcGlobals @@ -310,6 +325,7 @@ type ConstraintSolverState = member this.GetPostInferenceChecksFinal() = this.PostInferenceChecksFinal.ToArray() :> seq<_> +[] type ConstraintSolverEnv = { SolverState: ConstraintSolverState @@ -436,6 +452,7 @@ let IsBinaryOpOtherArgType g permitWeakResolution ty = let IsSignType g ty = isSignedIntegerTy g ty || isFpTy g ty || isDecimalTy g ty +[] type TraitConstraintSolution = | TTraitUnsolved | TTraitBuiltIn @@ -459,7 +476,7 @@ let BakedInTraitConstraintNames = //------------------------------------------------------------------------- // Run the constraint solver with undo (used during method overload resolution) - +[] type Trace = { mutable actions: ((unit -> unit) * (unit -> unit)) list } @@ -468,6 +485,7 @@ type Trace = member t.Undo () = List.iter (fun (_, a) -> a ()) t.actions member t.Push f undo = t.actions <- (f, undo) :: t.actions +[] type OptionalTrace = | NoTrace | WithTrace of Trace @@ -519,7 +537,7 @@ let ShowAccessDomain ad = //------------------------------------------------------------------------- // Solve - +[] exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range /// Signal that there is still an unresolved overload in the constraint problem. The @@ -594,6 +612,7 @@ let PostponeOnFailedMemberConstraintResolution (csenv: ConstraintSolverEnv) (tra | exn -> f2 exn) /// used to provide detail about non matched argument in overload resolution error message +[] exception ArgDoesNotMatchError of error: ErrorsFromAddingSubsumptionConstraint * calledMeth: CalledMeth * calledArg: CalledArg * callerArg: CallerArg /// Represents a very local condition where we prefer to report errors before stripping type abbreviations. diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index eb48ce3b439..5e587ba1c4a 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -71,7 +71,7 @@ val FreshenTypars: g: TcGlobals -> range -> Typars -> TType list val FreshenMethInfo: range -> MethInfo -> TType list /// Information about the context of a type equation. -[] +[] type ContextInfo = /// No context was given. @@ -117,12 +117,14 @@ type ContextInfo = | SequenceExpression of TType /// Captures relevant information for a particular failed overload resolution. +[] type OverloadInformation = { methodSlot: CalledMeth infoReader: InfoReader error: exn } /// Cases for overload resolution failure that exists in the implementation of the compiler. +[] type OverloadResolutionFailure = | NoOverloadsFound of methodName: string * candidates: OverloadInformation list * cx: TraitConstraintInfo option | PossibleCandidates of @@ -131,6 +133,7 @@ type OverloadResolutionFailure = cx: TraitConstraintInfo option /// Represents known information prior to checking an expression or pattern, e.g. it's expected type +[] type OverallTy = /// Each branch of the expression must have the type indicated | MustEqual of TType @@ -141,6 +144,7 @@ type OverallTy = /// Represents a point where no subsumption/widening is possible member Commit: TType +[] exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * contextInfo: ContextInfo * @@ -149,6 +153,7 @@ exception ConstraintSolverTupleDiffLengths of range * range +[] exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * @@ -157,6 +162,7 @@ exception ConstraintSolverInfiniteTypes of range * range +[] exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * @@ -165,6 +171,7 @@ exception ConstraintSolverTypesNotInEqualityRelation of range * ContextInfo +[] exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * argTy: TType * @@ -172,10 +179,12 @@ exception ConstraintSolverTypesNotInSubsumptionRelation of callRange: range * parameterRange: range +[] exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Typar * TyparConstraint * range * range exception ConstraintSolverError of string * range * range +[] exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * @@ -184,6 +193,7 @@ exception ErrorFromApplyingDefault of error: exn * range: range +[] exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * @@ -192,6 +202,7 @@ exception ErrorFromAddingTypeEquation of error: exn * range: range +[] exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * @@ -201,17 +212,23 @@ exception ErrorsFromAddingSubsumptionConstraint of ctxtInfo: ContextInfo * parameterRange: range +[] exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * error: exn * range: range + +[] exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range +[] exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range: range +[] exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range +[] exception ArgDoesNotMatchError of error: ErrorsFromAddingSubsumptionConstraint * calledMeth: CalledMeth * @@ -221,7 +238,7 @@ exception ArgDoesNotMatchError of /// A function that denotes captured tcVal, Used in constraint solver and elsewhere to get appropriate expressions for a ValRef. type TcValF = ValRef -> ValUseFlag -> TType list -> range -> Expr * TType -[] +[] type ConstraintSolverState = static member New: TcGlobals * ImportMap * InfoReader * TcValF -> ConstraintSolverState @@ -239,6 +256,7 @@ val BakedInTraitConstraintNames: Set [] type Trace +[] type OptionalTrace = | NoTrace | WithTrace of Trace diff --git a/src/Compiler/Checking/FindUnsolved.fs b/src/Compiler/Checking/FindUnsolved.fs index cfc34649ae5..189e6389631 100644 --- a/src/Compiler/Checking/FindUnsolved.fs +++ b/src/Compiler/Checking/FindUnsolved.fs @@ -20,6 +20,7 @@ type env = | NoEnv let FindUnsolvedStackGuardDepth = StackGuard.GetDepthOption "FindUnsolved" /// The environment and collector +[] type cenv = { g: TcGlobals amap: Import.ImportMap diff --git a/src/Compiler/Checking/InfoReader.fs b/src/Compiler/Checking/InfoReader.fs index 86bbb1b83ca..9056092b3cc 100644 --- a/src/Compiler/Checking/InfoReader.fs +++ b/src/Compiler/Checking/InfoReader.fs @@ -291,7 +291,8 @@ let FilterMostSpecificMethInfoSets g amap m (minfoSets: NameMultiMap<_>) : NameM /// Sets of methods up the hierarchy, ignoring duplicates by name and sig. /// Used to collect sets of virtual methods, protected methods, protected -/// properties etc. +/// properties etc. +[] type HierarchyItem = | TraitItem of TraitConstraintInfo list | MethodItem of MethInfo list list diff --git a/src/Compiler/Checking/InfoReader.fsi b/src/Compiler/Checking/InfoReader.fsi index 3e8ceb927ca..1721e342837 100644 --- a/src/Compiler/Checking/InfoReader.fsi +++ b/src/Compiler/Checking/InfoReader.fsi @@ -73,6 +73,7 @@ val FilterMostSpecificMethInfoSets: /// Sets of methods up the hierarchy, ignoring duplicates by name and sig. /// Used to collect sets of virtual methods, protected methods, protected /// properties etc. +[] type HierarchyItem = | TraitItem of TraitConstraintInfo list | MethodItem of MethInfo list list diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 4878c66511c..4dc65ddeb75 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -50,6 +50,7 @@ open FSharp.Compiler.TypeProviders /// an adhoc conversion. /// /// The bool indicates if named using a '?', making the caller argument explicit-optional +[] type CallerArg<'T> = /// CallerArg(ty, range, isOpt, exprInfo) | CallerArg of ty: TType * range: range * isOpt: bool * exprInfo: 'T @@ -63,6 +64,7 @@ type CallerArg<'T> = member x.Expr = (let (CallerArg(_, _, _, expr)) = x in expr) /// Represents the information about an argument in the method being called +[] type CalledArg = { Position: struct (int * int) IsParamArray : bool @@ -87,6 +89,7 @@ let CalledArg (pos, isParamArray, optArgInfo, callerInfo, isInArg, isOutArg, nam /// Represents a match between a caller argument and a called argument, arising from either /// a named argument or an unnamed argument. +[] type AssignedCalledArg<'T> = { /// The identifier for a named argument, if any @@ -101,6 +104,7 @@ type AssignedCalledArg<'T> = member x.Position = x.CalledArg.Position /// Represents the possibilities for a named-setter argument (a property, field, or a record field setter) +[] type AssignedItemSetterTarget = // the MethInfo is a non-indexer setter property | AssignedPropSetter of staticTyOpt: TType option * pinfo: PropInfo * minfo: MethInfo * pminst: TypeInst @@ -108,8 +112,10 @@ type AssignedItemSetterTarget = | AssignedRecdFieldSetter of RecdFieldInfo /// Represents the resolution of a caller argument as a named-setter argument +[] type AssignedItemSetter<'T> = AssignedItemSetter of Ident * AssignedItemSetterTarget * CallerArg<'T> +[] type CallerNamedArg<'T> = | CallerNamedArg of Ident * CallerArg<'T> @@ -122,7 +128,7 @@ type CallerNamedArg<'T> = /// Represents the list of unnamed / named arguments at method call site /// remark: The usage of list list is due to tupling and currying of arguments, /// stemming from SynValInfo in the AST. -[] +[] type CallerArgs<'T> = { Unnamed: CallerArg<'T> list list @@ -229,12 +235,12 @@ let TryFindRelevantImplicitConversion (infoReader: InfoReader) ad reqdTy actualT else None -[] +[] type TypeDirectedConversion = | BuiltIn | Implicit of MethInfo -[] +[] type TypeDirectedConversionUsed = | Yes of (DisplayEnv -> exn) * isTwoStepConversion: bool * isNullable: bool | No @@ -452,7 +458,7 @@ let AdjustCalledArgType (infoReader: InfoReader) ad isConstraint enforceNullable //------------------------------------------------------------------------- // CalledMeth //------------------------------------------------------------------------- - +[] type CalledMethArgSet<'T> = { /// The called arguments corresponding to "unnamed" arguments UnnamedCalledArgs : CalledArg list @@ -829,7 +835,7 @@ let NamesOfCalledArgs (calledArgs: CalledArg list) = //------------------------------------------------------------------------- // Helpers dealing with propagating type information in method overload resolution //------------------------------------------------------------------------- - +[] type ArgumentAnalysis = | NoInfo | ArgDoesNotMatch @@ -2088,6 +2094,7 @@ let RecdFieldInstanceChecks g amap ad m (rfinfo: RecdFieldInfo) = CheckRecdFieldInfoAttributes g rfinfo m |> CommitOperationResult CheckRecdFieldInfoAccessible amap m ad rfinfo +[] exception FieldNotMutable of DisplayEnv * RecdFieldRef * range let CheckRecdFieldMutation m denv (rfinfo: RecdFieldInfo) = diff --git a/src/Compiler/Checking/MethodCalls.fsi b/src/Compiler/Checking/MethodCalls.fsi index 60a5ace7201..a1a90ce969d 100644 --- a/src/Compiler/Checking/MethodCalls.fsi +++ b/src/Compiler/Checking/MethodCalls.fsi @@ -31,6 +31,7 @@ open FSharp.Compiler.TypeProviders /// an adhoc conversion. /// /// The bool indicates if named using a '?', making the caller argument explicit-optional +[] type CallerArg<'T> = | CallerArg of ty: TType * range: range * isOpt: bool * exprInfo: 'T @@ -42,6 +43,7 @@ type CallerArg<'T> = member Range: range +[] type CalledArg = { Position: struct (int * int) IsParamArray: bool @@ -67,6 +69,7 @@ val CalledArg: /// Represents a match between a caller argument and a called argument, arising from either /// a named argument or an unnamed argument. +[] type AssignedCalledArg<'T> = { /// The identifier for a named argument, if any @@ -82,14 +85,17 @@ type AssignedCalledArg<'T> = member Position: struct (int * int) /// Represents the possibilities for a named-setter argument (a property, field, or a record field setter) +[] type AssignedItemSetterTarget = | AssignedPropSetter of staticTyOpt: TType option * pinfo: PropInfo * minfo: MethInfo * pminst: TypeInst | AssignedILFieldSetter of ILFieldInfo | AssignedRecdFieldSetter of RecdFieldInfo /// Represents the resolution of a caller argument as a named-setter argument +[] type AssignedItemSetter<'T> = AssignedItemSetter of Ident * AssignedItemSetterTarget * CallerArg<'T> +[] type CallerNamedArg<'T> = | CallerNamedArg of Ident * CallerArg<'T> @@ -102,7 +108,7 @@ type CallerNamedArg<'T> = /// Represents the list of unnamed / named arguments at method call site /// remark: The usage of list list is due to tupling and currying of arguments, /// stemming from SynValInfo in the AST. -[] +[] type CallerArgs<'T> = { Unnamed: CallerArg<'T> list list Named: CallerNamedArg<'T> list list } @@ -117,7 +123,7 @@ type CallerArgs<'T> = /// Indicates whether a type directed conversion (e.g. int32 to int64, or op_Implicit) /// has been used in F# code -[] +[] type TypeDirectedConversionUsed = | Yes of (DisplayEnv -> exn) * isTwoStepConversion: bool * isNullable: bool | No @@ -160,6 +166,7 @@ val AdjustCalledArgType: callerArg: CallerArg<'a> -> TType * TypeDirectedConversionUsed * (TType * TType * (DisplayEnv -> unit)) option +[] type CalledMethArgSet<'T> = { /// The called arguments corresponding to "unnamed" arguments @@ -311,6 +318,7 @@ type CalledMeth<'T> = val NamesOfCalledArgs: calledArgs: CalledArg list -> Ident list +[] type ArgumentAnalysis = | NoInfo | ArgDoesNotMatch @@ -477,6 +485,7 @@ val MethInfoChecks: minfo: MethInfo -> unit +[] exception FieldNotMutable of TypedTreeOps.DisplayEnv * RecdFieldRef * range val CheckRecdFieldMutation: m: range -> denv: TypedTreeOps.DisplayEnv -> rfinfo: RecdFieldInfo -> unit diff --git a/src/Compiler/Checking/MethodOverrides.fs b/src/Compiler/Checking/MethodOverrides.fs index 5abf08578fb..8ef19d2306e 100644 --- a/src/Compiler/Checking/MethodOverrides.fs +++ b/src/Compiler/Checking/MethodOverrides.fs @@ -34,6 +34,7 @@ type OverrideCanImplement = | CanImplementNoSlots /// The overall information about a method implementation in a class or object expression +[] type OverrideInfo = | Override of canImplement: OverrideCanImplement * @@ -65,8 +66,8 @@ type OverrideInfo = member x.IsCompilerGenerated = let (Override(isCompilerGenerated=b)) = x in b member x.IsInstance = let (Override(isInstance=b)) = x in b - +[] type RequiredSlot = | RequiredSlot of methodInfo: MethInfo * isOptional: bool | DefaultInterfaceImplementationSlot of methodInfo: MethInfo * isOptional: bool * possiblyNoMostSpecific: bool @@ -96,6 +97,7 @@ type RequiredSlot = | RequiredSlot(methInfo, _) | DefaultInterfaceImplementationSlot(methInfo, _, _) -> methInfo +[] type SlotImplSet = | SlotImplSet of dispatchSlots: RequiredSlot list * @@ -104,6 +106,8 @@ type SlotImplSet = requiredProperties: PropInfo list exception TypeIsImplicitlyAbstract of range + +[] exception OverrideDoesntOverride of DisplayEnv * OverrideInfo * MethInfo option * TcGlobals * Import.ImportMap * range module DispatchSlotChecking = diff --git a/src/Compiler/Checking/MethodOverrides.fsi b/src/Compiler/Checking/MethodOverrides.fsi index b06fb16e499..cbd429e64da 100644 --- a/src/Compiler/Checking/MethodOverrides.fsi +++ b/src/Compiler/Checking/MethodOverrides.fsi @@ -22,6 +22,7 @@ type OverrideCanImplement = | CanImplementNoSlots /// The overall information about a method implementation in a class or object expression +[] type OverrideInfo = | Override of canImplement: OverrideCanImplement * @@ -53,6 +54,7 @@ type OverrideInfo = member ReturnType: TType option +[] type RequiredSlot = | RequiredSlot of methodInfo: MethInfo * isOptional: bool | DefaultInterfaceImplementationSlot of methodInfo: MethInfo * isOptional: bool * possiblyNoMostSpecific: bool @@ -70,6 +72,7 @@ type RequiredSlot = /// A slot that *might* have ambiguity due to multiple inheritance; happens with default interface implementations. member PossiblyNoMostSpecificImplementation: bool +[] type SlotImplSet = | SlotImplSet of dispatchSlots: RequiredSlot list * @@ -79,6 +82,7 @@ type SlotImplSet = exception TypeIsImplicitlyAbstract of range +[] exception OverrideDoesntOverride of DisplayEnv * OverrideInfo * MethInfo option * TcGlobals * ImportMap * range module DispatchSlotChecking = diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 7b660d3d21d..6124eec6b2e 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -326,7 +326,7 @@ let valRefHash (vref: ValRef) = /// Pairs an Item with a TyparInstantiation showing how generic type variables of the item are instantiated at /// a particular usage point. -[] +[] type ItemWithInst = { Item: Item TyparInstantiation: TyparInstantiation } @@ -336,9 +336,11 @@ let ItemWithNoInst item = ({ Item = item; TyparInstantiation = emptyTyparInst } let (|ItemWithInst|) (x: ItemWithInst) = (x.Item, x.TyparInstantiation) /// Represents a record field resolution and the information if the usage is deprecated. +[] type FieldResolution = FieldResolution of RecdFieldInfo * bool /// Information about an extension member held in the name resolution environment +[] type ExtensionMember = /// F#-style Extrinsic extension member, defined in F# code @@ -1714,6 +1716,7 @@ type ItemOccurence = /// This is a usage of a module or namespace name in open statement | Open +[] type FormatStringCheckContext = { SourceText: ISourceText LineStartPositions: int[] } @@ -1986,7 +1989,7 @@ type TcResolutions static member Empty = empty -[] +[] type TcSymbolUseData = { ItemWithInst: ItemWithInst ItemOccurence: ItemOccurence @@ -2143,6 +2146,7 @@ type TcResultsSinkImpl(tcGlobals, ?sourceText: ISourceText) = /// An abstract type for reporting the results of name resolution and type checking, and which allows /// temporary suspension and/or redirection of reporting. +[] type TcResultsSink = { mutable CurrentSink: ITypecheckResultsSink option } static member NoSink = { CurrentSink = None } @@ -2201,6 +2205,7 @@ let CallOpenDeclarationSink (sink: TcResultsSink) (openDeclaration: OpenDeclarat /// Checks if the type variables associated with the result of a resolution are inferable, /// i.e. occur in the arguments or return type of the resolution. If not give a warning /// about a type instantiation being needed. +[] type ResultTyparChecker = ResultTyparChecker of (unit -> bool) let CheckAllTyparsInferrable amap m item = @@ -2266,6 +2271,7 @@ let CheckAllTyparsInferrable amap m item = /// Each of the resolution routines keeps track of the entity path and /// ultimately calls ResolutionInfo.Method to record it for /// later use by Visual Studio. +[] type ResolutionInfo = | ResolutionInfo of revEntityPath: (range * EntityRef) list * reportResult: (ResultTyparChecker -> unit) * tinstEnclosing: EnclosingTypeInst @@ -3998,7 +4004,7 @@ let NeedsWorkAfterResolution namedItem = | _ -> false /// Specifies additional work to do after an item has been processed further in type checking. -[] +[] type AfterResolution = /// Notification is not needed @@ -4215,7 +4221,7 @@ let ResolveRecordOrClassFieldsOfType (ncenv: NameResolver) m ad ty statics = |> List.filter (fun rfref -> rfref.IsStatic = statics && IsFieldInfoAccessible ad rfref) |> List.map Item.RecdField -[] +[] type ResolveCompletionTargets = | All of (MethInfo -> TType -> bool) | SettablePropertiesAndFields diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index 3ba5113b004..f4752cfb0c2 100755 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -156,7 +156,7 @@ type Item = /// Pairs an Item with a TyparInstantiation showing how generic type variables of the item are instantiated at /// a particular usage point. -[] +[] type ItemWithInst = { Item: Item TyparInstantiation: TyparInstantiation } @@ -165,9 +165,11 @@ val (|ItemWithInst|): ItemWithInst -> Item * TyparInstantiation val ItemWithNoInst: Item -> ItemWithInst /// Represents a record field resolution and the information if the usage is deprecated. +[] type FieldResolution = FieldResolution of RecdFieldInfo * bool /// Information about an extension member held in the name resolution environment +[] type ExtensionMember = /// F#-style Extrinsic extension member, defined in F# code | FSExtMem of ValRef * ExtensionMethodPriority @@ -440,7 +442,7 @@ type internal TcResolutions = /// Represents the empty set of resolutions static member Empty: TcResolutions -[] +[] type TcSymbolUseData = { ItemWithInst: ItemWithInst ItemOccurence: ItemOccurence @@ -464,6 +466,7 @@ type internal TcSymbolUses = static member Empty: TcSymbolUses /// Source text and an array of line end positions, used for format string parsing +[] type FormatStringCheckContext = { /// Source text @@ -525,6 +528,7 @@ type internal TcResultsSinkImpl = /// An abstract type for reporting the results of name resolution and type checking, and which allows /// temporary suspension and/or redirection of reporting. +[] type TcResultsSink = { mutable CurrentSink: ITypecheckResultsSink option } @@ -578,7 +582,7 @@ type PermitDirectReferenceToGeneratedType = | No /// Specifies extra work to do after overload resolution -[] +[] type AfterResolution = /// Notification is not needed | DoNothing @@ -837,7 +841,7 @@ val ResolvePartialLongIdent: allowObsolete: bool -> Item list -[] +[] type ResolveCompletionTargets = | All of (MethInfo -> TType -> bool) | SettablePropertiesAndFields diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 3caacecb982..d4468314d4f 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -70,9 +70,9 @@ type Pattern = | TPat_isinst(_, _, _, m) -> m | TPat_error m -> m -and PatternValBinding = PatternValBinding of Val * GeneralizedType +and [] PatternValBinding = PatternValBinding of Val * GeneralizedType -and MatchClause = +and [] MatchClause = | MatchClause of Pattern * Expr option * DecisionTreeTarget * range member c.GuardExpr = let (MatchClause(_, whenOpt, _, _)) = c in whenOpt member c.Pattern = let (MatchClause(p, _, _, _)) = c in p @@ -99,7 +99,7 @@ and MatchClause = // test, we apply the r.h.s. to a dummy type - it doesn't matter // which (unless the r.h.s. actually looks at it's type argument...) //--------------------------------------------------------------------------- - +[] type SubExprOfInput = | SubExpr of (TyparInstantiation -> Expr -> Expr) * (Expr * Val) @@ -138,6 +138,7 @@ let GetSubExprOfInput g (gtps, tyargs, tinst) (SubExpr(accessf, (ve2, v2))) = // A path reaches into a pattern. // The ints record which choices taken, e.g. tuple/record fields. +[] type Path = | PathQuery of Path * Unique | PathTuple of Path * TypeInst * int @@ -162,7 +163,7 @@ let rec pathEq p1 p2 = //--------------------------------------------------------------------------- // Counter example generation //--------------------------------------------------------------------------- - +[] type RefutedSet = /// A value RefutedInvestigation(path, discrim) indicates that the value at the given path is known /// to NOT be matched by the given discriminator @@ -384,13 +385,16 @@ let ShowCounterExample g denv m refuted = type ClauseNumber = int /// Represents an unresolved portion of pattern matching +[] type Active = Active of Path * SubExprOfInput * Pattern type Actives = Active list /// Represents an unresolved portion of pattern matching within a clause +[] type Frontier = Frontier of ClauseNumber * Actives * ValMap +[] type InvestigationPoint = Investigation of ClauseNumber * DecisionTreeTest * Path // Note: actives must be a SortedDictionary @@ -662,6 +666,7 @@ let isDiscrimSubsumedBy g amap m discrim taken = | _ -> false +[] type EdgeDiscrim = EdgeDiscrim of int * DecisionTreeTest * range /// Choose a set of investigations that can be performed simultaneously diff --git a/src/Compiler/Checking/PatternMatchCompilation.fsi b/src/Compiler/Checking/PatternMatchCompilation.fsi index 5b2d94c8ff5..2db725a11e4 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fsi +++ b/src/Compiler/Checking/PatternMatchCompilation.fsi @@ -39,9 +39,9 @@ type Pattern = member Range: range -and PatternValBinding = PatternValBinding of Val * GeneralizedType +and [] PatternValBinding = PatternValBinding of Val * GeneralizedType -and MatchClause = MatchClause of Pattern * Expr option * DecisionTreeTarget * range +and [] MatchClause = MatchClause of Pattern * Expr option * DecisionTreeTarget * range val ilFieldToTastConst: ILFieldInit -> Const diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index c60fb146d54..b0b68cd31b3 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -71,6 +71,7 @@ type Resumable = /// for a ResumableCode delegate. | ResumableExpr of allowed: bool +[] type env = { /// The bound type parameter names in scope @@ -189,6 +190,7 @@ module Limit = (NoLimit, limits) ||> List.fold CombineTwoLimits +[] type cenv = { boundVals: Dictionary // really a hash set diff --git a/src/Compiler/Checking/QuotationTranslator.fs b/src/Compiler/Checking/QuotationTranslator.fs index fa0d317ab95..54299efd7a0 100644 --- a/src/Compiler/Checking/QuotationTranslator.fs +++ b/src/Compiler/Checking/QuotationTranslator.fs @@ -39,6 +39,7 @@ type QuotationSerializationFormat = SupportsDeserializeEx: bool } +[] type QuotationGenerationScope = { g: TcGlobals @@ -89,6 +90,7 @@ type QuotationGenerationScope = { SupportsDeserializeEx = (ValRefForIntrinsic g.deserialize_quoted_FSharp_40_plus_info).TryDeref.IsSome SupportsWitnesses = (ValRefForIntrinsic g.call_with_witnesses_info).TryDeref.IsSome } +[] type QuotationTranslationEnv = { /// Map from Val to binding index diff --git a/src/Compiler/Checking/QuotationTranslator.fsi b/src/Compiler/Checking/QuotationTranslator.fsi index 288a8e1e73d..fe6b8c2e320 100644 --- a/src/Compiler/Checking/QuotationTranslator.fsi +++ b/src/Compiler/Checking/QuotationTranslator.fsi @@ -28,7 +28,7 @@ type QuotationSerializationFormat = SupportsDeserializeEx: bool } -[] +[] type QuotationGenerationScope = static member Create: TcGlobals * ImportMap * CcuThunk * ConstraintSolver.TcValF * IsReflectedDefinition -> QuotationGenerationScope diff --git a/src/Compiler/Checking/SignatureConformance.fs b/src/Compiler/Checking/SignatureConformance.fs index f24a93c5fc0..a1b5ed115de 100644 --- a/src/Compiler/Checking/SignatureConformance.fs +++ b/src/Compiler/Checking/SignatureConformance.fs @@ -25,18 +25,25 @@ open FSharp.Compiler.TypeHierarchy open FSharp.Compiler.TypeProviders #endif +[] exception RequiredButNotSpecified of DisplayEnv * ModuleOrNamespaceRef * string * (StringBuilder -> unit) * range +[] exception ValueNotContained of DisplayEnv * InfoReader * ModuleOrNamespaceRef * Val * Val * (string * string * string -> string) +[] exception UnionCaseNotContained of DisplayEnv * InfoReader * Tycon * UnionCase * UnionCase * (string * string -> string) +[] exception FSharpExceptionNotContained of DisplayEnv * InfoReader * Tycon * Tycon * (string * string -> string) +[] exception FieldNotContained of DisplayEnv * InfoReader * Tycon * Tycon * RecdField * RecdField * (string * string -> string) +[] exception InterfaceNotRevealed of DisplayEnv * TType * range +[] exception ArgumentsInSigAndImplMismatch of sigArg: Ident * implArg: Ident // Use a type to capture the constant, common parameters diff --git a/src/Compiler/Checking/SignatureConformance.fsi b/src/Compiler/Checking/SignatureConformance.fsi index c0939f92b35..37d8a234b35 100644 --- a/src/Compiler/Checking/SignatureConformance.fsi +++ b/src/Compiler/Checking/SignatureConformance.fsi @@ -13,8 +13,10 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.InfoReader +[] exception RequiredButNotSpecified of DisplayEnv * ModuleOrNamespaceRef * string * (StringBuilder -> unit) * range +[] exception ValueNotContained of DisplayEnv * InfoReader * @@ -23,10 +25,13 @@ exception ValueNotContained of Val * (string * string * string -> string) +[] exception UnionCaseNotContained of DisplayEnv * InfoReader * Tycon * UnionCase * UnionCase * (string * string -> string) +[] exception FSharpExceptionNotContained of DisplayEnv * InfoReader * Tycon * Tycon * (string * string -> string) +[] exception FieldNotContained of DisplayEnv * InfoReader * @@ -36,8 +41,10 @@ exception FieldNotContained of RecdField * (string * string -> string) +[] exception InterfaceNotRevealed of DisplayEnv * TType * range +[] exception ArgumentsInSigAndImplMismatch of sigArg: Ident * implArg: Ident type Checker = diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index 1faa9a50a35..e7d61a0a8b0 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -59,6 +59,7 @@ type TailCall = let IsValRefIsDllImport g (vref: ValRef) = vref.Attribs |> HasFSharpAttributeOpt g g.attrib_DllImportAttribute +[] type cenv = { stackGuard: StackGuard diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 56bb6d953c8..e818eb67b11 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -167,6 +167,7 @@ type ExtensionMethodPriority = uint64 // OptionalArgCallerSideValue, OptionalArgInfo /// The caller-side value for the optional arg, if any +[] type OptionalArgCallerSideValue = | Constant of ILFieldInit | DefaultValue @@ -176,6 +177,7 @@ type OptionalArgCallerSideValue = | PassByRef of TType * OptionalArgCallerSideValue /// Represents information about a parameter indicating if it is optional. +[] type OptionalArgInfo = /// The argument is not optional | NotOptional @@ -273,6 +275,7 @@ type ParamData = reflArgInfo: ReflectedArgInfo * ttype: TType +[] type ParamAttribs = ParamAttribs of isParamArrayArg: bool * isInArg: bool * isOutArg: bool * optArgInfo: OptionalArgInfo * callerInfo: CallerInfo * reflArgInfo: ReflectedArgInfo let CrackParamAttribsInfo g (ty: TType, argInfo: ArgReprInfo) = @@ -2324,6 +2327,7 @@ let stripByrefTy g ty = /// Represents the information about the compiled form of a method signature. Used when analyzing implementation /// relations between members and abstract slots. +[] type CompiledSig = CompiledSig of argTys: TType list list * returnTy: TType option * formalMethTypars: Typars * formalMethTyparInst: TyparInstantiation /// Get the information about the compiled form of a method signature. Used when analyzing implementation diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index 7e1ee813ca8..7afa59c0a1e 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -57,6 +57,7 @@ val MakeSlotSig: type ExtensionMethodPriority = uint64 /// The caller-side value for the optional arg, if any +[] type OptionalArgCallerSideValue = | Constant of ILFieldInit | DefaultValue @@ -66,6 +67,7 @@ type OptionalArgCallerSideValue = | PassByRef of TType * OptionalArgCallerSideValue /// Represents information about a parameter indicating if it is optional. +[] type OptionalArgInfo = /// The argument is not optional | NotOptional @@ -137,6 +139,7 @@ type ParamData = ttype: TType // Adhoc information - could be unified with ParamData +[] type ParamAttribs = | ParamAttribs of isParamArrayArg: bool * @@ -1044,6 +1047,7 @@ val stripByrefTy: g: TcGlobals -> ty: TType -> TType /// Represents the information about the compiled form of a method signature. Used when analyzing implementation /// relations between members and abstract slots. +[] type CompiledSig = | CompiledSig of argTys: TType list list * diff --git a/src/Compiler/CodeGen/EraseClosures.fs b/src/Compiler/CodeGen/EraseClosures.fs index cf1499f0c30..04d7a9c68b0 100644 --- a/src/Compiler/CodeGen/EraseClosures.fs +++ b/src/Compiler/CodeGen/EraseClosures.fs @@ -114,6 +114,7 @@ let mkFuncTypeRef fsharpCoreAssemblyScopeRef n = else mkILNestedTyRef (fsharpCoreAssemblyScopeRef, [ fsharpCoreNamespace + ".OptimizedClosures" ], "FSharpFunc`" + string (n + 1)) +[] type cenv = { ilg: ILGlobals diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 540b9695201..b69e17116fd 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -214,6 +214,7 @@ let CountStaticFieldDef = NewCounter "IL field definitions corresponding to valu let CountCallFuncInstructions = NewCounter "callfunc instructions (indirect calls)" /// Non-local information related to internals of code generation within an assembly +[] type IlxGenIntraAssemblyInfo = { /// A table recording the generated name of the static backing fields for each mutable top level value where @@ -1048,21 +1049,21 @@ type ValStorage = | Local of index: int * realloc: bool * localCloInfo: (FreeTyvars * NamedLocalIlxClosureInfo ref) option /// Indicates if there is a shadow local storage for a local, to make sure it gets a good name in debugging -and OptionalShadowLocal = +and [] OptionalShadowLocal = | NoShadowLocal | ShadowLocal of startMark: Mark * storage: ValStorage /// The representation of a NamedLocalClosure is based on a cloinfo. However we can't generate a cloinfo until we've /// decided the representations of other items in the recursive set. Hence we use two phases to decide representations in /// a recursive set. Yuck. -and NamedLocalIlxClosureInfo = +and [] NamedLocalIlxClosureInfo = | NamedLocalIlxClosureInfoGenerator of (IlxGenEnv -> IlxClosureInfo) | NamedLocalIlxClosureInfoGenerated of IlxClosureInfo override _.ToString() = "" /// Indicates the overall representation decisions for all the elements of a namespace of module -and ModuleStorage = +and [] ModuleStorage = { Vals: Lazy> @@ -1075,7 +1076,7 @@ and ModuleStorage = /// a branch. At the moment these are only used for generating branch calls back to /// the entry label of the method currently being generated when a direct tailcall is /// made in the method itself. -and BranchCallItem = +and [] BranchCallItem = | BranchCallClosure of ArityInfo @@ -1102,7 +1103,7 @@ and Mark = member x.CodeLabel = (let (Mark lab) = x in lab) /// Represents "what to do next after we generate this expression" -and sequel = +and [] sequel = | EndFilter /// Exit a 'handler' block. The integer says which local to save result in @@ -1135,7 +1136,7 @@ and Pushes = ILType list and Pops = int /// The overall environment at a particular point in the declaration/expression tree. -and IlxGenEnv = +and [] IlxGenEnv = { /// The representation decisions for the (non-erased) type parameters that are in scope tyenv: TypeReprEnv @@ -11643,6 +11644,7 @@ let GetEmptyIlxGenEnv (g: TcGlobals) ccu = delayedFileGenReverse = [] } +[] type IlxGenResults = { ilTypeDefs: ILTypeDef list @@ -11753,6 +11755,7 @@ let GenerateCode (cenv, anonTypeTable, eenv, CheckedAssemblyAfterOptimization im open System /// The lookup* functions are the conversions available from ilreflect. +[] type ExecutionContext = { LookupTypeRef: ILTypeRef -> Type diff --git a/src/Compiler/CodeGen/IlxGen.fsi b/src/Compiler/CodeGen/IlxGen.fsi index 4658dd0693b..b8160c0c2e9 100644 --- a/src/Compiler/CodeGen/IlxGen.fsi +++ b/src/Compiler/CodeGen/IlxGen.fsi @@ -65,6 +65,7 @@ type internal IlxGenOptions = } /// The results of the ILX compilation of one fragment of an assembly +[] type public IlxGenResults = { /// The generated IL/ILX type definitions @@ -87,6 +88,7 @@ type public IlxGenResults = } /// Used to support the compilation-inversion operations "ClearGeneratedValue" and "LookupGeneratedValue" +[] type ExecutionContext = { LookupTypeRef: ILTypeRef -> Type LookupType: ILType -> Type } diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 32298c0cf05..693fb7c938c 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -243,7 +243,7 @@ type TimeStampCache(defaultTimeStamp: DateTime) = projects[projectReference] <- v v -and [] ProjectAssemblyDataResult = +and [] ProjectAssemblyDataResult = | Available of IRawFSharpAssemblyData | Unavailable of useOnDiskInstead: bool @@ -264,6 +264,7 @@ and IProjectReference = /// are fatal errors in the options for the project. abstract TryGetLogicalTimeStamp: cache: TimeStampCache -> DateTime option +[] type AssemblyReference = | AssemblyReference of range: range * text: string * projectReference: IProjectReference option @@ -286,11 +287,14 @@ type AssemblyReference = override x.ToString() = sprintf "AssemblyReference(%s)" x.Text +[] type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list #if !NO_TYPEPROVIDERS +[] type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +[] type ImportedAssembly = { ILScopeRef: ILScopeRef @@ -304,6 +308,7 @@ type ImportedAssembly = FSharpOptimizationData: Microsoft.FSharp.Control.Lazy } +[] type AvailableImportedAssembly = | ResolvedImportedAssembly of ImportedAssembly | UnresolvedImportedAssembly of string @@ -326,6 +331,7 @@ type TokenizeOption = | Debug | Unfiltered +[] type PackageManagerLine = { Directive: Directive @@ -1466,6 +1472,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = /// Represents a computation to return a TcConfig. Normally this is just a constant immutable TcConfig, /// but for F# Interactive it may be based on an underlying mutable TcConfigBuilder. +[] type TcConfigProvider = | TcConfigProvider of (CompilationThreadToken -> TcConfig) diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index f59950f9e28..51362a94eb9 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -72,7 +72,7 @@ type TimeStampCache = member GetProjectReferenceTimeStamp: projectReference: IProjectReference -> DateTime -and [] ProjectAssemblyDataResult = +and [] ProjectAssemblyDataResult = | Available of IRawFSharpAssemblyData @@ -98,6 +98,7 @@ and IProjectReference = /// are fatal errors in the options for the project. abstract TryGetLogicalTimeStamp: cache: TimeStampCache -> DateTime option +[] type AssemblyReference = | AssemblyReference of range: range * text: string * projectReference: IProjectReference option @@ -109,6 +110,7 @@ type AssemblyReference = member SimpleAssemblyNameIs: string -> bool +[] type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list [] @@ -162,6 +164,7 @@ type TokenizeOption = | Unfiltered +[] type PackageManagerLine = { Directive: Directive LineStatus: LStatus diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 9b4abb8a159..b98f63c3375 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1968,7 +1968,7 @@ let SanitizeFileName fileName implicitIncludeDir = with _ -> fileName -[] +[] type FormattedDiagnosticLocation = { Range: range @@ -1985,7 +1985,7 @@ type FormattedDiagnosticCanonicalInformation = TextRepresentation: string } -[] +[] type FormattedDiagnosticDetailedInfo = { Location: FormattedDiagnosticLocation option @@ -1993,7 +1993,7 @@ type FormattedDiagnosticDetailedInfo = Message: string } -[] +[] type FormattedDiagnostic = | Short of FSharpDiagnosticSeverity * string | Long of FSharpDiagnosticSeverity * FormattedDiagnosticDetailedInfo diff --git a/src/Compiler/Driver/CompilerDiagnostics.fsi b/src/Compiler/Driver/CompilerDiagnostics.fsi index 8e0890d4418..c3f0ebba1d9 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fsi +++ b/src/Compiler/Driver/CompilerDiagnostics.fsi @@ -94,7 +94,7 @@ val GetDiagnosticsLoggerFilteringByScopedPragmas: val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string /// Used internally and in LegacyHostedCompilerForTesting -[] +[] type FormattedDiagnosticLocation = { Range: range File: string @@ -109,14 +109,14 @@ type FormattedDiagnosticCanonicalInformation = TextRepresentation: string } /// Used internally and in LegacyHostedCompilerForTesting -[] +[] type FormattedDiagnosticDetailedInfo = { Location: FormattedDiagnosticLocation option Canonical: FormattedDiagnosticCanonicalInformation Message: string } /// Used internally and in LegacyHostedCompilerForTesting -[] +[] type FormattedDiagnostic = | Short of FSharpDiagnosticSeverity * string | Long of FSharpDiagnosticSeverity * FormattedDiagnosticDetailedInfo diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index e828863c3a8..663cc0d82e5 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -258,12 +258,14 @@ type ResolveAssemblyReferenceMode = | ReportErrors #if !NO_TYPEPROVIDERS +[] type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif #if DEBUG [] #endif +[] type AssemblyResolution = { /// The original reference to the assembly. @@ -314,6 +316,7 @@ type AssemblyResolution = this.ilAssemblyRef <- Some assemblyRef assemblyRef +[] type ImportedBinary = { FileName: string @@ -327,6 +330,7 @@ type ImportedBinary = ILScopeRef: ILScopeRef } +[] type ImportedAssembly = { ILScopeRef: ILScopeRef @@ -340,6 +344,7 @@ type ImportedAssembly = FSharpOptimizationData: InterruptibleLazy } +[] type AvailableImportedAssembly = | ResolvedImportedAssembly of ImportedAssembly * range | UnresolvedImportedAssembly of string * range diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index ac06a25c2dc..4c4084d444f 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -69,6 +69,7 @@ type ResolveAssemblyReferenceMode = | Speculative | ReportErrors +[] type AssemblyResolution = { /// The original reference to the assembly. @@ -88,12 +89,13 @@ type AssemblyResolution = } #if !NO_TYPEPROVIDERS +[] type ResolvedExtensionReference = | ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif /// Represents a resolved imported binary -[] +[] type ImportedBinary = { FileName: string RawMetadata: IRawFSharpAssemblyData @@ -106,7 +108,7 @@ type ImportedBinary = ILScopeRef: ILScopeRef } /// Represents a resolved imported assembly -[] +[] type ImportedAssembly = { ILScopeRef: ILScopeRef FSharpViewOfMetadata: CcuThunk diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 221d02bcbb2..a5396df6aef 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -49,6 +49,7 @@ type OptionSwitch = | On | Off +[] type OptionSpec = | OptionClear of bool ref | OptionFloat of (float -> unit) @@ -65,7 +66,7 @@ type OptionSpec = | OptionConsoleOnly of (CompilerOptionBlock list -> unit) | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs) -and CompilerOption = +and [] CompilerOption = | CompilerOption of name: string * argumentDescriptionString: string * @@ -73,7 +74,7 @@ and CompilerOption = deprecationError: exn option * helpText: string option -and CompilerOptionBlock = +and [] CompilerOptionBlock = | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index bb2034b93d5..f34ca679155 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -15,6 +15,7 @@ type OptionSwitch = /// The spec value describes the action of the argument, /// and whether it expects a following parameter. +[] type OptionSpec = | OptionClear of bool ref | OptionFloat of (float -> unit) @@ -31,7 +32,7 @@ type OptionSpec = | OptionConsoleOnly of (CompilerOptionBlock list -> unit) | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs) -and CompilerOption = +and [] CompilerOption = | CompilerOption of name: string * argumentDescriptionString: string * @@ -39,7 +40,7 @@ and CompilerOption = deprecationError: exn option * helpText: string option -and CompilerOptionBlock = +and [] CompilerOptionBlock = | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list diff --git a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs index 47993e00862..826e80ce892 100644 --- a/src/Compiler/Driver/GraphChecking/GraphProcessing.fs +++ b/src/Compiler/Driver/GraphChecking/GraphProcessing.fs @@ -17,6 +17,7 @@ type IncrementableInt(value: int) = // Increment the value in a thread-safe manner and return the new value. member this.Increment() = Interlocked.Increment(&value) +[] type GraphNode<'Item, 'Result> = { Info: NodeInfo<'Item> diff --git a/src/Compiler/Driver/GraphChecking/Types.fs b/src/Compiler/Driver/GraphChecking/Types.fs index 00538b6e599..c71eae4833b 100644 --- a/src/Compiler/Driver/GraphChecking/Types.fs +++ b/src/Compiler/Driver/GraphChecking/Types.fs @@ -18,6 +18,7 @@ type internal Identifier = string type internal LongIdentifier = string list /// Combines the file name, index and parsed syntax tree of a file in a project. +[] type internal FileInProject = { Idx: FileIndex @@ -29,6 +30,7 @@ type internal FileInProject = /// A namespace does not necessarily expose a set of dependent files. /// Only when the namespace exposes types that could later be inferred. /// Children of a namespace don't automatically depend on each other for that reason +[] type internal TrieNodeInfo = | Root of files: ImmutableHashSet | Module of name: Identifier * file: FileIndex @@ -43,6 +45,7 @@ type internal TrieNodeInfo = | Module(file = file) -> Set.singleton file | Namespace(filesThatExposeTypes = files) -> set files +[] type internal TrieNode = { Current: TrieNodeInfo @@ -172,4 +175,5 @@ type internal FilePairMap(files: FileInProject array) = member x.IsSignature(index: FileIndex) = Map.containsKey index sigToImpl /// Callback that returns a previously calculated 'Result and updates 'State accordingly. +[] type internal Finisher<'Node, 'State, 'Result> = Finisher of node: 'Node * finisher: ('State -> 'Result * 'State) diff --git a/src/Compiler/Driver/GraphChecking/Types.fsi b/src/Compiler/Driver/GraphChecking/Types.fsi index 468ef65889c..cf2bb1b5eb9 100644 --- a/src/Compiler/Driver/GraphChecking/Types.fsi +++ b/src/Compiler/Driver/GraphChecking/Types.fsi @@ -18,6 +18,7 @@ type internal Identifier = string type internal LongIdentifier = Identifier list /// Combines the file name, index and parsed syntax tree of a file in a project. +[] type internal FileInProject = { Idx: FileIndex FileName: FileName @@ -27,6 +28,7 @@ type internal FileInProject = /// A namespace does not necessarily expose a set of dependent files. /// Only when the namespace exposes types that could later be inferred. /// Children of a namespace don't automatically depend on each other for that reason +[] type internal TrieNodeInfo = | Root of files: ImmutableHashSet | Module of name: Identifier * file: FileIndex @@ -40,6 +42,7 @@ type internal TrieNodeInfo = member Files: Set /// A node in the Trie structure. +[] type internal TrieNode = { /// Information about this node. @@ -113,4 +116,5 @@ type internal FilePairMap = member IsSignature: index: FileIndex -> bool /// Callback that returns a previously calculated 'Result and updates 'State accordingly. +[] type internal Finisher<'Node, 'State, 'Result> = Finisher of node: 'Node * finisher: ('State -> 'Result * 'State) diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index 85cde3b6c0e..d8a02835113 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -51,6 +51,7 @@ let GetInitialOptimizationEnv (tcImports: TcImports, tcGlobals: TcGlobals) = optEnv /// Result of the 'FirstLoop' phase +[] type FirstLoopRes = { OptEnv: Optimizer.IncrementalOptimizationEnv @@ -60,6 +61,7 @@ type FirstLoopRes = } /// All the state optimization phases can produce (except 'CheckedImplFile') and most of what they require as input. +[] type PhaseContext = { FirstLoopRes: FirstLoopRes @@ -74,6 +76,7 @@ type PhaseRes = CheckedImplFile * PhaseContext type PhaseIdx = int /// All inputs required to evaluate each Optimization Phase. +[] type PhaseInputs = { File: CheckedImplFile @@ -96,6 +99,7 @@ type Phase = override this.ToString() = $"{this.Idx}-{this.Name}" +[] type PhaseInfo = { Phase: Phase; Func: PhaseFunc } [] diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index a9fc59b66d3..acd731650da 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -1076,6 +1076,7 @@ type RootImpls = Zset let qnameOrder = Order.orderBy (fun (q: QualifiedNameOfFile) -> q.Text) +[] type TcState = { /// The assembly thunk for the assembly being compiled. diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index 745afa51be4..abc917168e6 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -112,7 +112,7 @@ val ParseInputFiles: val GetInitialTcEnv: assemblyName: string * range * TcConfig * TcImports * TcGlobals -> TcEnv * OpenDeclaration list /// Represents the incremental type checking state for a set of inputs -[] +[] type TcState = /// The CcuThunk for the current assembly being checked member Ccu: CcuThunk diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 2374fd6793b..db403d46b42 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -24,7 +24,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.Text.Range -[] +[] type LoadClosureInput = { FileName: string @@ -33,7 +33,7 @@ type LoadClosureInput = MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list } -[] +[] type LoadClosure = { /// The source files along with the ranges of the #load positions in each file. @@ -82,9 +82,11 @@ type CodeContext = module ScriptPreprocessClosure = /// Represents an input to the closure finding process + [] type ClosureSource = ClosureSource of fileName: string * referenceRange: range * sourceText: ISourceText * parseRequired: bool /// Represents an output of the closure finding process + [] type ClosureFile = | ClosureFile of fileName: string * diff --git a/src/Compiler/Driver/ScriptClosure.fsi b/src/Compiler/Driver/ScriptClosure.fsi index c5deec56b64..c4da204defb 100644 --- a/src/Compiler/Driver/ScriptClosure.fsi +++ b/src/Compiler/Driver/ScriptClosure.fsi @@ -20,7 +20,7 @@ type CodeContext = | Compilation | Editing -[] +[] type LoadClosureInput = { FileName: string @@ -30,7 +30,7 @@ type LoadClosureInput = MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list } -[] +[] type LoadClosure = { /// The source files along with the ranges of the #load positions in each file. diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 687bc269233..5d7a9f5a465 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -15,6 +15,8 @@ $(DefineConstants);COMPILER $(DefineConstants);FSHARPCORE_USE_PACKAGE $(OtherFlags) --extraoptimizationloops:1 + + $(OtherFlags) --warnon:1178 $(OtherFlags) --warnon:1182 diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index 24f6ebf2e6d..7fcacd2a1da 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -119,6 +119,7 @@ exception UnresolvedPathReferenceNoRange of assemblyName: string * path: string exception UnresolvedPathReference of assemblyName: string * path: string * range: range +[] exception DiagnosticWithSuggestions of number: int * message: string * range: range * identifier: string * suggestions: Suggestions with // int is e.g. 191 in FS0191 override this.Message = match this :> exn with @@ -255,7 +256,7 @@ module BuildPhaseSubcategory = [] let Internal = "internal" // Compiler ICE -[] +[] type PhasedDiagnostic = { Exception: exn diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fsi b/src/Compiler/Facilities/DiagnosticsLogger.fsi index e9040da36ed..0f4fded3468 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fsi +++ b/src/Compiler/Facilities/DiagnosticsLogger.fsi @@ -76,6 +76,7 @@ exception UnresolvedPathReferenceNoRange of assemblyName: string * path: string exception UnresolvedPathReference of assemblyName: string * path: string * range: range +[] exception DiagnosticWithSuggestions of number: int * message: string * @@ -165,6 +166,7 @@ module BuildPhaseSubcategory = [] val Internal: string = "internal" +[] type PhasedDiagnostic = { Exception: exn Phase: BuildPhase } diff --git a/src/Compiler/Facilities/ReferenceResolver.fs b/src/Compiler/Facilities/ReferenceResolver.fs index 7e825741942..5a50b00deea 100644 --- a/src/Compiler/Facilities/ReferenceResolver.fs +++ b/src/Compiler/Facilities/ReferenceResolver.fs @@ -12,6 +12,7 @@ type LegacyResolutionEnvironment = /// Indicates a script or source being dynamically compiled and executed. Uses implementation assemblies. | CompilationAndEvaluation +[] type LegacyResolvedFile = { /// Item specification. diff --git a/src/Compiler/Facilities/ReferenceResolver.fsi b/src/Compiler/Facilities/ReferenceResolver.fsi index 8371775f956..99fda031ded 100644 --- a/src/Compiler/Facilities/ReferenceResolver.fsi +++ b/src/Compiler/Facilities/ReferenceResolver.fsi @@ -14,6 +14,7 @@ type LegacyResolutionEnvironment = /// Indicates a script or source being dynamically compiled and executed. Uses implementation assemblies. | CompilationAndEvaluation +[] type LegacyResolvedFile = { /// Item specification. diff --git a/src/Compiler/Facilities/prim-parsing.fs b/src/Compiler/Facilities/prim-parsing.fs index 3088a5579ed..f00f5277e04 100644 --- a/src/Compiler/Facilities/prim-parsing.fs +++ b/src/Compiler/Facilities/prim-parsing.fs @@ -66,7 +66,7 @@ type internal ParseErrorContext<'Token> //------------------------------------------------------------------------- // This is the data structure emitted as code by FSYACC. - +[] type internal Tables<'Token> = { reductions: (IParseState -> obj)[] diff --git a/src/Compiler/Facilities/prim-parsing.fsi b/src/Compiler/Facilities/prim-parsing.fsi index 4177d66e9a9..ed5f51faf11 100644 --- a/src/Compiler/Facilities/prim-parsing.fsi +++ b/src/Compiler/Facilities/prim-parsing.fsi @@ -63,6 +63,7 @@ type internal ParseErrorContext<'Token> = /// Tables generated by fsyacc /// The type of the tables contained in a file produced by the fsyacc.exe parser generator. +[] type internal Tables<'Token> = { /// The reduction table. diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 4cec0c7a8d2..f7334953fd7 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -481,6 +481,7 @@ type ILMultiInMemoryAssemblyEmitEnv member _.IsLocalInternalField(fref: ILFieldRef) = fref.DeclaringTypeRef.Scope.IsLocalRef && internalFields.Contains(fref) +[] type ILAssemblyEmitEnv = | SingleRefEmitAssembly of ILDynamicAssemblyWriter.cenv * ILDynamicAssemblyEmitEnv | MultipleInMemoryAssemblies of ILMultiInMemoryAssemblyEmitEnv @@ -1482,7 +1483,7 @@ type internal FsiConsoleInput //---------------------------------------------------------------------------- // FsiDynamicCompilerState //---------------------------------------------------------------------------- - +[] type FsiInteractionStepStatus = | CtrlC | EndOfFile @@ -3613,7 +3614,7 @@ type FsiStdinLexerProvider member _.CreateBufferLexer(sourceFileName, lexbuf, diagnosticsLogger) = CreateLexerForLexBuffer(sourceFileName, lexbuf, diagnosticsLogger) -[] +[] type InteractionGroup = | Definitions of defns: SynModuleDecl list * range: range diff --git a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs index 688b53643c3..ca8e7d02c79 100644 --- a/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs +++ b/src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs @@ -84,7 +84,7 @@ type internal CompilationResult = | Success of CompilationIssue list | Failure of FailureDetails -[] +[] type internal CompilationOutput = { Errors: FormattedDiagnostic[] diff --git a/src/Compiler/Optimize/DetupleArgs.fs b/src/Compiler/Optimize/DetupleArgs.fs index 0021357366c..874326127af 100644 --- a/src/Compiler/Optimize/DetupleArgs.fs +++ b/src/Compiler/Optimize/DetupleArgs.fs @@ -172,6 +172,7 @@ module GlobalUsageAnalysis = let z = FoldExpr folder z0 expr z + [] type accessor = TupleGet of int * TType list /// Expr information. @@ -473,7 +474,7 @@ let sitesCPs sites = List.map siteCP sites //------------------------------------------------------------------------- // transform //------------------------------------------------------------------------- - +[] type TransformedFormal = // Indicates that // - the actual arg in this position is unchanged @@ -488,6 +489,7 @@ type TransformedFormal = /// Info needed to convert f to curried form. /// - yb1..ybp - replacement formal choices for x1...xp. /// - transformedVal - replaces f. +[] type Transform = { transformCallPattern: CallPattern transformedFormals: TransformedFormal list @@ -714,6 +716,7 @@ let determineTransforms g (z: GlobalUsageAnalysis.Results) = // pass - penv - env of pass //------------------------------------------------------------------------- +[] type penv = { // The planned transforms transforms: Zmap @@ -731,7 +734,7 @@ let hasTransfrom penv f = Zmap.tryFind f penv.transforms - need to factor any side-effecting args out into a let binding sequence. - also factor buildProjections, so they share common tmps. *) - +[] type env = { eg: TcGlobals diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index 37b3f26c429..b065a8a5fb6 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -313,6 +313,7 @@ let fclassOrder = Order.orderOn (fun (b: BindingGroupSharingSameReqdItems) -> b. /// For gv a generator, /// An arity-met gv occurrence contributes the env required for that gv call. /// Other occurrences contribute the value gv. +[] type ReqdItem = | ReqdSubEnv of Val | ReqdVal of Val @@ -332,6 +333,7 @@ let reqdItemOrder = /// An env says what is needed to close the corresponding defn(s). /// The reqdTypars are the free reqdTypars of the defns, and those required by any direct TLR arity-met calls. /// The reqdItems are the ids/subEnvs required from calls to freeVars. +[] type ReqdItemsForDefn = { reqdTypars: Zset @@ -416,6 +418,7 @@ module Pass2_DetermineReqdItems = /// If occurrences in body are relevant (for a generator) then it's contribution is logged. /// /// recShortCalls to f will require a binding for f in terms of fHat within the fHatBody. + [] type state = { stack: (BindingGroupSharingSameReqdItems * Generators * ReqdItemsForDefn) list @@ -652,7 +655,7 @@ module Pass2_DetermineReqdItems = /// all these ids (Typar/Val) will need to be freshened up. /// It is OK to break the uniqueness-of-bound-ids rule during the rw, /// provided it is fixed up via a copyExpr call on the final expr. - +[] type PackedReqdItems = { /// The actual typars @@ -884,6 +887,7 @@ module Pass4_RewriteAssembly = /// [and should not be, since they may lift over unmoved defns on which they depend]. /// Any TLR repr bindings under lambdas can be filtered out (and collected), /// giving pre-declarations to insert before the outermost lambda expr. + [] type RewriteState = { rws_mustinline: bool /// counts level of enclosing "lambdas" diff --git a/src/Compiler/Optimize/LowerLocalMutables.fs b/src/Compiler/Optimize/LowerLocalMutables.fs index 0899875242d..29ee700f423 100644 --- a/src/Compiler/Optimize/LowerLocalMutables.fs +++ b/src/Compiler/Optimize/LowerLocalMutables.fs @@ -17,6 +17,7 @@ open FSharp.Compiler.TypeRelations let AutoboxRewriteStackGuardDepth = StackGuard.GetDepthOption "AutoboxRewrite" +[] type cenv = { g: TcGlobals amap: Import.ImportMap } diff --git a/src/Compiler/Optimize/LowerSequences.fs b/src/Compiler/Optimize/LowerSequences.fs index 3a7d733ec59..de938238084 100644 --- a/src/Compiler/Optimize/LowerSequences.fs +++ b/src/Compiler/Optimize/LowerSequences.fs @@ -35,7 +35,7 @@ let callNonOverloadedILMethod g amap m methName ty args = //---------------------------------------------------------------------------- // State machine compilation for sequence expressions - +[] type LoweredSeqFirstPhaseResult = { /// The second phase of the transformation. This rebuilds the 'generate', 'dispose' and 'checkDispose' expressions for the diff --git a/src/Compiler/Optimize/LowerStateMachines.fs b/src/Compiler/Optimize/LowerStateMachines.fs index 7c4835b3460..ed834757e0a 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fs +++ b/src/Compiler/Optimize/LowerStateMachines.fs @@ -16,6 +16,7 @@ open FSharp.Compiler.TypedTreeOps let LowerStateMachineStackGuardDepth = StackGuard.GetDepthOption "LowerStateMachines" +[] type StateMachineConversionFirstPhaseResult = { /// Represents the expanded expression prior to decisions about labels @@ -117,6 +118,7 @@ let isStateMachineBindingVar g (v: Val) = (nm.StartsWith "builder@" || v.IsMemberThisVal) && not v.IsCompiledAsTopLevel) +[] type env = { ResumableCodeDefns: ValMap @@ -148,6 +150,7 @@ let rec IsStateMachineExpr g overallExpr = | StructStateMachineExpr g _ -> Some None | _ -> None +[] type LoweredStateMachine = LoweredStateMachine of templateStructTy: TType * @@ -158,6 +161,7 @@ type LoweredStateMachine = setStateMachine: (Val * Val * Expr) * afterCode: (Val * Expr) +[] type LoweredStateMachineResult = /// A state machine was recognised and was compilable | Lowered of LoweredStateMachine diff --git a/src/Compiler/Optimize/LowerStateMachines.fsi b/src/Compiler/Optimize/LowerStateMachines.fsi index 4ee177174e2..ad33edb6b97 100644 --- a/src/Compiler/Optimize/LowerStateMachines.fsi +++ b/src/Compiler/Optimize/LowerStateMachines.fsi @@ -5,6 +5,7 @@ module internal FSharp.Compiler.LowerStateMachines open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals +[] type LoweredStateMachine = | LoweredStateMachine of templateStructTy: TType * @@ -15,6 +16,7 @@ type LoweredStateMachine = setStateMachine: (Val * Val * Expr) * afterCode: (Val * Expr) +[] type LoweredStateMachineResult = /// A state machine was recognised and was compilable | Lowered of LoweredStateMachine diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index a1e01d4a58d..e87ecac5933 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -63,6 +63,7 @@ type TypeValueInfo = /// /// We store one of these for each value in the environment, including values /// which we know little or nothing about. +[] type ExprValueInfo = | UnknownValue @@ -99,6 +100,7 @@ type ExprValueInfo = /// ConstExprValue(size, value) | ConstExprValue of size: int * value: Expr +[] type ValInfo = { ValMakesNoCriticalTailcalls: bool @@ -168,6 +170,7 @@ type ValInfos(entries) = member x.TryFindForFslib (g, vref: ValRef) = valInfosForFslib.Force(g).TryGetValue((vref, vref.Deref.GetLinkageFullKey())) +[] type ModuleInfo = { ValInfos: ValInfos ModuleOrNamespaceInfos: NameMap } @@ -410,6 +413,7 @@ type OptimizationSettings = /// Determines how to process optimization of multiple files and individual optimization phases member x.ProcessingMode() = x.processingMode +[] type cenv = { g: TcGlobals @@ -442,6 +446,7 @@ type MethodEnv = override x.ToString() = "" +[] type IncrementalOptimizationEnv = { /// An identifier to help with name generation latestBoundId: Ident option diff --git a/src/Compiler/Service/ExternalSymbol.fs b/src/Compiler/Service/ExternalSymbol.fs index 0be071f4fec..3a1bde9b8c3 100644 --- a/src/Compiler/Service/ExternalSymbol.fs +++ b/src/Compiler/Service/ExternalSymbol.fs @@ -98,7 +98,7 @@ module FindDeclExternalParam = let tryOfILTypes typeVarNames ilTypes = ilTypes |> List.map (tryOfILType typeVarNames) |> Option.ofOptionList -[] +[] [] type FindDeclExternalSymbol = | Type of fullName: string @@ -146,7 +146,7 @@ type FindDeclFailureReason = // trying to find declaration of ProvidedMember without TypeProviderDefinitionLocationAttribute | ProvidedMember of memberName: string -[] +[] type FindDeclResult = /// declaration not found + reason diff --git a/src/Compiler/Service/ExternalSymbol.fsi b/src/Compiler/Service/ExternalSymbol.fsi index ee63d291084..d940b2b240e 100644 --- a/src/Compiler/Service/ExternalSymbol.fsi +++ b/src/Compiler/Service/ExternalSymbol.fsi @@ -44,7 +44,7 @@ module internal FindDeclExternalParam = val internal tryOfILTypes: string array -> ILType list -> FindDeclExternalParam list option /// Represents a symbol in an external (non F#) assembly -[] +[] type public FindDeclExternalSymbol = | Type of fullName: string @@ -79,7 +79,7 @@ type public FindDeclFailureReason = | ProvidedMember of memberName: string /// Represents the result of the GetDeclarationLocation operation. -[] +[] type public FindDeclResult = /// Indicates a declaration location was not found, with an additional reason diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 2b23d85a7ce..68c7eb9a485 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -54,6 +54,7 @@ open Internal.Utilities open Internal.Utilities.Collections open FSharp.Compiler.AbstractIL.ILBinaryReader +[] type FSharpUnresolvedReferencesSet = FSharpUnresolvedReferencesSet of UnresolvedAssemblyReference list [] @@ -139,7 +140,7 @@ type FSharpReferencedProject = override this.GetHashCode() = this.OutputFile.GetHashCode() // NOTE: may be better just to move to optional arguments here -and FSharpProjectOptions = +and [] FSharpProjectOptions = { ProjectFileName: string ProjectId: string option @@ -311,7 +312,7 @@ type ResolveOverloads = | Yes | No -[] +[] type ExprTypingsResult = | NoneBecauseTypecheckIsStaleAndTextChanged | NoneBecauseThereWereTypeErrors @@ -3674,7 +3675,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, tcConfig: TcConfig, tcGlobal } /// The result of calling TypeCheckResult including the possibility of abort and background compiler not caught up. -[] +[] type public FSharpCheckFileAnswer = /// Aborted because cancellation caused an abandonment of the operation | Aborted diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 8cdb304c18a..14166f2a3d4 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -39,9 +39,11 @@ type DelayedILModuleReader = member internal TryGetILModuleReader: unit -> Cancellable /// Unused in this API +[] type public FSharpUnresolvedReferencesSet = internal FSharpUnresolvedReferencesSet of UnresolvedAssemblyReference list /// A set of information describing a project or script build configuration. +[] type public FSharpProjectOptions = { // Note that this may not reduce to just the project directory, because there may be two projects in the same directory. @@ -486,7 +488,7 @@ type public FSharpCheckFileResults = Cancellable /// The result of calling TypeCheckResult including the possibility of abort and background compiler not caught up. -and [] public FSharpCheckFileAnswer = +and [] public FSharpCheckFileAnswer = /// Aborted because cancellation caused an abandonment of the operation | Aborted diff --git a/src/Compiler/Service/FSharpParseFileResults.fs b/src/Compiler/Service/FSharpParseFileResults.fs index 46a5753ba3f..5cc3841186d 100644 --- a/src/Compiler/Service/FSharpParseFileResults.fs +++ b/src/Compiler/Service/FSharpParseFileResults.fs @@ -40,13 +40,13 @@ type InheritanceContext = | Interface | Unknown -[] +[] type RecordContext = | CopyOnUpdate of range: range * path: CompletionPath | Constructor of typeName: string | New of path: CompletionPath -[] +[] type CompletionContext = /// Completion context cannot be determined due to errors | Invalid @@ -447,7 +447,7 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, member _.IsPositionContainedInACurriedParameter pos = let visitor = { new SyntaxVisitorBase<_>() with - member _.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = defaultTraverse (expr) + member _.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = defaultTraverse expr override _.VisitBinding(_path, _, binding) = match binding with diff --git a/src/Compiler/Service/FSharpSource.fs b/src/Compiler/Service/FSharpSource.fs index fdcf70c28b9..9f935b42f3d 100644 --- a/src/Compiler/Service/FSharpSource.fs +++ b/src/Compiler/Service/FSharpSource.fs @@ -8,7 +8,7 @@ open Internal.Utilities.Library open FSharp.Compiler.IO open FSharp.Compiler.Text -[] +[] type TextContainer = | OnDisk | Stream of Stream diff --git a/src/Compiler/Service/FSharpSource.fsi b/src/Compiler/Service/FSharpSource.fsi index ca272a51fef..6538b41a726 100644 --- a/src/Compiler/Service/FSharpSource.fsi +++ b/src/Compiler/Service/FSharpSource.fsi @@ -6,7 +6,7 @@ open System open System.IO open FSharp.Compiler.Text -[] +[] type internal TextContainer = | OnDisk | Stream of Stream diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index f6289a283ac..2bb8ec94a64 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -93,6 +93,7 @@ module IncrementalBuilderEventTesting = module Tc = CheckExpressions +[] type internal FSharpFile = { Range: range Source: FSharpSource @@ -909,6 +910,7 @@ type IncrementalBuilderInitialState = // Stamp represent the real stamp of the file. // Notified indicates that there is pending file change. // LogicalStamp represent the stamp of the file that is used to calculate the project's logical timestamp. +[] type Slot = { HasSignature: bool diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index 3697d781373..68d75850df6 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -58,8 +58,7 @@ type SemanticClassificationType = | TypeDef = 35 | Plaintext = 36 -[] -[] +[] type SemanticClassificationItem = val Range: range val Type: SemanticClassificationType diff --git a/src/Compiler/Service/SemanticClassification.fsi b/src/Compiler/Service/SemanticClassification.fsi index ce5d6d88aeb..b34c173e684 100644 --- a/src/Compiler/Service/SemanticClassification.fsi +++ b/src/Compiler/Service/SemanticClassification.fsi @@ -49,8 +49,7 @@ type SemanticClassificationType = | TypeDef = 35 | Plaintext = 36 -[] -[] +[] type SemanticClassificationItem = val Range: range val Type: SemanticClassificationType diff --git a/src/Compiler/Service/ServiceAnalysis.fs b/src/Compiler/Service/ServiceAnalysis.fs index ce45dfeac32..1ddad5c474b 100644 --- a/src/Compiler/Service/ServiceAnalysis.fs +++ b/src/Compiler/Service/ServiceAnalysis.fs @@ -59,6 +59,7 @@ module UnusedOpens = member _.IsNestedAutoOpen = isNestedAutoOpen member _.RevealedSymbolsContains(symbol) = revealedSymbols.Force().Contains symbol + [] type OpenedModuleGroup = { OpenedModules: OpenedModule[] @@ -78,6 +79,7 @@ module UnusedOpens = } /// Represents a single open statement + [] type OpenStatement = { /// All namespaces, modules and types which this open declaration effectively opens, including the AutoOpen ones @@ -305,6 +307,7 @@ module UnusedOpens = } module SimplifyNames = + [] type SimplifiableRange = { Range: range; RelativeName: string } let getPlidLength (plid: string list) = diff --git a/src/Compiler/Service/ServiceAnalysis.fsi b/src/Compiler/Service/ServiceAnalysis.fsi index 836bfce0c56..07066ada511 100644 --- a/src/Compiler/Service/ServiceAnalysis.fsi +++ b/src/Compiler/Service/ServiceAnalysis.fsi @@ -15,6 +15,7 @@ module public UnusedOpens = module public SimplifyNames = /// Data for use in finding unnecessarily-qualified names and generating diagnostics to simplify them + [] type SimplifiableRange = { /// The range of a name that can be simplified diff --git a/src/Compiler/Service/ServiceAssemblyContent.fs b/src/Compiler/Service/ServiceAssemblyContent.fs index 2b54ed7f229..1c9eef68f1b 100644 --- a/src/Compiler/Service/ServiceAssemblyContent.fs +++ b/src/Compiler/Service/ServiceAssemblyContent.fs @@ -38,6 +38,7 @@ type AssemblySymbol = type AssemblyPath = string type AssemblyContentType = Public | Full +[] type Parent = { Namespace: ShortIdents option ThisRequiresQualifiedAccess: (* isForMemberOrValue *) bool -> ShortIdents option @@ -96,6 +97,7 @@ type Parent = |> removeGenericParamsCount |> removeModuleSuffix)) +[] type AssemblyContentCacheEntry = { FileWriteTime: DateTime ContentType: AssemblyContentType diff --git a/src/Compiler/Service/ServiceAssemblyContent.fsi b/src/Compiler/Service/ServiceAssemblyContent.fsi index 09756eee2e5..fe1616acda0 100644 --- a/src/Compiler/Service/ServiceAssemblyContent.fsi +++ b/src/Compiler/Service/ServiceAssemblyContent.fsi @@ -56,6 +56,7 @@ type public AssemblySymbol = } /// `RawEntity` list retrieved from an assembly. +[] type internal AssemblyContentCacheEntry = { /// Assembly file last write time. diff --git a/src/Compiler/Service/ServiceDeclarationLists.fs b/src/Compiler/Service/ServiceDeclarationLists.fs index 1b955ead042..f16eff73aa8 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fs +++ b/src/Compiler/Service/ServiceDeclarationLists.fs @@ -32,7 +32,7 @@ open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps /// A single data tip display element -[] +[] type ToolTipElementData = { Symbol: FSharpSymbol option @@ -46,7 +46,7 @@ type ToolTipElementData = { MainDescription=layout; XmlDoc=xml; TypeMapping=defaultArg typeMapping []; ParamName=paramName; Remarks=remarks; Symbol = symbol } /// A single data tip display element -[] +[] type ToolTipElement = | None @@ -60,6 +60,7 @@ type ToolTipElement = Group [ ToolTipElementData.Create(layout, xml, ?typeMapping=typeMapping, ?paramName=paramName, ?remarks=remarks, ?symbol = symbol) ] /// Information for building a data tip box. +[] type ToolTipText = /// A list of data tip elements to display. | ToolTipText of ToolTipElement list @@ -80,6 +81,7 @@ type UnresolvedSymbol = DisplayName: string Namespace: string[] } +[] type CompletionItem = { ItemWithInst: ItemWithInst Kind: CompletionItemKind diff --git a/src/Compiler/Service/ServiceDeclarationLists.fsi b/src/Compiler/Service/ServiceDeclarationLists.fsi index 4611ff86a16..305984cb093 100644 --- a/src/Compiler/Service/ServiceDeclarationLists.fsi +++ b/src/Compiler/Service/ServiceDeclarationLists.fsi @@ -14,7 +14,7 @@ open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.AccessibilityLogic /// A single data tip display element -[] +[] type public ToolTipElementData = { Symbol: FSharpSymbol option @@ -38,7 +38,7 @@ type public ToolTipElementData = /// A single tool tip display element // // Note: instances of this type do not hold any references to any compiler resources. -[] +[] type public ToolTipElement = | None @@ -53,6 +53,7 @@ type public ToolTipElement = /// Information for building a tool tip box. // // Note: instances of this type do not hold any references to any compiler resources. +[] type public ToolTipText = /// A list of data tip elements to display. @@ -78,6 +79,7 @@ type public UnresolvedSymbol = Namespace: string[] } +[] type internal CompletionItem = { ItemWithInst: ItemWithInst diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 7f912e07e09..963d392b040 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -714,6 +714,7 @@ type NavigableContainer = | Container(nameParts = []) -> "" | Container(nameParts = ns) -> ns |> List.last +[] type NavigableItem = { Name: string diff --git a/src/Compiler/Service/ServiceNavigation.fsi b/src/Compiler/Service/ServiceNavigation.fsi index 360855cce39..8fa10cb60ae 100755 --- a/src/Compiler/Service/ServiceNavigation.fsi +++ b/src/Compiler/Service/ServiceNavigation.fsi @@ -110,6 +110,7 @@ type NavigableContainer = /// The name of the container or file member Name: string +[] type NavigableItem = { Name: string NeedsBackticks: bool diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fs b/src/Compiler/Service/ServiceParamInfoLocations.fs index 129a40b93f6..82851933501 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fs +++ b/src/Compiler/Service/ServiceParamInfoLocations.fs @@ -8,6 +8,7 @@ open FSharp.Compiler.Text.Range open FSharp.Compiler.Syntax open FSharp.Compiler.SyntaxTreeOps +[] type TupledArgumentLocation = { IsNamedArgument: bool @@ -79,6 +80,7 @@ module internal ParameterLocationsImpl = | SynExpr.Paren(expr = expr) -> digOutIdentFromFuncExpr expr | _ -> None + [] type FindResult = | Found of openParen: pos * diff --git a/src/Compiler/Service/ServiceParamInfoLocations.fsi b/src/Compiler/Service/ServiceParamInfoLocations.fsi index 272ab91d698..abddb29e777 100755 --- a/src/Compiler/Service/ServiceParamInfoLocations.fsi +++ b/src/Compiler/Service/ServiceParamInfoLocations.fsi @@ -11,6 +11,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text /// Represents the location of a tupled argument, which can optionally be a named argument. +[] type TupledArgumentLocation = { IsNamedArgument: bool ArgumentRange: range } diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 317f4bf84da..244179e85bf 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -14,7 +14,7 @@ open FSharp.Compiler.Text.Position open FSharp.Compiler.Text.Range /// used to track route during traversal AST -[] +[] type SyntaxNode = | SynPat of SynPat | SynType of SynType diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fsi b/src/Compiler/Service/ServiceParseTreeWalk.fsi index ef118baf12e..5f4ba16703e 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fsi +++ b/src/Compiler/Service/ServiceParseTreeWalk.fsi @@ -6,7 +6,7 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text /// Used to track route during traversal of syntax using SyntaxTraversal.Traverse -[] +[] type SyntaxNode = | SynPat of SynPat | SynType of SynType diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index cfbe30deb8f..1acb031bf2b 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -42,7 +42,7 @@ type InheritanceContext = | Interface | Unknown -[] +[] type RecordContext = | CopyOnUpdate of range: range * path: CompletionPath | Constructor of typeName: string @@ -50,7 +50,7 @@ type RecordContext = | New of path: CompletionPath * isFirstField: bool | Declaration of isInIdentifier: bool -[] +[] type PatternContext = /// Completing union case field pattern (e.g. fun (Some v| ) -> ) or fun (Some (v| )) -> ). In theory, this could also be parameterized active pattern usage. /// Position in the tuple. None if there is no tuple, with only one field outside of parentheses - `Some v|` @@ -70,7 +70,7 @@ type PatternContext = /// Any other position in a pattern that does not need special handling | Other -[] +[] type CompletionContext = /// Completion context cannot be determined due to errors | Invalid @@ -150,8 +150,10 @@ type ScopeKind = override x.ToString() = sprintf "%A" x +[] type InsertionContext = { ScopeKind: ScopeKind; Pos: pos } +[] type FSharpModule = { Idents: ShortIdents; Range: range } type OpenStatementInsertionPoint = diff --git a/src/Compiler/Service/ServiceParsedInputOps.fsi b/src/Compiler/Service/ServiceParsedInputOps.fsi index 336e6213a7a..3aee58682cb 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fsi +++ b/src/Compiler/Service/ServiceParsedInputOps.fsi @@ -14,7 +14,7 @@ type public InheritanceContext = | Interface | Unknown -[] +[] type public RecordContext = | CopyOnUpdate of range: range * path: CompletionPath | Constructor of typeName: string @@ -22,7 +22,7 @@ type public RecordContext = | New of path: CompletionPath * isFirstField: bool | Declaration of isInIdentifier: bool -[] +[] type public PatternContext = /// Completing union case field pattern (e.g. fun (Some v| ) -> ) or fun (Some (v| )) -> ). In theory, this could also be parameterized active pattern usage. /// Position in the tuple. None if there is no tuple, with only one field outside of parentheses - `Some v|` @@ -42,7 +42,7 @@ type public PatternContext = /// Any other position in a pattern that does not need special handling | Other -[] +[] type public CompletionContext = /// Completion context cannot be determined due to errors | Invalid @@ -102,7 +102,7 @@ type public ScopeKind = | HashDirective /// Insert open namespace context. -[] +[] type public InsertionContext = { /// Current scope kind. diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index c5b6e64ffdc..78c0e10f3c2 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -49,7 +49,9 @@ module EnvMisc = // BackgroundCompiler // +[] [] +[] type DocumentSource = | FileSystem | Custom of (string -> Async) diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 297d7b367bc..2d61fa822ea 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -18,6 +18,7 @@ open FSharp.Compiler.Tokenization [] [] +[] type DocumentSource = | FileSystem | Custom of (string -> Async) diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 3aa8f1cbe5e..b16f7be7edf 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -22,6 +22,7 @@ module ExprTranslationImpl = let nonNil x = not (List.isEmpty x) + [] type ExprTranslationEnv = { /// Map from Val to binding index @@ -85,6 +86,7 @@ module ExprTranslationImpl = /// The core tree of data produced by converting F# compiler TAST expressions into the form which we make available through the compiler API /// through active patterns. +[] type E = | Value of FSharpMemberOrFunctionOrValue | ThisValue of FSharpType @@ -1342,7 +1344,7 @@ type FSharpAssemblyContents(cenv: SymbolEnv, mimpls: CheckedImplFile list) = member _.ImplementationFiles = [ for mimpl in mimpls -> FSharpImplementationFileContents(cenv, mimpl)] -and FSharpImplementationFileDeclaration = +and [] FSharpImplementationFileDeclaration = | Entity of entity: FSharpEntity * declarations: FSharpImplementationFileDeclaration list | MemberOrFunctionOrValue of value: FSharpMemberOrFunctionOrValue * curriedArgs: FSharpMemberOrFunctionOrValue list list * body: FSharpExpr | InitAction of action: FSharpExpr diff --git a/src/Compiler/Symbols/Exprs.fsi b/src/Compiler/Symbols/Exprs.fsi index fddc3d0ea4e..c7b99acb9ed 100644 --- a/src/Compiler/Symbols/Exprs.fsi +++ b/src/Compiler/Symbols/Exprs.fsi @@ -42,7 +42,7 @@ type public FSharpImplementationFileContents = member HasExplicitEntryPoint: bool /// Represents a declaration in an implementation file, as seen by the F# language -[] +[] type public FSharpImplementationFileDeclaration = /// Represents the declaration of a type diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index f3ad450a461..870f0eb4fa8 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -27,7 +27,7 @@ open FSharp.Compiler.TypeHierarchy open FSharp.Compiler.TcGlobals /// Describe a comment as either a block of text or a file+signature reference into an intellidoc file. -[] +[] type FSharpXmlDoc = | None | FromXmlText of XmlDoc diff --git a/src/Compiler/Symbols/SymbolHelpers.fsi b/src/Compiler/Symbols/SymbolHelpers.fsi index b25bf18d60f..433ee5ae5cb 100755 --- a/src/Compiler/Symbols/SymbolHelpers.fsi +++ b/src/Compiler/Symbols/SymbolHelpers.fsi @@ -20,7 +20,7 @@ open FSharp.Compiler.TypedTreeOps /// Describe a comment as either a block of text or a file+signature reference into an intellidoc file. // // Note: instances of this type do not hold any references to any compiler resources. -[] +[] type public FSharpXmlDoc = /// No documentation is available | None diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index e405ded53e5..869315612f7 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -1042,6 +1042,7 @@ type FSharpUnionCase(cenv, v: UnionCaseRef) = override x.ToString() = x.CompiledName +[] type FSharpFieldData = | AnonField of AnonRecdTypeInfo * TTypes * int * range | ILField of ILFieldInfo @@ -1591,6 +1592,7 @@ type FSharpInlineAnnotation = | NeverInline | AggressiveInline +[] type FSharpMemberOrValData = | E of EventInfo | P of PropInfo diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index e592960c6ba..ce511bedf82 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -27,6 +27,7 @@ let outputPos os (pos: Position) = Printf.fprintf os "(%d:%d)" pos.OriginalLine /// p.OriginalLine) let warningStringOfPosition (pos: Position) = warningStringOfCoords pos.Line pos.Column +[] type Context = // Position is position of keyword. // bool indicates 'LET' is an offside let that's part of a CtxtSeqBlock where the 'in' is optional diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index 02d4da364d4..a501b35f963 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -55,6 +55,7 @@ type LexResourceManager(?capacity: int) = res /// Lexer parameters +[] type LexArgs = { conditionalDefines: string list @@ -161,6 +162,7 @@ type LexerStringFinisherContext = | Verbatim = 2 | TripleQuote = 4 +[] type LexerStringFinisher = | LexerStringFinisher of (ByteBuffer -> LexerStringKind -> LexerStringFinisherContext -> LexerContinuation -> token) diff --git a/src/Compiler/SyntaxTree/LexHelpers.fsi b/src/Compiler/SyntaxTree/LexHelpers.fsi index 616bfa8a6fd..eda622745e3 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fsi +++ b/src/Compiler/SyntaxTree/LexHelpers.fsi @@ -30,6 +30,7 @@ type LexResourceManager = new: ?capacity: int -> LexResourceManager /// The context applicable to all lexing functions (tokens, strings etc.) +[] type LexArgs = { conditionalDefines: string list resourceManager: LexResourceManager @@ -67,6 +68,7 @@ type LexerStringFinisherContext = | Verbatim = 2 | TripleQuote = 4 +[] type LexerStringFinisher = | LexerStringFinisher of (ByteBuffer -> LexerStringKind -> LexerStringFinisherContext -> LexerContinuation -> token) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index bb2e7755767..02c46790514 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -161,6 +161,7 @@ type LexerIfdefStack = LexerIfdefStackEntries /// Specifies how the 'endline' function in the lexer should continue after /// it reaches end of line or eof. The options are to continue with 'token' function /// or to continue with 'skip' function. +[] type LexerEndlineContinuation = | Token | Skip of int * range: range @@ -975,6 +976,7 @@ let checkEndOfFileError t = | [] -> () | (_, _, _, m) :: _ -> reportParseErrorAt m (FSComp.SR.parsEofInInterpolatedStringFill ()) +[] type BindingSet = BindingSetPreAttrs of range * bool * bool * (SynAttributes -> SynAccess option -> SynAttributes * SynBinding list) * range let mkClassMemberLocalBindings diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 9add16af683..1daf0193a84 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -65,6 +65,7 @@ type LexerIfdefStackEntries = (LexerIfdefStackEntry * range) list type LexerIfdefStack = LexerIfdefStackEntries +[] type LexerEndlineContinuation = | Token | Skip of int * range: range @@ -231,6 +232,7 @@ val unionRangeWithPos: r: range -> p: pos -> range val checkEndOfFileError: t: LexerContinuation -> unit +[] type BindingSet = | BindingSetPreAttrs of range * diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index c34fb57d86e..68b77d8083c 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -950,6 +950,7 @@ let MangledGlobalName = "`global`" let IllegalCharactersInTypeAndNamespaceNames = [| '.'; '+'; '$'; '&'; '['; ']'; '/'; '\\'; '*'; '\"'; '`' |] +[] type ActivePatternInfo = | APInfo of bool * (string * range) list * range diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index 05478070e1a..3cb9c273b46 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -223,6 +223,7 @@ val internal MangledGlobalName: string = "`global`" val internal IllegalCharactersInTypeAndNamespaceNames: char[] +[] type internal ActivePatternInfo = | APInfo of bool * (string * range) list * range diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 97f40bee62c..7ab12fd59f8 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -16,10 +16,12 @@ type Ident(text: string, range: range) = member _.idRange = range override _.ToString() = text +[] type SynIdent = SynIdent of ident: Ident * trivia: IdentTrivia option type LongIdent = Ident list +[] type SynLongIdent = | SynLongIdent of id: LongIdent * dotRanges: range list * trivia: IdentTrivia option list @@ -201,7 +203,7 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range -[] +[] type SynAccess = | Public of range: range @@ -233,40 +235,40 @@ type DebugPointAtSequential = | SuppressBoth | SuppressExpr -[] +[] type DebugPointAtTry = | Yes of range: range | No -[] +[] type DebugPointAtLeafExpr = Yes of range -[] +[] type DebugPointAtWith = | Yes of range: range | No -[] +[] type DebugPointAtFinally = | Yes of range: range | No -[] +[] type DebugPointAtFor = | Yes of range: range | No -[] +[] type DebugPointAtInOrTo = | Yes of range: range | No -[] +[] type DebugPointAtWhile = | Yes of range: range | No -[] +[] type DebugPointAtBinding = | Yes of range: range @@ -355,7 +357,7 @@ type SynTypeConstraint = | WhereTyparIsDelegate(range = range) -> range | WhereSelfConstrained(range = range) -> range -[] +[] type SynTyparDecls = | PostfixList of decls: SynTyparDecl list * constraints: SynTypeConstraint list * range: range | PrefixList of decls: SynTyparDecl list * range: range @@ -880,7 +882,7 @@ type SynSimplePat = | SynSimplePat.Typed(range = range) | SynSimplePat.Attrib(range = range) -> range -[] +[] type SynSimplePatAlternativeIdInfo = | Undecided of Ident @@ -902,7 +904,7 @@ type SynSimplePats = match x with | SynSimplePats.SimplePats(range = range) -> range -[] +[] type SynArgPats = | Pats of pats: SynPat list @@ -1034,7 +1036,7 @@ type SynAttribute = Range: range } -[] +[] type SynAttributeList = { Attributes: SynAttribute list @@ -1683,7 +1685,7 @@ type ParsedImplFile = ParsedImplFile of hashDirectives: ParsedHashDirective list [] type ParsedSigFile = ParsedSigFile of hashDirectives: ParsedHashDirective list * fragments: ParsedSigFileFragment list -[] +[] type ScopedPragma = WarningOff of range: range * warningNumber: int [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 72e4a9d216a..327a7a4d122 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -16,6 +16,7 @@ type Ident = member idRange: range /// Represents an identifier with potentially additional trivia information. +[] type SynIdent = SynIdent of ident: Ident * trivia: IdentTrivia option /// Represents a long identifier e.g. 'A.B.C' @@ -28,6 +29,7 @@ type LongIdent = Ident list /// if dotRanges.Length = lid.Length, then the parser must have reported an error, so the typechecker is allowed /// more freedom about typechecking these expressions. /// LongIdent can be empty list - it is used to denote that name of some AST element is absent (i.e. empty type name in inherit) +[] type SynLongIdent = | SynLongIdent of id: LongIdent * dotRanges: range list * trivia: IdentTrivia option list @@ -229,7 +231,7 @@ type SynRationalConst = | Paren of rationalConst: SynRationalConst * range: range /// Represents an accessibility modifier in F# syntax -[] +[] type SynAccess = /// A construct marked or assumed 'public' | Public of range: range @@ -251,7 +253,7 @@ type DebugPointAtTarget = | No /// Represents a debug point at a leaf expression (e.g. an application or constant). -[] +[] type DebugPointAtLeafExpr = Yes of range /// Represents whether a debug point should be suppressed for either the @@ -273,49 +275,49 @@ type DebugPointAtSequential = /// Represents whether a debug point should be present for a 'try', that is whether /// the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtTry = | Yes of range: range | No /// Represents whether a debug point should be present for the 'with' in a 'try .. with', /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtWith = | Yes of range: range | No /// Represents whether a debug point should be present for the 'finally' in a 'try .. finally', /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtFinally = | Yes of range: range | No /// Represents whether a debug point should be present for the 'for' in a 'for...' loop, /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtFor = | Yes of range: range | No /// Represents whether a debug point should be present for the 'in' or 'to' of a 'for...' loop, /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtInOrTo = | Yes of range: range | No /// Represents whether a debug point should be present for the 'while' in a 'while...' loop, /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtWhile = | Yes of range: range | No /// Represents whether a debug point should be present for a 'let' binding, /// that is whether the construct corresponds to a debug point in the original source. -[] +[] type DebugPointAtBinding = // Indicates emit of a debug point prior to the 'let' | Yes of range: range @@ -433,7 +435,7 @@ type SynTypeConstraint = /// List of type parameter declarations with optional type constraints, /// enclosed in `< ... >` (postfix) or `( ... )` (prefix), or a single prefix parameter. -[] +[] type SynTyparDecls = | PostfixList of decls: SynTyparDecl list * constraints: SynTypeConstraint list * range: range | PrefixList of decls: SynTyparDecl list * range: range @@ -1016,7 +1018,7 @@ type SynSimplePat = member Range: range /// Represents the alternative identifier for a simple pattern -[] +[] type SynSimplePatAlternativeIdInfo = /// We have not decided to use an alternative name in the pattern and related expression @@ -1046,7 +1048,7 @@ type SynSimplePats = member Range: range /// Represents a syntax tree for arguments patterns -[] +[] type SynArgPats = | Pats of pats: SynPat list @@ -1180,7 +1182,7 @@ type SynAttribute = } /// List of attributes enclosed in [< ... >]. -[] +[] type SynAttributeList = { /// The list of attributes @@ -1888,7 +1890,7 @@ type ParsedImplFile = type ParsedSigFile = ParsedSigFile of hashDirectives: ParsedHashDirective list * fragments: ParsedSigFileFragment list /// Represents a scoped pragma -[] +[] type ScopedPragma = /// A pragma to turn a warning off | WarningOff of range: range * warningNumber: int diff --git a/src/Compiler/SyntaxTree/XmlDoc.fs b/src/Compiler/SyntaxTree/XmlDoc.fs index 0bfb9c09f48..6a0b65764c3 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fs +++ b/src/Compiler/SyntaxTree/XmlDoc.fs @@ -244,6 +244,7 @@ type XmlDocCollector() = List.ofSeq comments /// Represents the XmlDoc fragments as collected from the lexer during parsing +[] type PreXmlDoc = | PreXmlDirect of unprocessedLines: string[] * range: range | PreXmlMerge of PreXmlDoc * PreXmlDoc diff --git a/src/Compiler/SyntaxTree/XmlDoc.fsi b/src/Compiler/SyntaxTree/XmlDoc.fsi index 33b168786cc..1a47e246bcf 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fsi +++ b/src/Compiler/SyntaxTree/XmlDoc.fsi @@ -62,7 +62,7 @@ type internal XmlDocCollector = member CheckInvalidXmlDocPositions: unit -> range list /// Represents the XmlDoc fragments as collected from the lexer during parsing -[] +[] type public PreXmlDoc = static member internal CreateFromGrabPoint: collector: XmlDocCollector * grabPointPos: pos -> PreXmlDoc diff --git a/src/Compiler/TypedTree/QuotationPickler.fs b/src/Compiler/TypedTree/QuotationPickler.fs index 4c613f007d2..5b3a7cf9f03 100644 --- a/src/Compiler/TypedTree/QuotationPickler.fs +++ b/src/Compiler/TypedTree/QuotationPickler.fs @@ -249,6 +249,7 @@ let PickleBufferCapacity = 100000 module SimplePickle = + [] type Table<'T> = { tbl: HashMultiMap<'T, int> // This should be "Dictionary" mutable rows: 'T list @@ -278,6 +279,7 @@ module SimplePickle = member tbl.ContainsKey x = tbl.tbl.ContainsKey x + [] type QuotationPickleOutState = { os: ByteBuffer ostrings: Table } diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index 9eb76091897..3ea9d116fd4 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -29,7 +29,8 @@ exception ProvidedTypeResolutionNoRange of exn let toolingCompatiblePaths() = Internal.Utilities.FSharpEnvironment.toolingCompatiblePaths () -/// Represents some of the configuration parameters passed to type provider components +/// Represents some of the configuration parameters passed to type provider components +[] type ResolutionEnvironment = { ResolutionFolder: string OutputFile: string option @@ -297,6 +298,7 @@ type ProvidedTypeComparer() = /// /// Laziness is used "to prevent needless computation for every type during remapping". However it /// appears that the laziness likely serves no purpose and could be safely removed. +[] type ProvidedTypeContext = | NoEntries // The dictionaries are safe because the ProvidedType with the ProvidedTypeContext are only accessed one thread at a time during type-checking. @@ -852,6 +854,7 @@ type ProvidedConstructorInfo (x: ConstructorInfo, ctxt) = override _.GetHashCode() = assert false; x.GetHashCode() +[] type ProvidedExprType = | ProvidedNewArrayExpr of ProvidedType * ProvidedExpr[] #if PROVIDED_ADDRESS_OF @@ -1379,6 +1382,7 @@ type ProviderGeneratedType = ProviderGeneratedType of ilOrigTyRef: ILTypeRef * i /// The table of information recording remappings from type names in the provided assembly to type /// names in the statically linked, embedded assembly, plus what types are nested in side what types. +[] type ProvidedAssemblyStaticLinkingMap = { ILTypeMap: Dictionary } diff --git a/src/Compiler/TypedTree/TypeProviders.fsi b/src/Compiler/TypedTree/TypeProviders.fsi index b1e3ccaf85c..ca6721f273d 100755 --- a/src/Compiler/TypedTree/TypeProviders.fsi +++ b/src/Compiler/TypedTree/TypeProviders.fsi @@ -25,6 +25,7 @@ exception ProvidedTypeResolutionNoRange of exn val toolingCompatiblePaths: unit -> string list /// Carries information about the type provider resolution environment. +[] type ResolutionEnvironment = { /// The folder from which an extension provider is resolving from. This is typically the project folder. @@ -71,7 +72,7 @@ val DisplayNameOfTypeProvider: Tainted * range -> string /// /// The 'obj' values are all TyconRef, but obj is used due to a forward reference being required. Not particularly /// pleasant, but better than intertwining the whole "ProvidedType" with the TAST structure. -[] +[] type ProvidedTypeContext = member TryGetILTypeRef: ProvidedType -> ILTypeRef option @@ -370,6 +371,7 @@ type ProvidedEventInfo = type ProvidedConstructorInfo = inherit ProvidedMethodBase +[] type ProvidedExprType = | ProvidedNewArrayExpr of ProvidedType * ProvidedExpr[] @@ -487,6 +489,7 @@ type ProviderGeneratedType = /// The table of information recording remappings from type names in the provided assembly to type /// names in the statically linked, embedded assembly, plus what types are nested in side what types. +[] type ProvidedAssemblyStaticLinkingMap = { /// The table of remappings from type names in the provided assembly to type diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index a0665d32212..e3d6cfb92b6 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -521,6 +521,7 @@ type PublicPath = /// The information ILXGEN needs about the location of an item +[] type CompilationPath = | CompPath of ILScopeRef * (string * ModuleOrNamespaceKind) list @@ -1334,6 +1335,7 @@ type Entity = type EntityData = Entity /// Represents the parent entity of a type definition, if any +[] type ParentRef = | Parent of parent: EntityRef | ParentNone @@ -1566,6 +1568,7 @@ type TProvidedTypeInfo = #endif +[] type FSharpTyconKind = /// Indicates the type is an F#-declared record | TFSharpRecord @@ -4284,7 +4287,7 @@ type TypeInst = TType list type TTypes = TType list /// Represents the information identifying an anonymous record -[] +[] type AnonRecdTypeInfo = { // Mutability for pickling/unpickling only @@ -4364,7 +4367,7 @@ type TupInfo = | Const of bool /// Represents a unit of measure in the typed AST -[] +[] type Measure = /// A variable unit-of-measure @@ -4754,6 +4757,7 @@ type ArgReprInfo = /// compiled as "real" IL type parameters, specifically for values with /// ValReprInfo. Any information here is propagated from signature through /// to the compiled code. +[] type TyparReprInfo = TyparReprInfo of Ident * TyparKind type Typars = Typar list @@ -5182,6 +5186,7 @@ type SequentialOpKind = | ThenDoSeq /// Indicates how a value, function or member is being used at a particular usage point. +[] type ValUseFlag = /// Indicates a use of a value represents a call to a method that may require @@ -5203,6 +5208,7 @@ type ValUseFlag = | VSlotDirectCall /// Represents the kind of an F# core library static optimization construct +[] type StaticOptimization = /// Indicates the static optimization applies when a type equality holds @@ -5289,6 +5295,7 @@ type SlotParam = override x.ToString() = "TSlotParam(...)" /// Represents open declaration statement. +[] type OpenDeclaration = { /// Syntax after 'open' as it's presented in source code. Target: SynOpenDeclTarget @@ -5495,6 +5502,7 @@ type CcuData = override x.ToString() = sprintf "CcuData(%A)" x.FileName +[] type CcuTypeForwarderTree = { Value : Lazy option @@ -5520,6 +5528,7 @@ module CcuTypeForwarderTable = | false, _ -> None /// Represents a table of .NET CLI type forwarders for an assembly +[] type CcuTypeForwarderTable = { Root : CcuTypeForwarderTree diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 61674b35fa1..1066352c9d8 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -321,6 +321,7 @@ type PublicPath = member EnclosingPath: string[] /// The information ILXGEN needs about the location of an item +[] type CompilationPath = | CompPath of ILScopeRef * (string * ModuleOrNamespaceKind) list @@ -787,6 +788,7 @@ type Entity = type EntityData = Entity /// Represents the declaring entity of a type definition, if any +[] type ParentRef = | Parent of parent: EntityRef | ParentNone @@ -992,6 +994,7 @@ type TProvidedTypeInfo = #endif +[] type FSharpTyconKind = /// Indicates the type is an F#-declared record | TFSharpRecord @@ -3069,7 +3072,7 @@ type TypeInst = TType list type TTypes = TType list /// Represents the information identifying an anonymous record -[] +[] type AnonRecdTypeInfo = { mutable Assembly: CcuThunk mutable TupInfo: TupInfo @@ -3103,7 +3106,7 @@ type TupInfo = | Const of bool /// Represents a unit of measure in the typed AST -[] +[] type Measure = /// A variable unit-of-measure @@ -3433,6 +3436,7 @@ type ArgReprInfo = /// compiled as "real" IL type parameters, specifically for values with /// ValReprInfo. Any information here is propagated from signature through /// to the compiled code. +[] type TyparReprInfo = TyparReprInfo of Syntax.Ident * TyparKind type Typars = Typar list @@ -3759,6 +3763,7 @@ type SequentialOpKind = | ThenDoSeq /// Indicates how a value, function or member is being used at a particular usage point. +[] type ValUseFlag = /// Indicates a use of a value represents a call to a method that may require @@ -3778,6 +3783,7 @@ type ValUseFlag = | VSlotDirectCall /// Represents the kind of an F# core library static optimization construct +[] type StaticOptimization = /// Indicates the static optimization applies when a type equality holds @@ -3863,6 +3869,7 @@ type SlotParam = member Type: TType /// Represents open declaration statement. +[] type OpenDeclaration = { @@ -4059,6 +4066,7 @@ type CcuData = [] member DebugText: string +[] type CcuTypeForwarderTree = { Value: Lazy option Children: ImmutableDictionary } @@ -4066,6 +4074,7 @@ type CcuTypeForwarderTree = static member Empty: CcuTypeForwarderTree /// Represents a table of .NET CLI type forwarders for an assembly +[] type CcuTypeForwarderTable = { Root: CcuTypeForwarderTree } diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 76e730eab6c..14074217b32 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -1377,6 +1377,7 @@ let NormalizeDeclaredTyparsForEquiRecursiveInference g tps = | ValueSome anyParTy -> anyParTy | ValueNone -> tp) +[] type GeneralizedType = GeneralizedType of Typars * TType let mkGenericBindRhs g m generalizedTyparsForRecursiveBlock typeScheme bodyExpr = @@ -1828,6 +1829,7 @@ let isOutByrefTy g ty = let extensionInfoOfTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _, _) -> tcref.TypeReprInfo | _ -> TNoRepr) #endif +[] type TypeDefMetadata = | ILTypeMetadata of TILObjectReprData | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata @@ -2150,6 +2152,7 @@ let unionFreeTyvars fvs1 fvs2 = FreeTraitSolutions = unionFreeLocals fvs1.FreeTraitSolutions fvs2.FreeTraitSolutions FreeTypars = unionFreeTypars fvs1.FreeTypars fvs2.FreeTypars } +[] type FreeVarOptions = { canCache: bool collectInTypes: bool @@ -3035,6 +3038,7 @@ module SimplifyTypes = // print multiple fragments of the same type using consistent naming and formatting let accTyparCountsMulti acc l = List.fold accTyparCounts acc l + [] type TypeSimplificationInfo = { singletons: Typar Zset inplaceConstraints: Zmap @@ -4658,7 +4662,7 @@ let wrapModuleOrNamespaceContentsInNamespace isModule (id: Ident) (cpath: Compil // Data structures representing what gets hidden and what gets remapped // when a module signature is applied to a module. //-------------------------------------------------------------------------- - +[] type SignatureRepackageInfo = { RepackagedVals: (ValRef * ValRef) list RepackagedEntities: (TyconRef * TyconRef) list } @@ -5684,6 +5688,7 @@ let tmenvCopyRemapAndBindTypars remapAttrib tmenv tps = let tmenvinner = tyenvinner tps', tmenvinner +[] type RemapContext = { g: TcGlobals stackGuard: StackGuard } @@ -7178,7 +7183,7 @@ let JoinTyparStaticReq r1 r2 = //------------------------------------------------------------------------- // ExprFolder - fold steps //------------------------------------------------------------------------- - +[] type ExprFolder<'State> = { exprIntercept : (* recurseF *) ('State -> Expr -> 'State) -> (* noInterceptF *) ('State -> Expr -> 'State) -> 'State -> Expr -> 'State // the bool is 'bound in dtree' diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 2345ac5eb40..ad2ac7b7ad9 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -237,6 +237,7 @@ val mkLetRecBinds: range -> Bindings -> Expr -> Expr /// /// generalizedTypars -- the truly generalized type parameters /// tauTy -- the body of the generalized type. A 'tau' type is one with its type parameters stripped off. +[] type GeneralizedType = GeneralizedType of Typars * TType /// Make the right-hand side of a generalized binding, incorporating the generalized generic parameters from the type @@ -806,7 +807,7 @@ val emptyFreeLocals: FreeLocals val unionFreeLocals: FreeLocals -> FreeLocals -> FreeLocals /// Represents the options to activate when collecting free variables -[] +[] type FreeVarOptions = /// During backend code generation of state machines, register a template replacement for struct types. /// This may introduce new free variables related to the instantiation of the struct type. @@ -1135,6 +1136,7 @@ val prefixOfInferenceTypar: Typar -> string /// Utilities used in simplifying types for visual presentation module SimplifyTypes = + [] type TypeSimplificationInfo = { singletons: Typar Zset inplaceConstraints: Zmap @@ -1259,6 +1261,7 @@ val instExpr: TcGlobals -> TyparInstantiation -> Expr -> Expr /// The remapping that corresponds to a module meeting its signature /// and also report the set of tycons, tycon representations and values hidden in the process. +[] type SignatureRepackageInfo = { /// The list of corresponding values @@ -1496,6 +1499,7 @@ module DebugPrint = val recdFieldRefL: RecdFieldRef -> Layout /// A set of function parameters (visitor) for folding over expressions +[] type ExprFolder<'State> = { exprIntercept: ('State -> Expr -> 'State) -> ('State -> Expr -> 'State) -> 'State -> Expr -> 'State valBindingSiteIntercept: 'State -> bool * Val -> 'State @@ -1587,6 +1591,7 @@ val mkPrintfFormatTy: TcGlobals -> TType -> TType -> TType -> TType -> TType -> //------------------------------------------------------------------------- /// Represents metadata extracted from a nominal type +[] type TypeDefMetadata = | ILTypeMetadata of TILObjectReprData | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata diff --git a/src/Compiler/TypedTree/tainted.fs b/src/Compiler/TypedTree/tainted.fs index f586f99a3cd..5c0e91b3e3f 100644 --- a/src/Compiler/TypedTree/tainted.fs +++ b/src/Compiler/TypedTree/tainted.fs @@ -77,9 +77,10 @@ type internal TypeProviderError for msg in errors do f (TypeProviderError(errNum, tpDesignation, m, [msg], typeNameContext, methodNameContext)) +[] type TaintedContext = { TypeProvider: ITypeProvider; TypeProviderAssemblyRef: ILScopeRef; Lock: TypeProviderLock } -[][] +[] type internal Tainted<'T> (context: TaintedContext, value: 'T) = do match box context.TypeProvider with diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index c702e3b7a0b..2c5e7477933 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -33,12 +33,12 @@ open System.Threading open FSharp.Core.CompilerServices.StateMachineHelpers #endif -[] +[] type ValueOrCancelled<'TResult> = | Value of result: 'TResult | Cancelled of ``exception``: OperationCanceledException -[] +[] type Cancellable<'T> = Cancellable of (CancellationToken -> ValueOrCancelled<'T>) module Cancellable = diff --git a/src/Compiler/Utilities/Cancellable.fsi b/src/Compiler/Utilities/Cancellable.fsi index 6e36d7ecb6d..5ac1e72cf19 100644 --- a/src/Compiler/Utilities/Cancellable.fsi +++ b/src/Compiler/Utilities/Cancellable.fsi @@ -15,7 +15,7 @@ namespace Internal.Utilities.Library open System open System.Threading -[] +[] type internal ValueOrCancelled<'TResult> = | Value of result: 'TResult | Cancelled of ``exception``: OperationCanceledException @@ -24,7 +24,7 @@ type internal ValueOrCancelled<'TResult> = /// /// A cancellable computation may be cancelled via a CancellationToken, which is propagated implicitly. /// If cancellation occurs, it is propagated as data rather than by raising an OperationCanceledException. -[] +[] type internal Cancellable<'T> = Cancellable of (CancellationToken -> ValueOrCancelled<'T>) module internal Cancellable = diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index 5b555915e6c..66406206397 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -879,6 +879,7 @@ type ByteMemory with else ByteArrayMemory.FromArray(bytes, 0, bytes.Length) +[] type internal ByteStream = { bytes: ReadOnlyByteMemory diff --git a/src/Compiler/Utilities/FileSystem.fsi b/src/Compiler/Utilities/FileSystem.fsi index 2fe2cadebca..f81725b7c98 100644 --- a/src/Compiler/Utilities/FileSystem.fsi +++ b/src/Compiler/Utilities/FileSystem.fsi @@ -338,7 +338,7 @@ type internal ByteMemory with /// Gets a ByteMemory object that is empty static member Empty: ByteMemory -[] +[] type internal ByteStream = member IsEOF: bool diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index f6deb3951ef..c200b12a135 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -912,7 +912,7 @@ module Map = | Some res -> res | None -> [] -[] +[] type ResultOrException<'TResult> = | Result of result: 'TResult | Exception of ``exception``: Exception diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index fa2f1416d9c..5a3286ef77e 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -371,7 +371,7 @@ module internal LockAutoOpens = module internal Map = val tryFindMulti: k: 'a -> map: Map<'a, 'b list> -> 'b list when 'a: comparison -[] +[] type internal ResultOrException<'TResult> = | Result of result: 'TResult | Exception of ``exception``: Exception diff --git a/src/Compiler/Utilities/lib.fs b/src/Compiler/Utilities/lib.fs index 87e50acd74a..dfb0abe2a55 100755 --- a/src/Compiler/Utilities/lib.fs +++ b/src/Compiler/Utilities/lib.fs @@ -380,7 +380,7 @@ type Dumper(x:obj) = member self.Dump = sprintf "%A" x #endif -[] +[] type MaybeLazy<'T> = | Strict of 'T | Lazy of InterruptibleLazy<'T> diff --git a/src/Compiler/Utilities/lib.fsi b/src/Compiler/Utilities/lib.fsi index c7bccd4211d..9e9531911f8 100644 --- a/src/Compiler/Utilities/lib.fsi +++ b/src/Compiler/Utilities/lib.fsi @@ -247,7 +247,7 @@ val inline cacheOptRef: cache: 'a option ref -> f: (unit -> 'a) -> 'a val inline tryGetCacheValue: cache: cache<'a> -> NonNullSlot<'a> voption -[] +[] type MaybeLazy<'T> = | Strict of 'T | Lazy of InterruptibleLazy<'T> 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..c6e6cc75efe 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 @@ -463,11 +463,6 @@ FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String Name FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String get_Name() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Void .ctor(System.String, ILType, System.Reflection.FieldAttributes, Microsoft.FSharp.Core.FSharpOption`1[System.Byte[]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILNativeType], ILAttributes) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(ILFieldDefs) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(System.Object) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Int32 GetHashCode() -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILFieldDefs: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILFieldInit+Bool: Boolean Item FSharp.Compiler.AbstractIL.IL+ILFieldInit+Bool: Boolean get_Item() @@ -814,11 +809,6 @@ FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Int32 GetHashCode() FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Void .ctor(ILOverridesSpec, ILMethodSpec) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(ILMethodImplDefs) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(System.Object) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Int32 GetHashCode() -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILMethodRef: Boolean Equals(ILMethodRef) FSharp.Compiler.AbstractIL.IL+ILMethodRef: Boolean Equals(System.Object) @@ -3061,9 +3051,6 @@ FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorSer FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Property FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Tags FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Type -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(FSharp.Compiler.EditorServices.FindDeclExternalSymbol) -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(System.Object) -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 GetHashCode() FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 Tag @@ -5974,9 +5961,6 @@ FSharp.Compiler.Syntax.SynAccess+Public: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Internal FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Private FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Public -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(FSharp.Compiler.Syntax.SynAccess) -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(System.Object) -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(System.Object, System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SynAccess: Boolean IsInternal FSharp.Compiler.Syntax.SynAccess: Boolean IsPrivate FSharp.Compiler.Syntax.SynAccess: Boolean IsPublic @@ -5992,8 +5976,6 @@ FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Syntax.SynAccess+Public FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Syntax.SynAccess+Tags FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Text.Range get_Range() -FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode() -FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SynAccess: Int32 Tag FSharp.Compiler.Syntax.SynAccess: Int32 get_Tag() FSharp.Compiler.Syntax.SynAccess: System.String ToString() 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 25a540db859..c6e6cc75efe 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 @@ -463,11 +463,6 @@ FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String Name FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILFieldDef: System.String get_Name() FSharp.Compiler.AbstractIL.IL+ILFieldDef: Void .ctor(System.String, ILType, System.Reflection.FieldAttributes, Microsoft.FSharp.Core.FSharpOption`1[System.Byte[]], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILFieldInit], Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.AbstractIL.IL+ILNativeType], ILAttributes) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(ILFieldDefs) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(System.Object) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Int32 GetHashCode() -FSharp.Compiler.AbstractIL.IL+ILFieldDefs: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILFieldDefs: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILFieldInit+Bool: Boolean Item FSharp.Compiler.AbstractIL.IL+ILFieldInit+Bool: Boolean get_Item() @@ -814,11 +809,6 @@ FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Int32 GetHashCode() FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILMethodImplDef: Void .ctor(ILOverridesSpec, ILMethodSpec) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(ILMethodImplDefs) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(System.Object) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Int32 GetHashCode() -FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.AbstractIL.IL+ILMethodImplDefs: System.String ToString() FSharp.Compiler.AbstractIL.IL+ILMethodRef: Boolean Equals(ILMethodRef) FSharp.Compiler.AbstractIL.IL+ILMethodRef: Boolean Equals(System.Object) @@ -3061,9 +3051,6 @@ FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorSer FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Property FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Tags FSharp.Compiler.EditorServices.FindDeclExternalSymbol: FSharp.Compiler.EditorServices.FindDeclExternalSymbol+Type -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(FSharp.Compiler.EditorServices.FindDeclExternalSymbol) -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(System.Object) -FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 GetHashCode() FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.EditorServices.FindDeclExternalSymbol: Int32 Tag @@ -5974,9 +5961,6 @@ FSharp.Compiler.Syntax.SynAccess+Public: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Internal FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Private FSharp.Compiler.Syntax.SynAccess+Tags: Int32 Public -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(FSharp.Compiler.Syntax.SynAccess) -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(System.Object) -FSharp.Compiler.Syntax.SynAccess: Boolean Equals(System.Object, System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SynAccess: Boolean IsInternal FSharp.Compiler.Syntax.SynAccess: Boolean IsPrivate FSharp.Compiler.Syntax.SynAccess: Boolean IsPublic @@ -5992,8 +5976,6 @@ FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Syntax.SynAccess+Public FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Syntax.SynAccess+Tags FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynAccess: FSharp.Compiler.Text.Range get_Range() -FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode() -FSharp.Compiler.Syntax.SynAccess: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SynAccess: Int32 Tag FSharp.Compiler.Syntax.SynAccess: Int32 get_Tag() FSharp.Compiler.Syntax.SynAccess: System.String ToString() From 1e597ff1f1ac3e8cdffbd62bcf824ee2dcd34123 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 13 Dec 2023 11:28:21 +0100 Subject: [PATCH 2/2] Remove warnon:1178 --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 5d7a9f5a465..687bc269233 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -15,8 +15,6 @@ $(DefineConstants);COMPILER $(DefineConstants);FSHARPCORE_USE_PACKAGE $(OtherFlags) --extraoptimizationloops:1 - - $(OtherFlags) --warnon:1178 $(OtherFlags) --warnon:1182