From 3e4500deda2f990262b184e8c5796a58582458ef Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 5 Nov 2021 22:09:33 +0000 Subject: [PATCH 01/15] add fantomasignore --- src/fsharp/.fantomasignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/fsharp/.fantomasignore diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore new file mode 100644 index 00000000000..32f5e24e838 --- /dev/null +++ b/src/fsharp/.fantomasignore @@ -0,0 +1,5 @@ +*.fs +*.fsx +PrettyNaming.fsi +ErrorLogger.fsi +lib.fsi From 5d52552bc713f81e7c12779971fe553df01ba31a Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 5 Nov 2021 22:11:28 +0000 Subject: [PATCH 02/15] add fantomasignore --- src/fsharp/.fantomasignore | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index 32f5e24e838..81b91424605 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -3,3 +3,4 @@ PrettyNaming.fsi ErrorLogger.fsi lib.fsi +CompilerDiagnostics.fsi From bba52dda5f2305e3c4c8cae88276fa11170c9e8e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 5 Nov 2021 22:40:49 +0000 Subject: [PATCH 03/15] fix ignores --- src/fsharp/.fantomasignore | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index 81b91424605..c721ad89031 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -1,6 +1,29 @@ *.fs *.fsx +# https://github.com/fsprojects/fantomas/issues/1953 PrettyNaming.fsi ErrorLogger.fsi lib.fsi + +# https://github.com/fsprojects/fantomas/issues/1954 CompilerDiagnostics.fsi +CompilerOptions.fsi + +# absil +**/ilread.fsi + +# utils +**/prim-parsing.fsi + +# service +**/ServiceDeclarationLists.fsi + +# FSharp.Core (to investigate) +**/fslib-extra-pervasives.fsi +**/Nullable.fsi +**/prim-types-prelude.fsi +**/prim-types.fsi +**/list.fsi +**/Query.fsi +**/resumable.fsi +**/async.fsi \ No newline at end of file From 2c40cda21f90e9a2e1f65639956885a73a6e1b88 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 5 Nov 2021 23:03:58 +0000 Subject: [PATCH 04/15] fix ignores --- src/fsharp/.fantomasignore | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index c721ad89031..5b4111a87e7 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -9,13 +9,16 @@ lib.fsi CompilerDiagnostics.fsi CompilerOptions.fsi -# absil +# absil (to investigate) **/ilread.fsi -# utils +# utils (to investigate) **/prim-parsing.fsi +**/TaggedCollections.fsi +# https://github.com/fsprojects/fantomas/issues/1954 +**/FileSystem.fsi -# service +# service (to investigate) **/ServiceDeclarationLists.fsi # FSharp.Core (to investigate) From 06a9dbb049df692f42001557114af73dbd125483 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 20 Nov 2021 12:33:27 +0000 Subject: [PATCH 05/15] update fantomasignore --- src/fsharp/.fantomasignore | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index 5b4111a87e7..23624d84b63 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -1,13 +1,5 @@ *.fs *.fsx -# https://github.com/fsprojects/fantomas/issues/1953 -PrettyNaming.fsi -ErrorLogger.fsi -lib.fsi - -# https://github.com/fsprojects/fantomas/issues/1954 -CompilerDiagnostics.fsi -CompilerOptions.fsi # absil (to investigate) **/ilread.fsi @@ -15,8 +7,6 @@ CompilerOptions.fsi # utils (to investigate) **/prim-parsing.fsi **/TaggedCollections.fsi -# https://github.com/fsprojects/fantomas/issues/1954 -**/FileSystem.fsi # service (to investigate) **/ServiceDeclarationLists.fsi From e073f8dd7ab15d4af99a95cb48bd6b3c9b70b561 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 20 Nov 2021 12:39:35 +0000 Subject: [PATCH 06/15] prefix before formatting --- src/fsharp/ExtensionTyping.fs | 2 +- src/fsharp/ExtensionTyping.fsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsharp/ExtensionTyping.fs b/src/fsharp/ExtensionTyping.fs index ac8cae4f8b7..8de32ca63e2 100644 --- a/src/fsharp/ExtensionTyping.fs +++ b/src/fsharp/ExtensionTyping.fs @@ -1160,7 +1160,7 @@ module internal ExtensionTyping = | Some ilTypeRef -> ilTypeRef | None -> GetOriginalILTypeRefOfProvidedType (st, range) - type ProviderGeneratedType = ProviderGeneratedType of (*ilOrigTyRef*)ILTypeRef * (*ilRenamedTyRef*)ILTypeRef * ProviderGeneratedType list + type ProviderGeneratedType = ProviderGeneratedType of ilOrigTyRef: ILTypeRef * ilRenamedTyRef: ILTypeRef * ProviderGeneratedType list /// 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. diff --git a/src/fsharp/ExtensionTyping.fsi b/src/fsharp/ExtensionTyping.fsi index b6d80891437..94f2691e1f3 100755 --- a/src/fsharp/ExtensionTyping.fsi +++ b/src/fsharp/ExtensionTyping.fsi @@ -322,7 +322,7 @@ module internal ExtensionTyping = /// Represents the remapping information for a generated provided type and its nested types. /// /// There is one overall tree for each root 'type X = ... type generation expr...' specification. - type ProviderGeneratedType = ProviderGeneratedType of (*ilOrigTyRef*)ILTypeRef * (*ilRenamedTyRef*)ILTypeRef * ProviderGeneratedType list + type ProviderGeneratedType = ProviderGeneratedType of ilOrigTyRef: ILTypeRef * ilRenamedTyRef: ILTypeRef * ProviderGeneratedType list /// 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. From 1944274fb6b437b30156415612d117f5f3db12b1 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 20 Nov 2021 12:46:16 +0000 Subject: [PATCH 07/15] prefix before formatting --- src/fsharp/.fantomasignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index 23624d84b63..79361d670e0 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -8,6 +8,9 @@ **/prim-parsing.fsi **/TaggedCollections.fsi +# https://github.com/fsprojects/fantomas/issues/1974 +**/ParseHalpers.fsi + # service (to investigate) **/ServiceDeclarationLists.fsi From 8f53151eaf1c6070f330a8c08a4701a0f8abb00c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 20 Nov 2021 13:10:23 +0000 Subject: [PATCH 08/15] bump fantomas version --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 981fafc4d56..68a5406e166 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas-tool": { - "version": "4.6.0-alpha-007", + "version": "4.6.0-alpha-008", "commands": [ "fantomas" ] From 531b82f7efab00ced46894712bb64b59b4954601 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 12:56:11 +1000 Subject: [PATCH 09/15] update tool --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3408796583c..49fb969ada9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "fantomas-tool": { - "version": "4.6.0-alpha-008", + "version": "4.7.5", "commands": [ "fantomas" ] From cd56e17cc977138779b3bec3387b560007558ef3 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 13:05:19 +1000 Subject: [PATCH 10/15] update tool --- .config/dotnet-tools.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 49fb969ada9..ed7d4fe63d6 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -10,3 +10,4 @@ } } } + From 1e217a355c4e29d98415c138684a65b51610e781 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 13:11:21 +1000 Subject: [PATCH 11/15] update tool --- src/fsharp/.fantomasignore | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fsharp/.fantomasignore b/src/fsharp/.fantomasignore index 79361d670e0..4529fd138bd 100644 --- a/src/fsharp/.fantomasignore +++ b/src/fsharp/.fantomasignore @@ -1,9 +1,12 @@ -*.fs -*.fsx +**/*.fs +**/*.fsx # absil (to investigate) **/ilread.fsi +# fsharp (to investigate) +**/range.fsi + # utils (to investigate) **/prim-parsing.fsi **/TaggedCollections.fsi @@ -22,4 +25,4 @@ **/list.fsi **/Query.fsi **/resumable.fsi -**/async.fsi \ No newline at end of file +**/async.fsi From 8f9b90f4319a86496d955a13aa2b8b2ad6b889e0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 13:12:41 +1000 Subject: [PATCH 12/15] update tool --- src/fsharp/.fantomasignore => .fantomasignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/fsharp/.fantomasignore => .fantomasignore (100%) diff --git a/src/fsharp/.fantomasignore b/.fantomasignore similarity index 100% rename from src/fsharp/.fantomasignore rename to .fantomasignore From 5694db4dab517010282038a5cedb127755330a07 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 13:32:52 +1000 Subject: [PATCH 13/15] add job --- azure-pipelines.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b9b221178c9..051da629c35 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -264,6 +264,32 @@ stages: - pwsh: .\eng\MockBuild.ps1 displayName: Build with OfficialBuildId + # Check code formatting + - job: CheckCodeFormatting + pool: + vmImage: $(UbuntuMachineQueueName) + steps: + - checkout: self + clean: true + - script: dotnet --list-sdks + displayName: Report dotnet SDK versions + - task: UseDotNet@2 + displayName: install SDK + inputs: + packageType: sdk + useGlobalJson: true + includePreviewVersions: true + workingDirectory: $(Build.SourcesDirectory) + installationPath: $(Agent.ToolsDirectory)/dotnet + - script: dotnet tool install + env: + DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 + displayName: Install tools + - script: dotnet fantomas src\fsharp --check + env: + DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 + displayName: Check code formatting (run dotnet fantomas src\fsharp to fix) + # Linux - job: Linux pool: From 5c091ba8f90110fa873838be2672dd36b579490a Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 20 Apr 2022 13:37:21 +1000 Subject: [PATCH 14/15] add job --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 051da629c35..b7ef711a6d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -281,7 +281,7 @@ stages: includePreviewVersions: true workingDirectory: $(Build.SourcesDirectory) installationPath: $(Agent.ToolsDirectory)/dotnet - - script: dotnet tool install + - script: dotnet tool restore env: DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1 displayName: Install tools From 1f8a7ce50caed6ac6ff813a92fec3b15cd16b205 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 2 May 2022 16:40:08 +0100 Subject: [PATCH 15/15] apply formatting --- src/fsharp/AccessibilityLogic.fsi | 78 +- src/fsharp/AttributeChecking.fsi | 82 +- src/fsharp/AugmentWithHashCompare.fsi | 5 +- src/fsharp/BinaryResourceFormats.fsi | 18 +- src/fsharp/BuildGraph.fsi | 32 +- src/fsharp/CheckComputationExpressions.fsi | 27 +- src/fsharp/CheckDeclarations.fsi | 49 +- src/fsharp/CheckExpressions.fsi | 714 ++++++++++----- src/fsharp/CheckFormatStrings.fsi | 33 +- src/fsharp/CompilerConfig.fsi | 113 +-- src/fsharp/CompilerDiagnostics.fsi | 36 +- src/fsharp/CompilerGlobalState.fsi | 10 +- src/fsharp/CompilerImports.fsi | 120 +-- src/fsharp/CompilerOptions.fsi | 21 +- src/fsharp/ConstraintSolver.fsi | 182 ++-- src/fsharp/CreateILModule.fsi | 28 +- src/fsharp/DetupleArgs.fsi | 32 +- src/fsharp/Diagnostics.fsi | 5 +- src/fsharp/ErrorLogger.fsi | 247 +++--- src/fsharp/ErrorResolutionHints.fsi | 8 +- src/fsharp/ExtensionTyping.fsi | 248 +++--- src/fsharp/FindUnsolved.fsi | 7 +- src/fsharp/IlxGen.fsi | 34 +- src/fsharp/InfoReader.fsi | 267 ++++-- src/fsharp/InnerLambdasToTopLevelFuncs.fsi | 6 +- src/fsharp/InternalCollections.fsi | 74 +- src/fsharp/LegacyMSBuildReferenceResolver.fsi | 2 +- src/fsharp/LexFilter.fsi | 11 +- src/fsharp/Logger.fsi | 16 +- src/fsharp/LowerCallsAndSeqs.fsi | 9 +- src/fsharp/LowerStateMachines.fsi | 22 +- src/fsharp/MethodCalls.fsi | 414 +++++---- src/fsharp/MethodOverrides.fsi | 126 ++- src/fsharp/NameResolution.fsi | 468 ++++++---- src/fsharp/NicePrint.fsi | 136 +-- src/fsharp/OptimizeInputs.fsi | 29 +- src/fsharp/Optimizer.fsi | 85 +- src/fsharp/ParseAndCheckInputs.fsi | 94 +- src/fsharp/ParseHelpers.fsi | 77 +- src/fsharp/PatternMatchCompilation.fsi | 56 +- src/fsharp/PostInferenceChecks.fsi | 9 +- src/fsharp/PrettyNaming.fsi | 98 +-- src/fsharp/QueueList.fsi | 38 +- src/fsharp/QuotationPickler.fsi | 169 ++-- src/fsharp/QuotationTranslator.fsi | 38 +- src/fsharp/ReferenceResolver.fsi | 47 +- src/fsharp/ScriptClosure.fsi | 71 +- src/fsharp/SignatureConformance.fsi | 43 +- .../SimulatedMSBuildReferenceResolver.fsi | 1 - src/fsharp/StaticLinking.fsi | 4 +- src/fsharp/SyntaxTree.fsi | 811 +++++------------- src/fsharp/SyntaxTreeOps.fsi | 222 +++-- src/fsharp/SyntaxTrivia.fsi | 229 ++--- src/fsharp/TextLayoutRender.fsi | 21 +- src/fsharp/TypeRelations.fsi | 61 +- src/fsharp/TypedTreeBasics.fsi | 164 ++-- src/fsharp/TypedTreeOps.fsi | 548 ++++++------ src/fsharp/TypedTreePickle.fsi | 89 +- src/fsharp/UnicodeLexing.fsi | 3 +- src/fsharp/XmlAdapters.fsi | 6 +- src/fsharp/XmlDoc.fsi | 26 +- src/fsharp/XmlDocFileWriter.fsi | 4 +- src/fsharp/autobox.fsi | 4 +- src/fsharp/block.fsi | 44 +- src/fsharp/fsc.fsi | 71 +- src/fsharp/fsiaux.fsi | 121 ++- src/fsharp/import.fsi | 62 +- src/fsharp/infos.fsi | 383 ++++++--- src/fsharp/lexhelp.fsi | 22 +- src/fsharp/lib.fsi | 206 ++--- src/fsharp/rational.fsi | 27 +- src/fsharp/sr.fsi | 18 +- src/fsharp/tainted.fsi | 65 +- 73 files changed, 4284 insertions(+), 3462 deletions(-) diff --git a/src/fsharp/AccessibilityLogic.fsi b/src/fsharp/AccessibilityLogic.fsi index 9a9511c2d4e..fb51c1a101f 100644 --- a/src/fsharp/AccessibilityLogic.fsi +++ b/src/fsharp/AccessibilityLogic.fsi @@ -3,8 +3,8 @@ /// The basic logic of private/internal/protected/InternalsVisibleTo/public accessibility module internal FSharp.Compiler.AccessibilityLogic -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler open FSharp.Compiler.Import open FSharp.Compiler.Infos open FSharp.Compiler.TcGlobals @@ -14,16 +14,16 @@ open FSharp.Compiler.TypedTree /// Represents the 'keys' a particular piece of code can use to access other constructs?. [] type AccessorDomain = - /// cpaths: indicates we have the keys to access any members private to the given paths - /// tyconRefOpt: indicates we have the keys to access any protected members of the super types of 'TyconRef' - | AccessibleFrom of cpaths: CompilationPath list * tyconRefOpt: TyconRef option + /// cpaths: indicates we have the keys to access any members private to the given paths + /// tyconRefOpt: indicates we have the keys to access any protected members of the super types of 'TyconRef' + | AccessibleFrom of cpaths: CompilationPath list * tyconRefOpt: TyconRef option /// An AccessorDomain which returns public items | AccessibleFromEverywhere /// An AccessorDomain which returns everything but .NET private/internal items. - /// This is used - /// - when solving member trait constraints, which are solved independently of accessibility + /// This is used + /// - when solving member trait constraints, which are solved independently of accessibility /// - for failure paths in error reporting, e.g. to produce an error that an F# item is not accessible /// - an adhoc use in service.fs to look up a delegate signature | AccessibleFromSomeFSharpCode @@ -33,68 +33,74 @@ type AccessorDomain = // Hashing and comparison is used for the memoization tables keyed by an accessor domain. // It is dependent on a TcGlobals because of the TyconRef in the data structure - static member CustomEquals: g:TcGlobals * ad1:AccessorDomain * ad2:AccessorDomain -> bool + static member CustomEquals: g: TcGlobals * ad1: AccessorDomain * ad2: AccessorDomain -> bool // Hashing and comparison is used for the memoization tables keyed by an accessor domain. // It is dependent on a TcGlobals because of the TyconRef in the data structure - static member CustomGetHashCode: ad:AccessorDomain -> int - -/// Indicates if an F# item is accessible -val IsAccessible: ad:AccessorDomain -> taccess:Accessibility -> bool + static member CustomGetHashCode: ad: AccessorDomain -> int + +/// Indicates if an F# item is accessible +val IsAccessible: ad: AccessorDomain -> taccess: Accessibility -> bool /// Indicates if an entity is accessible -val IsEntityAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> tcref:TyconRef -> bool +val IsEntityAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> tcref: TyconRef -> bool /// Check that an entity is accessible -val CheckTyconAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> tcref:TyconRef -> bool +val CheckTyconAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> tcref: TyconRef -> bool /// Indicates if a type definition and its representation contents are accessible -val IsTyconReprAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> tcref:TyconRef -> bool +val IsTyconReprAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> tcref: TyconRef -> bool /// Check that a type definition and its representation contents are accessible -val CheckTyconReprAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> tcref:TyconRef -> bool +val CheckTyconReprAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> tcref: TyconRef -> bool /// Indicates if a type is accessible (both definition and instantiation) -val IsTypeAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> ty:TType -> bool +val IsTypeAccessible: g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> ty: TType -> bool -val IsTypeInstAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> tinst:TypeInst -> bool +val IsTypeInstAccessible: g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> tinst: TypeInst -> bool /// Indicate if a provided member is accessible -val IsProvidedMemberAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> ty:TType -> access:ILMemberAccess -> bool +val IsProvidedMemberAccessible: + amap: ImportMap -> m: range -> ad: AccessorDomain -> ty: TType -> access: ILMemberAccess -> bool /// Compute the accessibility of a provided member -val ComputeILAccess: isPublic:bool -> isFamily:bool -> isFamilyOrAssembly:bool -> isFamilyAndAssembly:bool -> ILMemberAccess +val ComputeILAccess: + isPublic: bool -> isFamily: bool -> isFamilyOrAssembly: bool -> isFamilyAndAssembly: bool -> ILMemberAccess -val IsILFieldInfoAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> x:ILFieldInfo -> bool +val IsILFieldInfoAccessible: g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> x: ILFieldInfo -> bool -val GetILAccessOfILEventInfo: ILEventInfo -> ILMemberAccess +val GetILAccessOfILEventInfo: ILEventInfo -> ILMemberAccess -val IsILEventInfoAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> einfo:ILEventInfo -> bool +val IsILEventInfoAccessible: + g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> einfo: ILEventInfo -> bool val GetILAccessOfILPropInfo: ILPropInfo -> ILMemberAccess -val IsILPropInfoAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> pinfo:ILPropInfo -> bool +val IsILPropInfoAccessible: + g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> pinfo: ILPropInfo -> bool -val IsValAccessible: ad:AccessorDomain -> vref:ValRef -> bool +val IsValAccessible: ad: AccessorDomain -> vref: ValRef -> bool -val CheckValAccessible: m:range -> ad:AccessorDomain -> vref:ValRef -> unit +val CheckValAccessible: m: range -> ad: AccessorDomain -> vref: ValRef -> unit -val IsUnionCaseAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> ucref:TypedTree.UnionCaseRef -> bool +val IsUnionCaseAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> ucref: TypedTree.UnionCaseRef -> bool -val CheckUnionCaseAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> ucref:TypedTree.UnionCaseRef -> bool +val CheckUnionCaseAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> ucref: TypedTree.UnionCaseRef -> bool -val IsRecdFieldAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> rfref:TypedTree.RecdFieldRef -> bool +val IsRecdFieldAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> rfref: TypedTree.RecdFieldRef -> bool -val CheckRecdFieldAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> rfref:TypedTree.RecdFieldRef -> bool +val CheckRecdFieldAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> rfref: TypedTree.RecdFieldRef -> bool -val CheckRecdFieldInfoAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> rfinfo:RecdFieldInfo -> unit +val CheckRecdFieldInfoAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> rfinfo: RecdFieldInfo -> unit -val CheckILFieldInfoAccessible: g:TcGlobals -> amap:ImportMap -> m:range -> ad:AccessorDomain -> finfo:ILFieldInfo -> unit +val CheckILFieldInfoAccessible: + g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> finfo: ILFieldInfo -> unit -val IsTypeAndMethInfoAccessible: amap:ImportMap -> m:range -> accessDomainTy:AccessorDomain -> ad:AccessorDomain -> _arg1:MethInfo -> bool +val IsTypeAndMethInfoAccessible: + amap: ImportMap -> m: range -> accessDomainTy: AccessorDomain -> ad: AccessorDomain -> _arg1: MethInfo -> bool -val IsMethInfoAccessible: amap:ImportMap -> m:range -> ad:AccessorDomain -> minfo:MethInfo -> bool +val IsMethInfoAccessible: amap: ImportMap -> m: range -> ad: AccessorDomain -> minfo: MethInfo -> bool -val IsPropInfoAccessible: g:TcGlobals ->amap:ImportMap -> m:range -> ad:AccessorDomain -> _arg1:PropInfo -> bool +val IsPropInfoAccessible: g: TcGlobals -> amap: ImportMap -> m: range -> ad: AccessorDomain -> _arg1: PropInfo -> bool -val IsFieldInfoAccessible: ad:AccessorDomain -> rfref:RecdFieldInfo -> bool +val IsFieldInfoAccessible: ad: AccessorDomain -> rfref: RecdFieldInfo -> bool diff --git a/src/fsharp/AttributeChecking.fsi b/src/fsharp/AttributeChecking.fsi index 932cb3a5feb..5eb5a01aefe 100644 --- a/src/fsharp/AttributeChecking.fsi +++ b/src/fsharp/AttributeChecking.fsi @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -/// Logic associated with checking "ObsoleteAttribute" and other attributes +/// Logic associated with checking "ObsoleteAttribute" and other attributes /// on items from name resolution module internal FSharp.Compiler.AttributeChecking open System.Collections.Generic -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Infos open FSharp.Compiler.TcGlobals @@ -24,59 +24,79 @@ type AttribInfo = member NamedArguments: (TType * string * bool * obj) list member Range: range member TyconRef: TyconRef - -val AttribInfosOfIL: g:TcGlobals -> amap:Import.ImportMap -> scoref:ILScopeRef -> m:range -> attribs:ILAttributes -> AttribInfo list -val GetAttribInfosOfEntity: g:TcGlobals -> amap:Import.ImportMap -> m:range -> tcref:TyconRef -> AttribInfo list +val AttribInfosOfIL: + g: TcGlobals -> amap: Import.ImportMap -> scoref: ILScopeRef -> m: range -> attribs: ILAttributes -> AttribInfo list -val GetAttribInfosOfMethod: amap:Import.ImportMap -> m:range -> minfo:MethInfo -> AttribInfo list +val GetAttribInfosOfEntity: g: TcGlobals -> amap: Import.ImportMap -> m: range -> tcref: TyconRef -> AttribInfo list -val GetAttribInfosOfProp: amap:Import.ImportMap -> m:range -> pinfo:PropInfo -> AttribInfo list +val GetAttribInfosOfMethod: amap: Import.ImportMap -> m: range -> minfo: MethInfo -> AttribInfo list -val GetAttribInfosOfEvent: amap:Import.ImportMap -> m:range -> einfo:EventInfo -> AttribInfo list +val GetAttribInfosOfProp: amap: Import.ImportMap -> m: range -> pinfo: PropInfo -> AttribInfo list + +val GetAttribInfosOfEvent: amap: Import.ImportMap -> m: range -> einfo: EventInfo -> AttribInfo list #if NO_TYPEPROVIDERS -val TryBindMethInfoAttribute: g:TcGlobals -> m:range -> BuiltinAttribInfo -> minfo:MethInfo -> f1:(ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> f2:(Attrib -> 'a option) -> f3: _ -> 'a option +val TryBindMethInfoAttribute: + g: TcGlobals -> + m: range -> + BuiltinAttribInfo -> + minfo: MethInfo -> + f1: (ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> + f2: (Attrib -> 'a option) -> + f3: _ -> + 'a option #else -val TryBindMethInfoAttribute: g:TcGlobals -> m:range -> BuiltinAttribInfo -> minfo:MethInfo -> f1:(ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> f2:(Attrib -> 'a option) -> f3:(obj option list * (string * obj option) list -> 'a option) -> 'a option +val TryBindMethInfoAttribute: + g: TcGlobals -> + m: range -> + BuiltinAttribInfo -> + minfo: MethInfo -> + f1: (ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> + f2: (Attrib -> 'a option) -> + f3: (obj option list * (string * obj option) list -> 'a option) -> + 'a option #endif -val TryFindMethInfoStringAttribute: g:TcGlobals -> m:range -> attribSpec:BuiltinAttribInfo -> minfo:MethInfo -> string option +val TryFindMethInfoStringAttribute: + g: TcGlobals -> m: range -> attribSpec: BuiltinAttribInfo -> minfo: MethInfo -> string option -val MethInfoHasAttribute: g:TcGlobals -> m:range -> attribSpec:BuiltinAttribInfo -> minfo:MethInfo -> bool +val MethInfoHasAttribute: g: TcGlobals -> m: range -> attribSpec: BuiltinAttribInfo -> minfo: MethInfo -> bool -val CheckFSharpAttributes: g:TcGlobals -> attribs:Attrib list -> m:range -> OperationResult +val CheckFSharpAttributes: g: TcGlobals -> attribs: Attrib list -> m: range -> OperationResult -val CheckILAttributesForUnseen: g:TcGlobals -> cattrs:ILAttributes -> _m:'a -> bool +val CheckILAttributesForUnseen: g: TcGlobals -> cattrs: ILAttributes -> _m: 'a -> bool -val CheckFSharpAttributesForHidden: g:TcGlobals -> attribs:Attrib list -> bool +val CheckFSharpAttributesForHidden: g: TcGlobals -> attribs: Attrib list -> bool -val CheckFSharpAttributesForObsolete: g:TcGlobals -> attribs:Attrib list -> bool +val CheckFSharpAttributesForObsolete: g: TcGlobals -> attribs: Attrib list -> bool -val CheckFSharpAttributesForUnseen: g:TcGlobals -> attribs:Attrib list -> _m:'a -> bool +val CheckFSharpAttributesForUnseen: g: TcGlobals -> attribs: Attrib list -> _m: 'a -> bool -val CheckPropInfoAttributes: pinfo:PropInfo -> m:range -> OperationResult +val CheckPropInfoAttributes: pinfo: PropInfo -> m: range -> OperationResult -val CheckILFieldAttributes: g:TcGlobals -> finfo:ILFieldInfo -> m:range -> unit +val CheckILFieldAttributes: g: TcGlobals -> finfo: ILFieldInfo -> m: range -> unit -val CheckMethInfoAttributes: g:TcGlobals -> m:range -> tyargsOpt:'a option -> minfo:MethInfo -> OperationResult +val CheckMethInfoAttributes: + g: TcGlobals -> m: range -> tyargsOpt: 'a option -> minfo: MethInfo -> OperationResult -val MethInfoIsUnseen: g:TcGlobals -> m:range -> ty:TType -> minfo:MethInfo -> bool +val MethInfoIsUnseen: g: TcGlobals -> m: range -> ty: TType -> minfo: MethInfo -> bool -val PropInfoIsUnseen: m:'a -> pinfo:PropInfo -> bool +val PropInfoIsUnseen: m: 'a -> pinfo: PropInfo -> bool -val CheckEntityAttributes: g:TcGlobals -> x:TyconRef -> m:range -> OperationResult +val CheckEntityAttributes: g: TcGlobals -> x: TyconRef -> m: range -> OperationResult -val CheckUnionCaseAttributes: g:TcGlobals -> x:UnionCaseRef -> m:range -> OperationResult +val CheckUnionCaseAttributes: g: TcGlobals -> x: UnionCaseRef -> m: range -> OperationResult -val CheckRecdFieldAttributes: g:TcGlobals -> x:RecdFieldRef -> m:range -> OperationResult +val CheckRecdFieldAttributes: g: TcGlobals -> x: RecdFieldRef -> m: range -> OperationResult -val CheckValAttributes: g:TcGlobals -> x:ValRef -> m:range -> OperationResult +val CheckValAttributes: g: TcGlobals -> x: ValRef -> m: range -> OperationResult -val CheckRecdFieldInfoAttributes: g:TcGlobals -> x:RecdFieldInfo -> m:range -> OperationResult +val CheckRecdFieldInfoAttributes: g: TcGlobals -> x: RecdFieldInfo -> m: range -> OperationResult -val IsSecurityAttribute: g:TcGlobals -> amap:Import.ImportMap -> casmap:Dictionary -> Attrib -> m:range -> bool +val IsSecurityAttribute: + g: TcGlobals -> amap: Import.ImportMap -> casmap: Dictionary -> Attrib -> m: range -> bool -val IsSecurityCriticalAttribute: g:TcGlobals -> Attrib -> bool +val IsSecurityCriticalAttribute: g: TcGlobals -> Attrib -> bool -val IsAssemblyVersionAttribute: g:TcGlobals -> Attrib -> bool +val IsAssemblyVersionAttribute: g: TcGlobals -> Attrib -> bool diff --git a/src/fsharp/AugmentWithHashCompare.fsi b/src/fsharp/AugmentWithHashCompare.fsi index 4e3acc47ab7..ea991b0340d 100644 --- a/src/fsharp/AugmentWithHashCompare.fsi +++ b/src/fsharp/AugmentWithHashCompare.fsi @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. /// Generate the hash/compare functions we add to user-defined types by default. -module internal FSharp.Compiler.AugmentWithHashCompare +module internal FSharp.Compiler.AugmentWithHashCompare -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals @@ -34,4 +34,3 @@ val MakeBindingsForEqualityWithComparerAugmentation: TcGlobals -> Tycon -> Bindi /// This predicate can be used once type inference is complete, before then it is an approximation /// that doesn't assert any new constraints val TypeDefinitelyHasEquality: TcGlobals -> TType -> bool - diff --git a/src/fsharp/BinaryResourceFormats.fsi b/src/fsharp/BinaryResourceFormats.fsi index 2efe5ff8221..a723f005e9d 100644 --- a/src/fsharp/BinaryResourceFormats.fsi +++ b/src/fsharp/BinaryResourceFormats.fsi @@ -1,21 +1,21 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.BinaryResourceFormats +module internal FSharp.Compiler.BinaryResourceFormats open FSharp.Compiler.AbstractIL.IL -module VersionResourceFormat = +module VersionResourceFormat = - val VS_VERSION_INFO_RESOURCE: + val VS_VERSION_INFO_RESOURCE: (ILVersionInfo * ILVersionInfo * int32 * int32 * int32 * int32 * int32 * int64) * seq> * - seq - -> byte[] - + seq -> + byte [] + module ManifestResourceFormat = - - val VS_MANIFEST_RESOURCE : data: byte[] * isLibrary: bool -> byte[] + + val VS_MANIFEST_RESOURCE: data: byte [] * isLibrary: bool -> byte [] module ResFileFormat = - val ResFileHeader: unit -> byte[] + val ResFileHeader: unit -> byte [] diff --git a/src/fsharp/BuildGraph.fsi b/src/fsharp/BuildGraph.fsi index 39a5093a0fc..1a475c97225 100644 --- a/src/fsharp/BuildGraph.fsi +++ b/src/fsharp/BuildGraph.fsi @@ -13,7 +13,7 @@ open Internal.Utilities.Library /// This is essentially cancellable async code where the only asynchronous waits are on nodes. /// When a node is evaluated the evaluation is run synchronously on the thread of the /// first requestor. -[] +[] type NodeCode<'T> type Async<'T> with @@ -25,33 +25,33 @@ type Async<'T> with [] type NodeCodeBuilder = - member Bind : NodeCode<'T> * ('T -> NodeCode<'U>) -> NodeCode<'U> + member Bind: NodeCode<'T> * ('T -> NodeCode<'U>) -> NodeCode<'U> - member Zero : unit -> NodeCode + member Zero: unit -> NodeCode - member Delay : (unit -> NodeCode<'T>) -> NodeCode<'T> + member Delay: (unit -> NodeCode<'T>) -> NodeCode<'T> - member Return : 'T -> NodeCode<'T> + member Return: 'T -> NodeCode<'T> - member ReturnFrom : NodeCode<'T> -> NodeCode<'T> + member ReturnFrom: NodeCode<'T> -> NodeCode<'T> - member TryWith : NodeCode<'T> * (exn -> NodeCode<'T>) -> NodeCode<'T> + member TryWith: NodeCode<'T> * (exn -> NodeCode<'T>) -> NodeCode<'T> - member TryFinally : NodeCode<'T> * (unit -> unit) -> NodeCode<'T> + member TryFinally: NodeCode<'T> * (unit -> unit) -> NodeCode<'T> - member For : xs: 'T seq * binder: ('T -> NodeCode) -> NodeCode + member For: xs: 'T seq * binder: ('T -> NodeCode) -> NodeCode - member Combine : x1: NodeCode * x2: NodeCode<'T> -> NodeCode<'T> + member Combine: x1: NodeCode * x2: NodeCode<'T> -> NodeCode<'T> /// A limited form 'use' for establishing the compilation globals. (Note /// that a proper generic 'use' could be implemented but has not currently been necessary) - member Using : CompilationGlobalsScope * (CompilationGlobalsScope -> NodeCode<'T>) -> NodeCode<'T> + member Using: CompilationGlobalsScope * (CompilationGlobalsScope -> NodeCode<'T>) -> NodeCode<'T> /// Specifies code that can be run as part of the build graph. -val node : NodeCodeBuilder +val node: NodeCodeBuilder /// Contains helpers to specify code that can be run as part of the build graph. -[] +[] type NodeCode = /// Only used for testing, do not use @@ -85,7 +85,7 @@ module internal GraphNode = /// Evaluate the computation, allowing asynchronous waits on existing ongoing evaluations of the /// same node, and strongly cache the result. /// -/// Once the result has been cached, the computation function will also be removed, or 'null'ed out, +/// Once the result has been cached, the computation function will also be removed, or 'null'ed out, /// as to prevent any references captured by the computation from being strongly held. [] type internal GraphNode<'T> = @@ -95,7 +95,7 @@ type internal GraphNode<'T> = new: retryCompute: bool * computation: NodeCode<'T> -> GraphNode<'T> /// By default, 'retryCompute' is 'true'. - new : computation: NodeCode<'T> -> GraphNode<'T> + new: computation: NodeCode<'T> -> GraphNode<'T> /// Return NodeCode which, when executed, will get the value of the computation if already computed, or /// await an existing in-progress computation for the node if one exists, or else will synchronously @@ -110,4 +110,4 @@ type internal GraphNode<'T> = member HasValue: bool /// Return 'true' if the computation is in-progress. - member IsComputing: bool \ No newline at end of file + member IsComputing: bool diff --git a/src/fsharp/CheckComputationExpressions.fsi b/src/fsharp/CheckComputationExpressions.fsi index 451b5b4bfc2..945307233e4 100644 --- a/src/fsharp/CheckComputationExpressions.fsi +++ b/src/fsharp/CheckComputationExpressions.fsi @@ -8,9 +8,28 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -val TcSequenceExpressionEntry: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> hasBuilder:bool * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv +val TcSequenceExpressionEntry: + cenv: TcFileState -> + env: TcEnv -> + overallTy: OverallTy -> + tpenv: UnscopedTyparEnv -> + hasBuilder: bool * comp: SynExpr -> + m: range -> + Expr * UnscopedTyparEnv -val TcArrayOrListComputedExpression: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> isArray:bool * comp:SynExpr -> m:range -> Expr * UnscopedTyparEnv - -val TcComputationExpression: cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> mWhole:range * interpExpr:Expr * builderTy:TType * comp:SynExpr -> Expr * UnscopedTyparEnv +val TcArrayOrListComputedExpression: + cenv: TcFileState -> + env: TcEnv -> + overallTy: OverallTy -> + tpenv: UnscopedTyparEnv -> + isArray: bool * comp: SynExpr -> + m: range -> + Expr * UnscopedTyparEnv +val TcComputationExpression: + cenv: TcFileState -> + env: TcEnv -> + overallTy: OverallTy -> + tpenv: UnscopedTyparEnv -> + mWhole: range * interpExpr: Expr * builderTy: TType * comp: SynExpr -> + Expr * UnscopedTyparEnv diff --git a/src/fsharp/CheckDeclarations.fsi b/src/fsharp/CheckDeclarations.fsi index 6dc27155926..4d31b04abdf 100644 --- a/src/fsharp/CheckDeclarations.fsi +++ b/src/fsharp/CheckDeclarations.fsi @@ -12,15 +12,12 @@ open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -val AddLocalRootModuleOrNamespace : TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> ModuleOrNamespaceType -> TcEnv +val AddLocalRootModuleOrNamespace: + TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> ModuleOrNamespaceType -> TcEnv val CreateInitialTcEnv: - TcGlobals * - ImportMap * - range * - assemblyName: string * - (CcuThunk * string list * string list) list - -> OpenDeclaration list * TcEnv + TcGlobals * ImportMap * range * assemblyName: string * (CcuThunk * string list * string list) list -> + OpenDeclaration list * TcEnv val AddCcuToTcEnv: TcGlobals * @@ -30,25 +27,26 @@ val AddCcuToTcEnv: assemblyName: string * ccu: CcuThunk * autoOpens: string list * - internalsVisibleToAttributes: string list - -> OpenDeclaration list * TcEnv + internalsVisibleToAttributes: string list -> + OpenDeclaration list * TcEnv type TopAttribs = { mainMethodAttrs: Attribs netModuleAttrs: Attribs - assemblyAttrs: Attribs } + assemblyAttrs: Attribs } type ConditionalDefines = string list -val EmptyTopAttrs : TopAttribs +val EmptyTopAttrs: TopAttribs -val CombineTopAttrs : TopAttribs -> TopAttribs -> TopAttribs +val CombineTopAttrs: TopAttribs -> TopAttribs -> TopAttribs -val TcOpenModuleOrNamespaceDecl: TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> LongIdent * range -> TcEnv * OpenDeclaration list +val TcOpenModuleOrNamespaceDecl: + TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> LongIdent * range -> TcEnv * OpenDeclaration list val AddLocalSubModule: g: TcGlobals -> amap: ImportMap -> m: range -> env: TcEnv -> modul: ModuleOrNamespace -> TcEnv -val CheckOneImplFile: +val CheckOneImplFile: TcGlobals * NiceNameGenerator * ImportMap * @@ -57,17 +55,24 @@ val CheckOneImplFile: (unit -> bool) * ConditionalDefines option * TcResultsSink * - bool * + bool * TcEnv * ModuleOrNamespaceType option * - ParsedImplFileInput - -> Cancellable + ParsedImplFileInput -> + Cancellable -val CheckOneSigFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines option * TcResultsSink * bool - -> TcEnv - -> ParsedSigFileInput - -> Cancellable +val CheckOneSigFile: + TcGlobals * + NiceNameGenerator * + ImportMap * + CcuThunk * + (unit -> bool) * + ConditionalDefines option * + TcResultsSink * + bool -> + TcEnv -> + ParsedSigFileInput -> + Cancellable exception ParameterlessStructCtor of range diff --git a/src/fsharp/CheckExpressions.fsi b/src/fsharp/CheckExpressions.fsi index 5a997fa6e5c..d4b753ed8ba 100644 --- a/src/fsharp/CheckExpressions.fsi +++ b/src/fsharp/CheckExpressions.fsi @@ -6,7 +6,7 @@ open System open System.Collections.Generic open Internal.Utilities.Collections open Internal.Utilities.Library -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.CompilerGlobalState @@ -32,9 +32,9 @@ open FSharp.Compiler.ExtensionTyping /// Represents information about the initialization field used to check that object constructors /// have completed before fields are accessed. -type SafeInitData = +type SafeInitData = | SafeInitField of RecdFieldRef * RecdField - | NoSafeInitInfo + | NoSafeInitInfo /// Represents information about object constructors [] @@ -53,50 +53,50 @@ type UngeneralizableItem /// and other information about the scope. [] type TcEnv = - { /// Name resolution information - eNameResEnv: NameResolutionEnv + { /// Name resolution information + eNameResEnv: NameResolutionEnv - /// The list of items in the environment that may contain free inference - /// variables (which may not be generalized). The relevant types may - /// change as a result of inference equations being asserted, hence may need to - /// be recomputed. + /// The list of items in the environment that may contain free inference + /// variables (which may not be generalized). The relevant types may + /// change as a result of inference equations being asserted, hence may need to + /// be recomputed. eUngeneralizableItems: UngeneralizableItem list - - // Two (!) versions of the current module path - // These are used to: - // - Look up the appropriate point in the corresponding signature - // see if an item is public or not - // - Change fslib canonical module type to allow compiler references to these items - // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary - // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. - // This information is used mainly when building non-local references - // to public items. - // - // Of the two, 'ePath' is the one that's barely used. It's only + + // Two (!) versions of the current module path + // These are used to: + // - Look up the appropriate point in the corresponding signature + // see if an item is public or not + // - Change fslib canonical module type to allow compiler references to these items + // - Record the cpath for concrete modul_specs, tycon_specs and excon_specs so they can cache their generated IL representation where necessary + // - Record the pubpath of public, concrete {val, tycon, modul, excon}_specs. + // This information is used mainly when building non-local references + // to public items. + // + // Of the two, 'ePath' is the one that's barely used. It's only // used by UpdateAccModuleOrNamespaceType to modify the CCU while compiling FSharp.Core - ePath: Ident list + ePath: Ident list - eCompPath: CompilationPath + eCompPath: CompilationPath - eAccessPath: CompilationPath + eAccessPath: CompilationPath /// This field is computed from other fields, but we amortize the cost of computing it. - eAccessRights: AccessorDomain + eAccessRights: AccessorDomain /// Internals under these should be accessible - eInternalsVisibleCompPaths: CompilationPath list + eInternalsVisibleCompPaths: CompilationPath list - /// Mutable accumulator for the current module type + /// Mutable accumulator for the current module type eModuleOrNamespaceTypeAccumulator: ModuleOrNamespaceType ref /// Context information for type checker - eContextInfo: ContextInfo + eContextInfo: ContextInfo - /// Here Some tcref indicates we can access protected members in all super types - eFamilyType: TyconRef option + /// Here Some tcref indicates we can access protected members in all super types + eFamilyType: TyconRef option - // Information to enforce special restrictions on valid expressions - // for .NET constructors. + // Information to enforce special restrictions on valid expressions + // for .NET constructors. eCtorInfo: CtorInfo option eCallerMemberName: string option @@ -104,17 +104,16 @@ type TcEnv = // Active arg infos in iterated lambdas , allowing us to determine the attributes of arguments eLambdaArgInfos: ArgReprInfo list list - eIsControlFlow: bool - } + eIsControlFlow: bool } - member DisplayEnv : DisplayEnv - member NameEnv : NameResolutionEnv - member AccessRights : AccessorDomain + member DisplayEnv: DisplayEnv + member NameEnv: NameResolutionEnv + member AccessRights: AccessorDomain //------------------------------------------------------------------------- -// Some of the exceptions arising from type checking. These should be moved to +// Some of the exceptions arising from type checking. These should be moved to // use ErrorLogger. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- exception BakedInMemberConstraintName of string * range exception FunctionExpected of DisplayEnv * TType * range @@ -160,30 +159,31 @@ exception OverrideInIntrinsicAugmentation of range exception OverrideInExtrinsicAugmentation of range exception NonUniqueInferredAbstractSlot of TcGlobals * DisplayEnv * string * MethInfo * MethInfo * range exception StandardOperatorRedefinitionWarning of string * range -exception InvalidInternalsVisibleToAssemblyName of (*badName*)string * (*fileName option*) string option +exception InvalidInternalsVisibleToAssemblyName of string (*fileName option*) * string option (*badName*) -val TcFieldInit : range -> ILFieldInit -> Const +val TcFieldInit: range -> ILFieldInit -> Const -val LightweightTcValForUsingInBuildMethodCall : g : TcGlobals -> vref:ValRef -> vrefFlags : ValUseFlag -> vrefTypeInst : TTypes -> m : range -> Expr * TType +val LightweightTcValForUsingInBuildMethodCall: + g: TcGlobals -> vref: ValRef -> vrefFlags: ValUseFlag -> vrefTypeInst: TTypes -> m: range -> Expr * TType //------------------------------------------------------------------------- // The rest are all helpers needed for declaration checking (CheckDeclarations.fs) -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- /// Represents the current environment of type variables that have implicit scope /// (i.e. are without explicit declaration). type UnscopedTyparEnv -/// Represents the compilation environment for typechecking a single file in an assembly. +/// Represents the compilation environment for typechecking a single file in an assembly. [] -type TcFileState = +type TcFileState = { g: TcGlobals - /// Push an entry every time a recursive value binding is used, - /// in order to be able to fix up recursive type applications as - /// we infer type parameters + /// Push an entry every time a recursive value binding is used, + /// in order to be able to fix up recursive type applications as + /// we infer type parameters mutable recUses: ValMultiMap - + /// Guard against depth of expression nesting, by moving to new stack when a maximum depth is reached stackGuard: StackGuard @@ -191,24 +191,24 @@ type TcFileState = mutable createsGeneratedProvidedTypes: bool /// Are we in a script? if so relax the reporting of discarded-expression warnings at the top level - isScript: bool + isScript: bool - /// Environment needed to convert IL types to F# types in the importer. - amap: ImportMap + /// Environment needed to convert IL types to F# types in the importer. + amap: ImportMap /// Used to generate new syntactic argument names in post-parse syntactic processing synArgNameGenerator: SynArgNameGenerator tcSink: TcResultsSink - /// Holds a reference to the component being compiled. - /// This field is very rarely used (mainly when fixing up forward references to fslib. - topCcu: CcuThunk - - /// Holds the current inference constraints + /// Holds a reference to the component being compiled. + /// This field is very rarely used (mainly when fixing up forward references to fslib. + topCcu: CcuThunk + + /// Holds the current inference constraints css: ConstraintSolverState - - /// Are we compiling the signature of a module from fslib? + + /// Are we compiling the signature of a module from fslib? compilingCanonicalFslibModuleType: bool /// Is this a .fsi file? @@ -216,7 +216,7 @@ type TcFileState = /// Does this .fs file have a .fsi file? haveSig: bool - + /// Used to generate names niceNameGen: NiceNameGenerator @@ -225,24 +225,40 @@ type TcFileState = /// Used to resolve names nameResolver: NameResolver - + /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. conditionalDefines: string list option - + namedDebugPointsForInlinedCode: Dictionary isInternalTestSpanStackReferring: bool - // forward call - TcSequenceExpressionEntry: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv - - // forward call - TcArrayOrListComputedExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv - - // forward call - TcComputationExpression: TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv - } - static member Create: + // forward call + TcSequenceExpressionEntry: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> bool * SynExpr + -> range + -> Expr * UnscopedTyparEnv + + // forward call + TcArrayOrListComputedExpression: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> bool * SynExpr + -> range + -> Expr * UnscopedTyparEnv + + // forward call + TcComputationExpression: TcFileState + -> TcEnv + -> OverallTy + -> UnscopedTyparEnv + -> range * Expr * TType * SynExpr + -> Expr * UnscopedTyparEnv } + static member Create: g: TcGlobals * isScript: bool * niceNameGen: NiceNameGenerator * @@ -250,20 +266,17 @@ type TcFileState = topCcu: CcuThunk * isSig: bool * haveSig: bool * - conditionalDefines: string list option * + conditionalDefines: string list option * tcSink: TcResultsSink * tcVal: TcValF * isInternalTestSpanStackReferring: bool * - // forward call to CheckComputationExpressions.fs tcSequenceExpressionEntry: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * - // forward call to CheckComputationExpressions.fs tcArrayOrListSequenceExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> bool * SynExpr -> range -> Expr * UnscopedTyparEnv) * - // forward call to CheckComputationExpressions.fs - tcComputationExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv) - -> TcFileState + tcComputationExpression: (TcFileState -> TcEnv -> OverallTy -> UnscopedTyparEnv -> range * Expr * TType * SynExpr -> Expr * UnscopedTyparEnv) -> + TcFileState /// Represents information about the module or type in which a member or value is declared. -type MemberOrValContainerInfo = +type MemberOrValContainerInfo = | MemberOrValContainerInfo of tcref: TyconRef * optIntfSlotTy: (TType * SlotImplSet) option * @@ -272,35 +285,33 @@ type MemberOrValContainerInfo = declaredTyconTypars: Typars /// Provides information about the context for a value or member definition. -type ContainerInfo = - | ContainerInfo of - ParentRef * - MemberOrValContainerInfo option - member ParentRef : ParentRef +type ContainerInfo = + | ContainerInfo of ParentRef * MemberOrValContainerInfo option + member ParentRef: ParentRef val ExprContainerInfo: ContainerInfo /// Indicates if member declarations are allowed to be abstract members. -type NewSlotsOK = - | NewSlotsOK +type NewSlotsOK = + | NewSlotsOK | NoNewSlots /// Indicates if member declarations are allowed to be override members. -type OverridesOK = - | OverridesOK +type OverridesOK = + | OverridesOK | WarnOnOverrides | ErrorOnOverrides /// A flag to represent the sort of bindings are we processing. -type DeclKind = +type DeclKind = /// A binding in a module, or a member - | ModuleOrMemberBinding + | ModuleOrMemberBinding /// Extensions to a type within the same assembly - | IntrinsicExtensionBinding + | IntrinsicExtensionBinding /// Extensions to a type in a different assembly - | ExtrinsicExtensionBinding + | ExtrinsicExtensionBinding /// A binding in a class | ClassLetBinding of isStatic: bool @@ -309,7 +320,7 @@ type DeclKind = | ObjectExpressionOverrideBinding /// A binding in an expression - | ExpressionBinding + | ExpressionBinding static member IsModuleOrMemberOrExtensionBinding: DeclKind -> bool @@ -325,48 +336,41 @@ type DeclKind = // Note: now always true static member CanGeneralizeConstrainedTypars: DeclKind -> bool - + static member ConvertToLinearBindings: DeclKind -> bool static member CanOverrideOrImplement: DeclKind -> OverridesOK /// Indicates whether a syntactic type is allowed to include new type variables /// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` -type ImplicitlyBoundTyparsAllowed = - | NewTyparsOKButWarnIfNotRigid - | NewTyparsOK +type ImplicitlyBoundTyparsAllowed = + | NewTyparsOKButWarnIfNotRigid + | NewTyparsOK | NoNewTypars /// Indicates whether constraints should be checked when checking syntactic types -type CheckConstraints = - | CheckCxs +type CheckConstraints = + | CheckCxs | NoCheckCxs /// Indicates if a member binding is an object expression binding -type IsObjExprBinding = - | ObjExprBinding +type IsObjExprBinding = + | ObjExprBinding | ValOrMemberBinding /// Represents the initial information about a recursive binding type RecDefnBindingInfo = - | RecDefnBindingInfo of + | RecDefnBindingInfo of containerInfo: ContainerInfo * newslotsOk: NewSlotsOK * declKind: DeclKind * synBinding: SynBinding -/// Represents the ValReprInfo for a value, before the typars are fully inferred -type PartialValReprInfo = - | PartialValReprInfo of - curriedArgInfos: ArgReprInfo list list * - returnInfo: ArgReprInfo +/// Represents the ValReprInfo for a value, before the typars are fully inferred +type PartialValReprInfo = PartialValReprInfo of curriedArgInfos: ArgReprInfo list list * returnInfo: ArgReprInfo /// Holds the initial ValMemberInfo and other information before it is fully completed -type PreValMemberInfo = - | PreValMemberInfo of - memberInfo: ValMemberInfo * - logicalName: string * - compiledName: string +type PreValMemberInfo = PreValMemberInfo of memberInfo: ValMemberInfo * logicalName: string * compiledName: string /// The result of checking a value or member signature type ValSpecResult = @@ -378,7 +382,7 @@ type ValSpecResult = declaredTypars: Typars * ty: TType * partialValReprInfo: PartialValReprInfo * - declKind: DeclKind + declKind: DeclKind /// An empty environment of type variables with implicit scope val emptyUnscopedTyparEnv: UnscopedTyparEnv @@ -386,55 +390,51 @@ val emptyUnscopedTyparEnv: UnscopedTyparEnv /// A type to represent information associated with values to indicate what explicit (declared) type parameters /// are given and what additional type parameters can be inferred, if any. /// -/// 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 +/// 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 /// NormalizedBindingRhs records the r.h.s. of a binding after some munging just before type checking. -type NormalizedBindingRhs = +type NormalizedBindingRhs = | NormalizedBindingRhs of simplePats: SynSimplePats list * returnTyOpt: SynBindingReturnInfo option * - rhsExpr: SynExpr + rhsExpr: SynExpr /// 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 * - kind: SynBindingKind * - mustInline: bool * - isMutable: bool * - attribs: SynAttribute list * - xmlDoc: XmlDoc * - typars: SynValTyparDecls * - valSynData: SynValData * - pat: SynPat * - rhsExpr: NormalizedBindingRhs * - mBinding: range * - spBinding: DebugPointAtBinding - -/// RecursiveBindingInfo - flows through initial steps of TcLetrec +type NormalizedBinding = + | NormalizedBinding of + visibility: SynAccess option * + kind: SynBindingKind * + mustInline: bool * + isMutable: bool * + attribs: SynAttribute list * + xmlDoc: XmlDoc * + typars: SynValTyparDecls * + valSynData: SynValData * + pat: SynPat * + rhsExpr: NormalizedBindingRhs * + mBinding: range * + spBinding: DebugPointAtBinding + +/// RecursiveBindingInfo - flows through initial steps of TcLetrec type RecursiveBindingInfo = | RecursiveBindingInfo of - recBindIndex: int * // index of the binding in the recursive group - containerInfo: ContainerInfo * - enclosingDeclaredTypars: Typars * - inlineFlag: ValInline * - vspec: Val * - explicitTyparInfo: ExplicitTyparInfo * - partialValReprInfo: PartialValReprInfo * - memberInfoOpt: PreValMemberInfo option * - baseValOpt: Val option * - safeThisValOpt: Val option * - safeInitInfo: SafeInitData * - visibility: SynAccess option * - ty: TType * - declKind: DeclKind + recBindIndex: int * // index of the binding in the recursive group + containerInfo: ContainerInfo * + enclosingDeclaredTypars: Typars * + inlineFlag: ValInline * + vspec: Val * + explicitTyparInfo: ExplicitTyparInfo * + partialValReprInfo: PartialValReprInfo * + memberInfoOpt: PreValMemberInfo option * + baseValOpt: Val option * + safeThisValOpt: Val option * + safeInitInfo: SafeInitData * + visibility: SynAccess option * + ty: TType * + declKind: DeclKind member Val: Val member EnclosingDeclaredTypars: Typar list member Index: int @@ -450,16 +450,16 @@ type PrelimValScheme1 = type CheckedBindingInfo /// Represnts the results of the second phase of checking simple values -type ValScheme = - | ValScheme of - id: Ident * - typeScheme: TypeScheme * - topValInfo: ValReprInfo option * - memberInfo: PreValMemberInfo option * +type ValScheme = + | ValScheme of + id: Ident * + typeScheme: TypeScheme * + topValInfo: ValReprInfo option * + memberInfo: PreValMemberInfo option * isMutable: bool * - inlineInfo: ValInline * - baseOrThisInfo: ValBaseOrThisInfo * - visibility: SynAccess option * + inlineInfo: ValInline * + baseOrThisInfo: ValBaseOrThisInfo * + visibility: SynAccess option * compgen: bool * isIncrClass: bool * isTyFunc: bool * @@ -474,12 +474,12 @@ type NormalizedRecBindingDefn = binding: NormalizedBinding /// Represents a recursive binding after it has been normalized but before it has been checked -type PreCheckingRecursiveBinding = - { SyntacticBinding: NormalizedBinding +type PreCheckingRecursiveBinding = + { SyntacticBinding: NormalizedBinding RecBindingInfo: RecursiveBindingInfo } /// Represents a recursive binding after it has been checked but prior to generalization -type PreGeneralizationRecursiveBinding = +type PreGeneralizationRecursiveBinding = { ExtraGeneralizableTypars: Typars CheckedBinding: CheckedBindingInfo RecBindingInfo: RecursiveBindingInfo } @@ -490,7 +490,7 @@ type PreGeneralizationRecursiveBinding = type RecursiveUseFixupPoints /// Represents a recursive binding after it has been both checked and generalized -type PostGeneralizationRecursiveBinding = +type PostGeneralizationRecursiveBinding = { ValScheme: ValScheme CheckedBinding: CheckedBindingInfo RecBindingInfo: RecursiveBindingInfo } @@ -498,13 +498,13 @@ 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 = +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 = +type PreInitializationGraphEliminationBinding = { FixupPoints: RecursiveUseFixupPoints Binding: Binding } @@ -514,7 +514,7 @@ type PreInitializationGraphEliminationBinding = val addFreeItemOfModuleTy: ModuleOrNamespaceType -> UngeneralizableItem list -> UngeneralizableItem list /// Merge together lists of type variables to generalize, keeping canonical order -val unionGeneralizedTypars: typarSets:Typar list list -> Typar list +val unionGeneralizedTypars: typarSets: Typar list list -> Typar list /// Add a list of explicitly declared type variables to the environment, producing a new environment val AddDeclaredTypars: check: CheckForDuplicateTyparFlag -> typars: Typar list -> env: TcEnv -> TcEnv @@ -532,59 +532,109 @@ val AddLocalVals: g: TcGlobals -> tcSink: TcResultsSink -> scopem: range -> vals val AdjustRecType: vspec: Val -> vscheme: ValScheme -> unit /// Process a normalized recursive binding and prepare for progressive generalization -val AnalyzeAndMakeAndPublishRecursiveValue: overridesOK:OverridesOK -> isGeneratedEventVal:bool -> cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv * recBindIdx:int -> NormalizedRecBindingDefn -> (PreCheckingRecursiveBinding list * Val list) * (UnscopedTyparEnv * int) +val AnalyzeAndMakeAndPublishRecursiveValue: + overridesOK: OverridesOK -> + isGeneratedEventVal: bool -> + cenv: TcFileState -> + env: TcEnv -> + tpenv: UnscopedTyparEnv * recBindIdx: int -> + NormalizedRecBindingDefn -> + (PreCheckingRecursiveBinding list * Val list) * (UnscopedTyparEnv * int) /// Check that a member can be included in an interface -val CheckForNonAbstractInterface: declKind:DeclKind -> tcref:TyconRef -> memberFlags:SynMemberFlags -> m:range -> unit +val CheckForNonAbstractInterface: + declKind: DeclKind -> tcref: TyconRef -> memberFlags: SynMemberFlags -> m: range -> unit /// Check the flags on a member definition for consistency -val CheckMemberFlags: optIntfSlotTy:'a option -> newslotsOK:NewSlotsOK -> overridesOK:OverridesOK -> memberFlags:SynMemberFlags -> m:range -> unit +val CheckMemberFlags: + optIntfSlotTy: 'a option -> + newslotsOK: NewSlotsOK -> + overridesOK: OverridesOK -> + memberFlags: SynMemberFlags -> + m: range -> + unit /// Check a super type is valid -val CheckSuperType: cenv:TcFileState -> ty:TType -> m:range -> unit +val CheckSuperType: cenv: TcFileState -> ty: TType -> m: range -> unit /// After inference, view a set of declared type parameters in a canonical way. -val ChooseCanonicalDeclaredTyparsAfterInference: g: TcGlobals -> denv: DisplayEnv -> declaredTypars: Typar list -> m: range -> Typar list +val ChooseCanonicalDeclaredTyparsAfterInference: + g: TcGlobals -> denv: DisplayEnv -> declaredTypars: Typar list -> m: range -> Typar list /// After inference, view a ValSchem in a canonical way. -val ChooseCanonicalValSchemeAfterInference: g: TcGlobals -> denv: DisplayEnv -> vscheme: ValScheme -> m: range -> ValScheme +val ChooseCanonicalValSchemeAfterInference: + g: TcGlobals -> denv: DisplayEnv -> vscheme: ValScheme -> m: range -> ValScheme /// Check if the type annotations and inferred type information in a value give a /// full and complete generic type for a value. If so, enable generic recursion. -val ComputeIsComplete: enclosingDeclaredTypars:Typar list -> declaredTypars:Typar list -> ty:TType -> bool +val ComputeIsComplete: enclosingDeclaredTypars: Typar list -> declaredTypars: Typar list -> ty: TType -> bool /// Compute the available access rights from a particular location in code -val ComputeAccessRights: eAccessPath: CompilationPath -> eInternalsVisibleCompPaths: CompilationPath list -> eFamilyType: TyconRef option -> AccessorDomain +val ComputeAccessRights: + eAccessPath: CompilationPath -> + eInternalsVisibleCompPaths: CompilationPath list -> + eFamilyType: TyconRef option -> + AccessorDomain /// Compute the available access rights and module/entity compilation path for a paricular location in code -val ComputeAccessAndCompPath: env: TcEnv -> declKindOpt:DeclKind option -> m: range -> vis: SynAccess option -> overrideVis: Accessibility option -> actualParent: ParentRef -> Accessibility * CompilationPath option - -/// Get the expression resulting from turning an expression into an enumerable value, e.g. at 'for' loops -val ConvertArbitraryExprToEnumerable: cenv:TcFileState -> ty:TType -> env:TcEnv -> expr:Expr -> Expr * TType +val ComputeAccessAndCompPath: + env: TcEnv -> + declKindOpt: DeclKind option -> + m: range -> + vis: SynAccess option -> + overrideVis: Accessibility option -> + actualParent: ParentRef -> + Accessibility * CompilationPath option + +/// Get the expression resulting from turning an expression into an enumerable value, e.g. at 'for' loops +val ConvertArbitraryExprToEnumerable: cenv: TcFileState -> ty: TType -> env: TcEnv -> expr: Expr -> Expr * TType /// Invoke pattern match compilation -val CompilePatternForMatchClauses: cenv:TcFileState -> env:TcEnv -> mExpr:range -> matchm:range -> warnOnUnused:bool -> actionOnFailure:ActionOnFailure -> inputExprOpt:Expr option -> inputTy:TType -> resultTy:TType -> tclauses:TypedMatchClause list -> Val * Expr +val CompilePatternForMatchClauses: + cenv: TcFileState -> + env: TcEnv -> + mExpr: range -> + matchm: range -> + warnOnUnused: bool -> + actionOnFailure: ActionOnFailure -> + inputExprOpt: Expr option -> + inputTy: TType -> + resultTy: TType -> + tclauses: TypedMatchClause list -> + Val * Expr /// Process recursive bindings so that initialization is through laziness and is checked. /// The bindings may be either plain 'let rec' bindings or mutually recursive nestings of modules and types. /// The functions must iterate the actual bindings and process them to the overall result. val EliminateInitializationGraphs: - g: TcGlobals - -> mustHaveArity: bool - -> denv: DisplayEnv - -> bindings: 'Binding list - -> iterBindings:((PreInitializationGraphEliminationBinding list -> unit) -> 'Binding list -> unit) - -> buildLets: (Binding list -> 'Result) - -> mapBindings: ((PreInitializationGraphEliminationBinding list -> Binding list) -> 'Binding list -> 'Result list) - -> bindsm: range - -> 'Result list + g: TcGlobals -> + mustHaveArity: bool -> + denv: DisplayEnv -> + bindings: 'Binding list -> + iterBindings: ((PreInitializationGraphEliminationBinding list -> unit) -> 'Binding list -> unit) -> + buildLets: (Binding list -> 'Result) -> + mapBindings: ((PreInitializationGraphEliminationBinding list -> Binding list) -> 'Binding list -> 'Result list) -> + bindsm: range -> + 'Result list /// Adjust a recursive binding after generalization -val FixupLetrecBind: cenv:TcFileState -> denv:DisplayEnv -> generalizedTyparsForRecursiveBlock:Typars -> bind:PostSpecialValsRecursiveBinding -> PreInitializationGraphEliminationBinding +val FixupLetrecBind: + cenv: TcFileState -> + denv: DisplayEnv -> + generalizedTyparsForRecursiveBlock: Typars -> + bind: PostSpecialValsRecursiveBinding -> + PreInitializationGraphEliminationBinding /// Produce a fresh view of an object type, e.g. 'List' becomes 'List' for new /// inference variables with the given rigidity. -val FreshenObjectArgType: cenv: TcFileState -> m: range -> rigid: TyparRigidity -> tcref: TyconRef -> isExtrinsic: bool -> declaredTyconTypars: Typar list -> TType * Typar list * TyparInst * TType * TType +val FreshenObjectArgType: + cenv: TcFileState -> + m: range -> + rigid: TyparRigidity -> + tcref: TyconRef -> + isExtrinsic: bool -> + declaredTyconTypars: Typar list -> + TType * Typar list * TyparInst * TType * TType /// Get the accumulated module/namespace type for the current module/namespace being processed. val GetCurrAccumulatedModuleOrNamespaceType: env: TcEnv -> ModuleOrNamespaceType @@ -600,33 +650,68 @@ val InferGenericArityFromTyScheme: TypeScheme -> partialValReprInfo: PartialValR val LocateEnv: ccu: CcuThunk -> env: TcEnv -> enclosingNamespacePath: Ident list -> TcEnv /// Make the check for safe initialization of a member -val MakeCheckSafeInit: g: TcGlobals -> tinst: TypeInst -> safeInitInfo: SafeInitData -> reqExpr: Expr -> expr: Expr -> Expr +val MakeCheckSafeInit: + g: TcGlobals -> tinst: TypeInst -> safeInitInfo: SafeInitData -> reqExpr: Expr -> expr: Expr -> Expr /// Make an initial 'Val' and publish it to the environment and mutable module type accumulator. -val MakeAndPublishVal: cenv: TcFileState -> env: TcEnv -> altActualParent: ParentRef * inSig: bool * declKind: DeclKind * vrec: ValRecursiveScopeInfo * vscheme: ValScheme * attrs: Attribs * doc: XmlDoc * konst: Const option * isGeneratedEventVal: bool -> Val +val MakeAndPublishVal: + cenv: TcFileState -> + env: TcEnv -> + altActualParent: ParentRef * + inSig: bool * + declKind: DeclKind * + vrec: ValRecursiveScopeInfo * + vscheme: ValScheme * + attrs: Attribs * + doc: XmlDoc * + konst: Const option * + isGeneratedEventVal: bool -> + Val /// Make an initial 'base' value val MakeAndPublishBaseVal: cenv: TcFileState -> env: TcEnv -> Ident option -> TType -> Val option /// Make simple values (which are not recursive nor members) -val MakeAndPublishSimpleVals: cenv: TcFileState -> env: TcEnv -> names: NameMap -> NameMap * NameMap +val MakeAndPublishSimpleVals: + cenv: TcFileState -> env: TcEnv -> names: NameMap -> NameMap * NameMap /// Make an initial implicit safe initialization value val MakeAndPublishSafeThisVal: cenv: TcFileState -> env: TcEnv -> thisIdOpt: Ident option -> thisTy: TType -> Val option /// Make initial information for a member value -val MakeMemberDataAndMangledNameForMemberVal: g: TcGlobals * tcref: TyconRef * isExtrinsic: bool * attrs: Attribs * optImplSlotTys: TType list * memberFlags: SynMemberFlags * valSynData: SynValInfo * id: Ident * isCompGen: bool -> PreValMemberInfo +val MakeMemberDataAndMangledNameForMemberVal: + g: TcGlobals * + tcref: TyconRef * + isExtrinsic: bool * + attrs: Attribs * + optImplSlotTys: TType list * + memberFlags: SynMemberFlags * + valSynData: SynValInfo * + id: Ident * + isCompGen: bool -> + PreValMemberInfo /// Return a new environment suitable for processing declarations in the interior of a type definition val MakeInnerEnvForTyconRef: env: TcEnv -> tcref: TyconRef -> isExtrinsicExtension: bool -> TcEnv /// Return a new environment suitable for processing declarations in the interior of a module definition /// including creating an accumulator for the module type. -val MakeInnerEnv: addOpenToNameEnv: bool -> env: TcEnv -> nm: Ident -> modKind: ModuleOrNamespaceKind -> TcEnv * ModuleOrNamespaceType ref +val MakeInnerEnv: + addOpenToNameEnv: bool -> + env: TcEnv -> + nm: Ident -> + modKind: ModuleOrNamespaceKind -> + TcEnv * ModuleOrNamespaceType ref /// Return a new environment suitable for processing declarations in the interior of a module definition /// given that the accumulator for the module type already exisits. -val MakeInnerEnvWithAcc: addOpenToNameEnv: bool -> env: TcEnv -> nm: Ident -> mtypeAcc: ModuleOrNamespaceType ref -> modKind: ModuleOrNamespaceKind -> TcEnv +val MakeInnerEnvWithAcc: + addOpenToNameEnv: bool -> + env: TcEnv -> + nm: Ident -> + mtypeAcc: ModuleOrNamespaceType ref -> + modKind: ModuleOrNamespaceKind -> + TcEnv /// Produce a post-generalization type scheme for a simple type where no type inference generalization /// is appplied. @@ -647,118 +732,285 @@ val SetTyparRigid: DisplayEnv -> range -> Typar -> unit /// Check and publish a value specification (in a signature or 'abstract' member) to the /// module/namespace type accumulator and return the resulting Val(s). Normally only one /// 'Val' results but CLI events may produce both and add_Event and _remove_Event Val. -val TcAndPublishValSpec: cenv: TcFileState * env: TcEnv * containerInfo: ContainerInfo * declKind: DeclKind * memFlagsOpt: SynMemberFlags option * tpenv: UnscopedTyparEnv * valSpfn: SynValSig -> Val list * UnscopedTyparEnv +val TcAndPublishValSpec: + cenv: TcFileState * + env: TcEnv * + containerInfo: ContainerInfo * + declKind: DeclKind * + memFlagsOpt: SynMemberFlags option * + tpenv: UnscopedTyparEnv * + valSpfn: SynValSig -> + Val list * UnscopedTyparEnv /// Check a set of attributes -val TcAttributes: cenv: TcFileState -> env: TcEnv -> attrTgt: AttributeTargets -> synAttribs: SynAttribute list -> Attrib list +val TcAttributes: + cenv: TcFileState -> env: TcEnv -> attrTgt: AttributeTargets -> synAttribs: SynAttribute list -> Attrib list /// Check a set of attributes and allow failure because a later phase of type realization /// may successfully check the attributes (if the attribute type or its arguments is in the /// same recursive group) -val TcAttributesCanFail: cenv:TcFileState -> env:TcEnv -> attrTgt:AttributeTargets -> synAttribs:SynAttribute list -> Attrib list * (unit -> Attribs) +val TcAttributesCanFail: + cenv: TcFileState -> + env: TcEnv -> + attrTgt: AttributeTargets -> + synAttribs: SynAttribute list -> + Attrib list * (unit -> Attribs) /// Check a set of attributes which can only target specific elements -val TcAttributesWithPossibleTargets: canFail: bool -> cenv: TcFileState -> env: TcEnv -> attrTgt: AttributeTargets -> synAttribs: SynAttribute list -> (AttributeTargets * Attrib) list * bool +val TcAttributesWithPossibleTargets: + canFail: bool -> + cenv: TcFileState -> + env: TcEnv -> + attrTgt: AttributeTargets -> + synAttribs: SynAttribute list -> + (AttributeTargets * Attrib) list * bool /// Check a constant value, e.g. a literal val TcConst: cenv: TcFileState -> overallTy: TType -> m: range -> env: TcEnv -> c: SynConst -> Const /// Check a syntactic expression and convert it to a typed tree expression -val TcExpr: cenv:TcFileState -> ty:OverallTy -> env:TcEnv -> tpenv:UnscopedTyparEnv -> expr:SynExpr -> Expr * UnscopedTyparEnv +val TcExpr: + cenv: TcFileState -> + ty: OverallTy -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + expr: SynExpr -> + Expr * UnscopedTyparEnv /// Converts 'a..b' to a call to the '(..)' operator in FSharp.Core /// Converts 'a..b..c' to a call to the '(.. ..)' operator in FSharp.Core val RewriteRangeExpr: expr: SynExpr -> SynExpr option /// Check a syntactic expression and convert it to a typed tree expression -val TcExprOfUnknownType: cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> expr:SynExpr -> Expr * TType * UnscopedTyparEnv +val TcExprOfUnknownType: + cenv: TcFileState -> env: TcEnv -> tpenv: UnscopedTyparEnv -> expr: SynExpr -> Expr * TType * UnscopedTyparEnv /// Check a syntactic expression and convert it to a typed tree expression. Possibly allow for subsumption flexibility /// and insert a coercion if necessary. -val TcExprFlex: cenv:TcFileState -> flex:bool -> compat:bool -> desiredTy:TType -> env:TcEnv -> tpenv:UnscopedTyparEnv -> synExpr:SynExpr -> Expr * UnscopedTyparEnv +val TcExprFlex: + cenv: TcFileState -> + flex: bool -> + compat: bool -> + desiredTy: TType -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + synExpr: SynExpr -> + Expr * UnscopedTyparEnv /// Process a leaf construct where the actual type of that construct is already pre-known, /// and the overall type can be eagerly propagated into the actual type, including pre-calculating /// any type-directed conversion. -val TcPropagatingExprLeafThenConvert: cenv:TcFileState -> overallTy: OverallTy -> actualTy: TType -> env: TcEnv -> m: range -> f: (unit -> Expr * UnscopedTyparEnv) -> Expr * UnscopedTyparEnv +val TcPropagatingExprLeafThenConvert: + cenv: TcFileState -> + overallTy: OverallTy -> + actualTy: TType -> + env: TcEnv -> + m: range -> + f: (unit -> Expr * UnscopedTyparEnv) -> + Expr * UnscopedTyparEnv /// Check a syntactic statement and convert it to a typed tree expression. -val TcStmtThatCantBeCtorBody: cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> expr:SynExpr -> Expr * UnscopedTyparEnv +val TcStmtThatCantBeCtorBody: + cenv: TcFileState -> env: TcEnv -> tpenv: UnscopedTyparEnv -> expr: SynExpr -> Expr * UnscopedTyparEnv /// Check a syntactic expression and convert it to a typed tree expression -val TcExprUndelayed: cenv:TcFileState -> overallTy:OverallTy -> env:TcEnv -> tpenv:UnscopedTyparEnv -> synExpr:SynExpr -> Expr * UnscopedTyparEnv +val TcExprUndelayed: + cenv: TcFileState -> + overallTy: OverallTy -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + synExpr: SynExpr -> + Expr * UnscopedTyparEnv /// Check a linear expression (e.g. a sequence of 'let') in a tail-recursive way /// and convert it to a typed tree expression, using the bodyChecker to check the parts /// that are not linear. -val TcLinearExprs: bodyChecker:(OverallTy -> TcEnv -> UnscopedTyparEnv -> SynExpr -> Expr * UnscopedTyparEnv) -> cenv:TcFileState -> env:TcEnv -> overallTy:OverallTy -> tpenv:UnscopedTyparEnv -> isCompExpr:bool -> expr:SynExpr -> cont:(Expr * UnscopedTyparEnv -> Expr * UnscopedTyparEnv) -> Expr * UnscopedTyparEnv +val TcLinearExprs: + bodyChecker: (OverallTy -> TcEnv -> UnscopedTyparEnv -> SynExpr -> Expr * UnscopedTyparEnv) -> + cenv: TcFileState -> + env: TcEnv -> + overallTy: OverallTy -> + tpenv: UnscopedTyparEnv -> + isCompExpr: bool -> + expr: SynExpr -> + cont: (Expr * UnscopedTyparEnv -> Expr * UnscopedTyparEnv) -> + Expr * UnscopedTyparEnv /// Try to check a syntactic statement and indicate if it's type is not unit without emitting a warning -val TryTcStmt: cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> synExpr:SynExpr -> bool * Expr * UnscopedTyparEnv +val TryTcStmt: + cenv: TcFileState -> env: TcEnv -> tpenv: UnscopedTyparEnv -> synExpr: SynExpr -> bool * Expr * UnscopedTyparEnv /// Check a pattern being used as a pattern match -val TcMatchPattern: cenv:TcFileState -> inputTy:TType -> env:TcEnv -> tpenv:UnscopedTyparEnv -> pat:SynPat * optWhenExpr:SynExpr option -> Pattern * Expr option * Val list * TcEnv * UnscopedTyparEnv +val TcMatchPattern: + cenv: TcFileState -> + inputTy: TType -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + pat: SynPat * optWhenExpr: SynExpr option -> + Pattern * Expr option * Val list * TcEnv * UnscopedTyparEnv val (|BinOpExpr|_|): SynExpr -> (Ident * SynExpr * SynExpr) option /// Check a set of let bindings -val TcLetBindings: cenv:TcFileState -> env:TcEnv -> containerInfo:ContainerInfo -> declKind:DeclKind -> tpenv:UnscopedTyparEnv -> binds:SynBinding list * bindsm:range * scopem:range -> ModuleOrNamespaceExpr list * TcEnv * UnscopedTyparEnv +val TcLetBindings: + cenv: TcFileState -> + env: TcEnv -> + containerInfo: ContainerInfo -> + declKind: DeclKind -> + tpenv: UnscopedTyparEnv -> + binds: SynBinding list * bindsm: range * scopem: range -> + ModuleOrNamespaceExpr list * TcEnv * UnscopedTyparEnv /// Check an individual `let rec` binding -val TcLetrecBinding: cenv:TcFileState * envRec:TcEnv * scopem:range * extraGeneralizableTypars:Typars * reqdThisValTyOpt:TType option -> envNonRec:TcEnv * generalizedRecBinds:PostGeneralizationRecursiveBinding list * preGeneralizationRecBinds:PreGeneralizationRecursiveBinding list * tpenv:UnscopedTyparEnv * uncheckedRecBindsTable:Map -> rbind:PreCheckingRecursiveBinding -> TcEnv * PostGeneralizationRecursiveBinding list * PreGeneralizationRecursiveBinding list * UnscopedTyparEnv * Map +val TcLetrecBinding: + cenv: TcFileState * + envRec: TcEnv * + scopem: range * + extraGeneralizableTypars: Typars * + reqdThisValTyOpt: TType option -> + envNonRec: TcEnv * + generalizedRecBinds: PostGeneralizationRecursiveBinding list * + preGeneralizationRecBinds: PreGeneralizationRecursiveBinding list * + tpenv: UnscopedTyparEnv * + uncheckedRecBindsTable: Map -> + rbind: PreCheckingRecursiveBinding -> + TcEnv * + PostGeneralizationRecursiveBinding list * + PreGeneralizationRecursiveBinding list * + UnscopedTyparEnv * + Map /// Get the binding for the implicit safe initialziation check value if it is being used -val TcLetrecComputeCtorSafeThisValBind: cenv:TcFileState -> safeThisValOpt:Val option -> Binding option +val TcLetrecComputeCtorSafeThisValBind: cenv: TcFileState -> safeThisValOpt: Val option -> Binding option /// Check a collection of `let rec` bindings -val TcLetrecBindings: overridesOK:OverridesOK -> cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> binds:RecDefnBindingInfo list * bindsm:range * scopem:range -> Bindings * TcEnv * UnscopedTyparEnv +val TcLetrecBindings: + overridesOK: OverridesOK -> + cenv: TcFileState -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + binds: RecDefnBindingInfo list * bindsm: range * scopem: range -> + Bindings * TcEnv * UnscopedTyparEnv /// Part of check a collection of recursive bindings that might include members -val TcLetrecAdjustMemberForSpecialVals: cenv: TcFileState -> pgrbind: PostGeneralizationRecursiveBinding -> PostSpecialValsRecursiveBinding +val TcLetrecAdjustMemberForSpecialVals: + cenv: TcFileState -> pgrbind: PostGeneralizationRecursiveBinding -> PostSpecialValsRecursiveBinding /// Check an inheritance expression or other 'new XYZ()' expression -val TcNewExpr: cenv:TcFileState -> env:TcEnv -> tpenv:UnscopedTyparEnv -> objTy:TType -> mObjTyOpt:range option -> superInit:bool -> arg:SynExpr -> mWholeExprOrObjTy:range -> Expr * UnscopedTyparEnv +val TcNewExpr: + cenv: TcFileState -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + objTy: TType -> + mObjTyOpt: range option -> + superInit: bool -> + arg: SynExpr -> + mWholeExprOrObjTy: range -> + Expr * UnscopedTyparEnv #if !NO_TYPEPROVIDERS /// Check the application of a provided type to static args -val TcProvidedTypeAppToStaticConstantArgs: cenv:TcFileState -> env:TcEnv -> optGeneratedTypePath:string list option -> tpenv:UnscopedTyparEnv -> tcref:TyconRef -> args:SynType list -> m:range -> bool * Tainted * (unit -> unit) +val TcProvidedTypeAppToStaticConstantArgs: + cenv: TcFileState -> + env: TcEnv -> + optGeneratedTypePath: string list option -> + tpenv: UnscopedTyparEnv -> + tcref: TyconRef -> + args: SynType list -> + m: range -> + bool * Tainted * (unit -> unit) #endif /// Check a set of simple patterns, e.g. the declarations of parameters for an implicit constructor. -val TcSimplePatsOfUnknownType: cenv: TcFileState -> optArgsOK: bool -> checkCxs: CheckConstraints -> env: TcEnv -> tpenv: UnscopedTyparEnv -> spats: SynSimplePats -> string list * (UnscopedTyparEnv * NameMap * Set) +val TcSimplePatsOfUnknownType: + cenv: TcFileState -> + optArgsOK: bool -> + checkCxs: CheckConstraints -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + spats: SynSimplePats -> + string list * (UnscopedTyparEnv * NameMap * Set) /// Check a set of explicitly declared constraints on type parameters -val TcTyparConstraints: cenv: TcFileState -> newOk: ImplicitlyBoundTyparsAllowed -> checkCxs: CheckConstraints -> occ: ItemOccurence -> env: TcEnv -> tpenv: UnscopedTyparEnv -> synConstraints: SynTypeConstraint list -> UnscopedTyparEnv +val TcTyparConstraints: + cenv: TcFileState -> + newOk: ImplicitlyBoundTyparsAllowed -> + checkCxs: CheckConstraints -> + occ: ItemOccurence -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + synConstraints: SynTypeConstraint list -> + UnscopedTyparEnv /// Check a collection of type parameters declarations val TcTyparDecls: cenv: TcFileState -> env: TcEnv -> synTypars: SynTyparDecl list -> Typar list /// Check a syntactic type -val TcType: cenv: TcFileState -> newOk: ImplicitlyBoundTyparsAllowed -> checkCxs: CheckConstraints -> occ: ItemOccurence -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> TType * UnscopedTyparEnv +val TcType: + cenv: TcFileState -> + newOk: ImplicitlyBoundTyparsAllowed -> + checkCxs: CheckConstraints -> + occ: ItemOccurence -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + ty: SynType -> + TType * UnscopedTyparEnv /// Check a syntactic type or unit of measure -val TcTypeOrMeasureAndRecover: optKind: TyparKind option -> cenv: TcFileState -> newOk: ImplicitlyBoundTyparsAllowed -> checkCxs: CheckConstraints -> occ: ItemOccurence -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> TType * UnscopedTyparEnv +val TcTypeOrMeasureAndRecover: + optKind: TyparKind option -> + cenv: TcFileState -> + newOk: ImplicitlyBoundTyparsAllowed -> + checkCxs: CheckConstraints -> + occ: ItemOccurence -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + ty: SynType -> + TType * UnscopedTyparEnv /// Check a syntactic type (with error recovery) -val TcTypeAndRecover: cenv: TcFileState -> newOk: ImplicitlyBoundTyparsAllowed -> checkCxs: CheckConstraints -> occ: ItemOccurence -> env: TcEnv -> tpenv: UnscopedTyparEnv -> ty: SynType -> TType * UnscopedTyparEnv +val TcTypeAndRecover: + cenv: TcFileState -> + newOk: ImplicitlyBoundTyparsAllowed -> + checkCxs: CheckConstraints -> + occ: ItemOccurence -> + env: TcEnv -> + tpenv: UnscopedTyparEnv -> + ty: SynType -> + TType * UnscopedTyparEnv /// Check a specification of a value or member in a signature or an abstract member -val TcValSpec: cenv: TcFileState -> TcEnv -> DeclKind -> ImplicitlyBoundTyparsAllowed -> ContainerInfo -> SynMemberFlags option -> thisTyOpt: TType option -> UnscopedTyparEnv -> SynValSig -> Attrib list -> ValSpecResult list * UnscopedTyparEnv +val TcValSpec: + cenv: TcFileState -> + TcEnv -> + DeclKind -> + ImplicitlyBoundTyparsAllowed -> + ContainerInfo -> + SynMemberFlags option -> + thisTyOpt: TType option -> + UnscopedTyparEnv -> + SynValSig -> + Attrib list -> + ValSpecResult list * UnscopedTyparEnv /// Given the declaration of a function or member, process it to produce the ValReprInfo /// giving the names and attributes relevant to arguments and return, but before type /// parameters have been fully inferred via generalization. -val TranslateTopValSynInfo: range -> tcAttributes: (AttributeTargets -> SynAttribute list -> Attrib list) -> synValInfo: SynValInfo -> PartialValReprInfo +val TranslateTopValSynInfo: + range -> + tcAttributes: (AttributeTargets -> SynAttribute list -> Attrib list) -> + synValInfo: SynValInfo -> + PartialValReprInfo /// Given the declaration of a function or member, complete the processing of its ValReprInfo /// once type parameters have been fully inferred via generalization. val TranslatePartialArity: tps: Typar list -> PartialValReprInfo -> ValReprInfo /// Constrain two types to be equal within this type checking context -val UnifyTypes : cenv:TcFileState -> env:TcEnv -> m:range -> actualTy:TType -> expectedTy:TType -> unit +val UnifyTypes: cenv: TcFileState -> env: TcEnv -> m: range -> actualTy: TType -> expectedTy: TType -> unit module GeneralizationHelpers = - + /// Given an environment, compute the set of inference type variables which may not be /// generalised, because they appear somewhere in the types of the constructs availabe /// in the environment. @@ -800,5 +1052,9 @@ module AttributeTargets = module BindingNormalization = /// Take a syntactic binding and do the very first processing step to normalize it. - val NormalizeBinding: isObjExprBinding: IsObjExprBinding -> cenv: TcFileState -> env: TcEnv -> binding: SynBinding -> NormalizedBinding - + val NormalizeBinding: + isObjExprBinding: IsObjExprBinding -> + cenv: TcFileState -> + env: TcEnv -> + binding: SynBinding -> + NormalizedBinding diff --git a/src/fsharp/CheckFormatStrings.fsi b/src/fsharp/CheckFormatStrings.fsi index 83586c97e20..9616f255a50 100644 --- a/src/fsharp/CheckFormatStrings.fsi +++ b/src/fsharp/CheckFormatStrings.fsi @@ -10,19 +10,26 @@ module internal FSharp.Compiler.CheckFormatStrings open FSharp.Compiler.NameResolution open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTree val ParseFormatString: - m: range - -> fragmentRanges: range list - -> g: TcGlobals - -> isInterpolated: bool - -> isFormattableString: bool - -> formatStringCheckContext: FormatStringCheckContext option - -> fmt: string - -> printerArgTy: TType - -> printerResidueTy: TType - -> printerResultTy: TType - -> TType list * TType * TType * TType[] * (range * int) list * string + m: range -> + fragmentRanges: range list -> + g: TcGlobals -> + isInterpolated: bool -> + isFormattableString: bool -> + formatStringCheckContext: FormatStringCheckContext option -> + fmt: string -> + printerArgTy: TType -> + printerResidueTy: TType -> + printerResultTy: TType -> + TType list * TType * TType * TType [] * (range * int) list * string -val TryCountFormatStringArguments: m: range -> g: TcGlobals -> isInterpolated: bool -> fmt:string -> printerArgTy:TType -> printerResidueTy:TType -> int option +val TryCountFormatStringArguments: + m: range -> + g: TcGlobals -> + isInterpolated: bool -> + fmt: string -> + printerArgTy: TType -> + printerResidueTy: TType -> + int option diff --git a/src/fsharp/CompilerConfig.fsi b/src/fsharp/CompilerConfig.fsi index 7189312bad1..de97516715c 100644 --- a/src/fsharp/CompilerConfig.fsi +++ b/src/fsharp/CompilerConfig.fsi @@ -20,8 +20,8 @@ open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Text open FSharp.Compiler.BuildGraph -exception FileNameNotResolved of (*filename*) string * (*description of searched locations*) string * range -exception LoadedSourceNotFoundIgnoring of (*filename*) string * range +exception FileNameNotResolved of string (*description of searched locations*) * string * range (*filename*) +exception LoadedSourceNotFoundIgnoring of string * range (*filename*) /// Represents a reference to an F# assembly. May be backed by a real assembly on disk (read by Abstract IL), or a cross-project /// reference in FSharp.Compiler.Service. @@ -31,7 +31,7 @@ type IRawFSharpAssemblyData = abstract GetAutoOpenAttributes: unit -> string list /// The raw list InternalsVisibleToAttribute attributes in the assembly - abstract GetInternalsVisibleToAttributes: unit -> string list + abstract GetInternalsVisibleToAttributes: unit -> string list /// The raw IL module definition in the assembly, if any. This is not present for cross-project references /// in the language service @@ -42,10 +42,12 @@ type IRawFSharpAssemblyData = abstract HasMatchingFSharpSignatureDataAttribute: bool /// The raw F# signature data in the assembly, if any - abstract GetRawFSharpSignatureData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list + abstract GetRawFSharpSignatureData: + range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list /// The raw F# optimization data in the assembly, if any - abstract GetRawFSharpOptimizationData: range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list + abstract GetRawFSharpOptimizationData: + range * ilShortAssemName: string * fileName: string -> (string * (unit -> ReadOnlyByteMemory)) list /// The table of type forwarders in the assembly abstract GetRawTypeForwarders: unit -> ILExportedTypesAndForwarders @@ -62,8 +64,7 @@ type TimeStampCache = member GetFileTimeStamp: string -> DateTime member GetProjectReferenceTimeStamp: IProjectReference -> DateTime -and [] - ProjectAssemblyDataResult = +and [] ProjectAssemblyDataResult = | Available of IRawFSharpAssemblyData | Unavailable of useOnDiskInstead: bool @@ -88,7 +89,7 @@ and IProjectReference = abstract TryGetLogicalTimeStamp: TimeStampCache -> DateTime option type AssemblyReference = - | AssemblyReference of range * string * IProjectReference option + | AssemblyReference of range * string * IProjectReference option member Range: range @@ -109,15 +110,17 @@ type CompilerTarget = member IsExe: bool [] -type CopyFSharpCoreFlag = Yes | No +type CopyFSharpCoreFlag = + | Yes + | No /// Represents the file or string used for the --version flag type VersionFlag = | VersionString of string | VersionFile of string | VersionNone - member GetVersionInfo: implicitIncludeDir:string -> ILVersionInfo - member GetVersionString: implicitIncludeDir:string -> string + member GetVersionInfo: implicitIncludeDir: string -> ILVersionInfo + member GetVersionString: implicitIncludeDir: string -> string type Directive = | Resolution @@ -138,16 +141,24 @@ type PackageManagerLine = Line: string Range: range } - static member AddLineWithKey: string -> Directive -> string -> range -> Map -> Map - static member RemoveUnprocessedLines: string -> Map -> Map - static member SetLinesAsProcessed: string -> Map -> Map + static member AddLineWithKey: + string -> + Directive -> + string -> + range -> + Map -> + Map + static member RemoveUnprocessedLines: + string -> Map -> Map + static member SetLinesAsProcessed: + string -> Map -> Map static member StripDependencyManagerKey: string -> string -> string [] type MetadataAssemblyGeneration = | None /// Includes F# signature and optimization metadata as resources in the emitting assembly. - /// Implementation assembly will still be emitted normally, but will emit the reference assembly with the specified output path. + /// Implementation assembly will still be emitted normally, but will emit the reference assembly with the specified output path. | ReferenceOut of outputPath: string /// Includes F# signature and optimization metadata as resources in the emitting assembly. /// Only emits the assembly as a reference assembly. @@ -179,9 +190,9 @@ type TcConfigBuilder = /// Sources added into the build with #load mutable loadedSources: (range * string * string) list - mutable compilerToolPaths: string list + mutable compilerToolPaths: string list - mutable referencedDLLs: AssemblyReference list + mutable referencedDLLs: AssemblyReference list mutable packageManagerLines: Map mutable projectReferences: IProjectReference list @@ -192,9 +203,9 @@ type TcConfigBuilder = mutable inputCodePage: int option mutable embedResources: string list mutable errorSeverityOptions: FSharpDiagnosticOptions - mutable mlCompatibility:bool - mutable checkOverflow:bool - mutable showReferenceResolutions:bool + mutable mlCompatibility: bool + mutable checkOverflow: bool + mutable showReferenceResolutions: bool mutable outputDir: string option mutable outputFile: string option mutable platform: ILPlatform option @@ -253,24 +264,24 @@ type TcConfigBuilder = mutable abortOnError: bool mutable baseAddress: int32 option mutable checksumAlgorithm: HashAlgorithm - #if DEBUG +#if DEBUG mutable showOptimizationData: bool #endif - mutable showTerms : bool + mutable showTerms: bool mutable writeTermsToFiles: bool - mutable doDetuple : bool - mutable doTLR : bool + mutable doDetuple: bool + mutable doTLR: bool mutable doFinalSimplify: bool - mutable optsOn : bool - mutable optSettings : Optimizer.OptimizationSettings + mutable optsOn: bool + mutable optSettings: Optimizer.OptimizationSettings mutable emitTailcalls: bool mutable deterministic: bool mutable concurrentBuild: bool mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option - mutable lcid : int option + mutable lcid: int option mutable productNameForBannerText: string - mutable showBanner : bool + mutable showBanner: bool mutable showTimes: bool mutable showLoadedAssemblies: bool mutable continueAfterParseFailure: bool @@ -296,20 +307,19 @@ type TcConfigBuilder = /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, /// and from which we can read the metadata. Only used when metadataOnly=true. - mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + mutable tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. - mutable internalTestSpanStackReferring : bool + mutable internalTestSpanStackReferring: bool /// Prevent erasure of conditional attributes and methods so tooling is able analyse them. mutable noConditionalErasure: bool - mutable pathMap : PathMap + mutable pathMap: PathMap - mutable langVersion : LanguageVersion + mutable langVersion: LanguageVersion - mutable xmlDocInfoLoader : IXmlDocumentationInfoLoader option - } + mutable xmlDocInfoLoader: IXmlDocumentationInfoLoader option } static member CreateNew: legacyReferenceResolver: LegacyReferenceResolver * @@ -321,10 +331,10 @@ type TcConfigBuilder = defaultCopyFSharpCore: CopyFSharpCoreFlag * tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot * sdkDirOverride: string option * - rangeForErrors: range - -> TcConfigBuilder + rangeForErrors: range -> + TcConfigBuilder - member DecideNames: string list -> outfile: string * pdbfile: string option * assemblyName: string + member DecideNames: string list -> string * string option * string member TurnWarningOff: range * string -> unit @@ -349,7 +359,8 @@ type TcConfigBuilder = // Directories to start probing in for native DLLs for FSI dynamic loading member GetNativeProbingRoots: unit -> seq - member AddReferenceDirective: dependencyProvider: DependencyProvider * m: range * path: string * directive: Directive -> unit + member AddReferenceDirective: + dependencyProvider: DependencyProvider * m: range * path: string * directive: Directive -> unit member AddLoadedSource: m: range * originalPath: string * pathLoadedFrom: string -> unit @@ -391,9 +402,9 @@ type TcConfig = member inputCodePage: int option member embedResources: string list member errorSeverityOptions: FSharpDiagnosticOptions - member mlCompatibility:bool - member checkOverflow:bool - member showReferenceResolutions:bool + member mlCompatibility: bool + member checkOverflow: bool + member showReferenceResolutions: bool member outputDir: string option member outputFile: string option member platform: ILPlatform option @@ -454,21 +465,21 @@ type TcConfig = #if DEBUG member showOptimizationData: bool #endif - member showTerms : bool + member showTerms: bool member writeTermsToFiles: bool - member doDetuple : bool - member doTLR : bool + member doDetuple: bool + member doTLR: bool member doFinalSimplify: bool - member optSettings : Optimizer.OptimizationSettings + member optSettings: Optimizer.OptimizationSettings member emitTailcalls: bool member deterministic: bool member concurrentBuild: bool member emitMetadataAssembly: MetadataAssemblyGeneration member pathMap: PathMap member preferredUiLang: string option - member optsOn : bool + member optsOn: bool member productNameForBannerText: string - member showBanner : bool + member showBanner: bool member showTimes: bool member showLoadedAssemblies: bool member continueAfterParseFailure: bool @@ -495,9 +506,9 @@ type TcConfig = member GetTargetFrameworkDirectories: unit -> string list /// Get the loaded sources that exist and issue a warning for the ones that don't - member GetAvailableLoadedSources: unit -> (range*string) list + member GetAvailableLoadedSources: unit -> (range * string) list - member ComputeCanContainEntryPoint: sourceFiles:string list -> bool list *bool + member ComputeCanContainEntryPoint: sourceFiles: string list -> bool list * bool /// File system query based on TcConfig settings member ResolveSourceFile: range * filename: string * pathLoadedFrom: string -> string @@ -525,7 +536,7 @@ type TcConfig = member tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot - member targetFrameworkVersion : string + member targetFrameworkVersion: string member knownUnresolvedReferences: UnresolvedAssemblyReference list @@ -537,7 +548,7 @@ type TcConfig = member noConditionalErasure: bool /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. - member internalTestSpanStackReferring : bool + member internalTestSpanStackReferring: bool member GetSearchPathsForLibraryFiles: unit -> string list diff --git a/src/fsharp/CompilerDiagnostics.fsi b/src/fsharp/CompilerDiagnostics.fsi index ce5c641a8b5..79f2de1ce4c 100644 --- a/src/fsharp/CompilerDiagnostics.fsi +++ b/src/fsharp/CompilerDiagnostics.fsi @@ -13,7 +13,7 @@ open FSharp.Compiler.Text module internal CompilerService = val showAssertForUnexpectedException: bool ref -/// For extra diagnostics +/// For extra diagnostics val mutable showParserStackOnParseError: bool #endif // DEBUG @@ -60,10 +60,19 @@ val SplitRelatedDiagnostics: PhasedDiagnostic -> PhasedDiagnostic * PhasedDiagno val OutputPhasedDiagnostic: StringBuilder -> PhasedDiagnostic -> flattenErrors: bool -> suggestNames: bool -> unit /// Output an error or warning to a buffer -val OutputDiagnostic: implicitIncludeDir:string * showFullPaths: bool * flattenErrors: bool * errorStyle: ErrorStyle * severity: FSharpDiagnosticSeverity -> StringBuilder -> PhasedDiagnostic -> unit +val OutputDiagnostic: + implicitIncludeDir: string * + showFullPaths: bool * + flattenErrors: bool * + errorStyle: ErrorStyle * + severity: FSharpDiagnosticSeverity -> + StringBuilder -> + PhasedDiagnostic -> + unit /// Output extra context information for an error or warning to a buffer -val OutputDiagnosticContext: prefix:string -> fileLineFunction:(string -> int -> string) -> StringBuilder -> PhasedDiagnostic -> unit +val OutputDiagnosticContext: + prefix: string -> fileLineFunction: (string -> int -> string) -> StringBuilder -> PhasedDiagnostic -> unit /// Part of LegacyHostedCompilerForTesting [] @@ -75,29 +84,38 @@ type DiagnosticLocation = /// Part of LegacyHostedCompilerForTesting [] -type DiagnosticCanonicalInformation = +type DiagnosticCanonicalInformation = { ErrorNumber: int Subcategory: string TextRepresentation: string } /// Part of LegacyHostedCompilerForTesting [] -type DiagnosticDetailedInfo = +type DiagnosticDetailedInfo = { Location: DiagnosticLocation option Canonical: DiagnosticCanonicalInformation Message: string } /// Part of LegacyHostedCompilerForTesting [] -type Diagnostic = +type Diagnostic = | Short of FSharpDiagnosticSeverity * string | Long of FSharpDiagnosticSeverity * DiagnosticDetailedInfo /// Part of LegacyHostedCompilerForTesting -val CollectDiagnostic: implicitIncludeDir:string * showFullPaths: bool * flattenErrors: bool * errorStyle: ErrorStyle * severity: FSharpDiagnosticSeverity * PhasedDiagnostic * suggestNames: bool -> seq +val CollectDiagnostic: + implicitIncludeDir: string * + showFullPaths: bool * + flattenErrors: bool * + errorStyle: ErrorStyle * + severity: FSharpDiagnosticSeverity * + PhasedDiagnostic * + suggestNames: bool -> + seq /// Get an error logger that filters the reporting of warnings based on scoped pragma information -val GetErrorLoggerFilteringByScopedPragmas: checkFile:bool * ScopedPragma list * FSharpDiagnosticOptions *ErrorLogger -> ErrorLogger +val GetErrorLoggerFilteringByScopedPragmas: + checkFile: bool * ScopedPragma list * FSharpDiagnosticOptions * ErrorLogger -> ErrorLogger val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string @@ -109,5 +127,3 @@ val ReportDiagnosticAsWarning: FSharpDiagnosticOptions -> (PhasedDiagnostic * FS /// Indicates if we should report a warning as an error val ReportDiagnosticAsError: FSharpDiagnosticOptions -> (PhasedDiagnostic * FSharpDiagnosticSeverity) -> bool - - diff --git a/src/fsharp/CompilerGlobalState.fsi b/src/fsharp/CompilerGlobalState.fsi index 4a1e646ffc0..105ab236f9e 100644 --- a/src/fsharp/CompilerGlobalState.fsi +++ b/src/fsharp/CompilerGlobalState.fsi @@ -16,9 +16,9 @@ open FSharp.Compiler.Text type NiceNameGenerator = new: unit -> NiceNameGenerator - member FreshCompilerGeneratedName: name:string * m:range -> string + member FreshCompilerGeneratedName: name: string * m: range -> string member Reset: unit -> unit - + /// Generates compiler-generated names marked up with a source code location, but if given the same unique value then /// return precisely the same name. Each name generated also includes the StartLine number of the range passed in /// at the point of first generation. @@ -28,9 +28,9 @@ type NiceNameGenerator = type StableNiceNameGenerator = new: unit -> StableNiceNameGenerator - member GetUniqueCompilerGeneratedName: name:string * m:range * uniq:int64 -> string + member GetUniqueCompilerGeneratedName: name: string * m: range * uniq: int64 -> string member Reset: unit -> unit - + type internal CompilerGlobalState = new: unit -> CompilerGlobalState @@ -43,7 +43,7 @@ type internal CompilerGlobalState = /// A global generator of stable compiler generated names member StableNameGenerator: StableNiceNameGenerator - + type Unique = int64 /// Concurrency-safe diff --git a/src/fsharp/CompilerImports.fsi b/src/fsharp/CompilerImports.fsi index 6385120e8b0..ac72545cb26 100644 --- a/src/fsharp/CompilerImports.fsi +++ b/src/fsharp/CompilerImports.fsi @@ -25,13 +25,13 @@ open FSharp.Compiler.ExtensionTyping #endif /// This exception is an old-style way of reporting a diagnostic -exception AssemblyNotResolved of (*originalName*) string * range +exception AssemblyNotResolved of string * range (*originalName*) /// This exception is an old-style way of reporting a diagnostic -exception MSBuildReferenceResolutionWarning of (*MSBuild warning code*)string * (*Message*)string * range +exception MSBuildReferenceResolutionWarning of string (*Message*) * string * range (*MSBuild warning code*) /// This exception is an old-style way of reporting a diagnostic -exception MSBuildReferenceResolutionError of (*MSBuild warning code*)string * (*Message*)string * range +exception MSBuildReferenceResolutionError of string (*Message*) * string * range (*MSBuild warning code*) /// Determine if an IL resource attached to an F# assembly is an F# signature data resource val IsSignatureDataResource: ILResource -> bool @@ -46,65 +46,65 @@ val GetSignatureDataResourceName: ILResource -> string /// Encode the F# interface data into a set of IL attributes and resources val EncodeSignatureData: - tcConfig:TcConfig * - tcGlobals:TcGlobals * - exportRemapping:Remap * + tcConfig: TcConfig * + tcGlobals: TcGlobals * + exportRemapping: Remap * generatedCcu: CcuThunk * outfile: string * - isIncrementalBuild: bool - -> ILAttribute list * ILResource list + isIncrementalBuild: bool -> + ILAttribute list * ILResource list -val EncodeOptimizationData: - tcGlobals:TcGlobals * - tcConfig:TcConfig * +val EncodeOptimizationData: + tcGlobals: TcGlobals * + tcConfig: TcConfig * outfile: string * - exportRemapping:Remap * + exportRemapping: Remap * (CcuThunk * #CcuOptimizationInfo) * - isIncrementalBuild: bool - -> ILResource list + isIncrementalBuild: bool -> + ILResource list [] type ResolveAssemblyReferenceMode = | Speculative | ReportErrors -type AssemblyResolution = - { /// The original reference to the assembly. - originalReference: AssemblyReference +type AssemblyResolution = + { /// The original reference to the assembly. + originalReference: AssemblyReference - /// Path to the resolvedFile - resolvedPath: string + /// Path to the resolvedFile + resolvedPath: string - /// Create the tooltip text for the assembly reference - prepareToolTip: unit -> string + /// Create the tooltip text for the assembly reference + prepareToolTip: unit -> string - /// Whether or not this is an installed system assembly (for example, System.dll) - sysdir: bool + /// Whether or not this is an installed system assembly (for example, System.dll) + sysdir: bool - /// Lazily populated ilAssemblyRef for this reference. - mutable ilAssemblyRef: ILAssemblyRef option - } + /// Lazily populated ilAssemblyRef for this reference. + mutable ilAssemblyRef: ILAssemblyRef option } #if !NO_TYPEPROVIDERS -type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list +type ResolvedExtensionReference = + | ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif /// Represents a resolved imported binary [] -type ImportedBinary = +type ImportedBinary = { FileName: string RawMetadata: IRawFSharpAssemblyData #if !NO_TYPEPROVIDERS ProviderGeneratedAssembly: System.Reflection.Assembly option IsProviderGenerated: bool - ProviderGeneratedStaticLinkMap: ProvidedAssemblyStaticLinkingMap option + ProviderGeneratedStaticLinkMap: ProvidedAssemblyStaticLinkingMap option #endif ILAssemblyRefs: ILAssemblyRef list - ILScopeRef: ILScopeRef} + ILScopeRef: ILScopeRef } /// Represents a resolved imported assembly [] -type ImportedAssembly = +type ImportedAssembly = { ILScopeRef: ILScopeRef FSharpViewOfMetadata: CcuThunk AssemblyAutoOpenAttributes: string list @@ -113,44 +113,46 @@ type ImportedAssembly = IsProviderGenerated: bool mutable TypeProviders: Tainted list #endif - FSharpOptimizationData: Lazy> - } + FSharpOptimizationData: Lazy> } /// Tables of assembly resolutions [] -type TcAssemblyResolutions = +type TcAssemblyResolutions = member GetAssemblyResolutions: unit -> AssemblyResolution list - static member SplitNonFoundationalResolutions: tcConfig: TcConfig -> AssemblyResolution list * AssemblyResolution list * UnresolvedAssemblyReference list + static member SplitNonFoundationalResolutions: + tcConfig: TcConfig -> AssemblyResolution list * AssemblyResolution list * UnresolvedAssemblyReference list - static member BuildFromPriorResolutions: tcConfig: TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions + static member BuildFromPriorResolutions: + tcConfig: TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions - static member GetAssemblyResolutionInformation: tcConfig: TcConfig -> AssemblyResolution list * UnresolvedAssemblyReference list + static member GetAssemblyResolutionInformation: + tcConfig: TcConfig -> AssemblyResolution list * UnresolvedAssemblyReference list [] type RawFSharpAssemblyData = - new : ilModule: ILModuleDef * ilAssemblyRefs: ILAssemblyRef list -> RawFSharpAssemblyData + new: ilModule: ILModuleDef * ilAssemblyRefs: ILAssemblyRef list -> RawFSharpAssemblyData interface IRawFSharpAssemblyData /// Represents a table of imported assemblies with their resolutions. /// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. /// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. -[] +[] type TcImports = interface IDisposable //new: TcImports option -> TcImports - member DllTable: NameMap with get + member DllTable: NameMap member GetImportedAssemblies: unit -> ImportedAssembly list member GetCcusInDeclOrder: unit -> CcuThunk list /// This excludes any framework imports (which may be shared between multiple builds) - member GetCcusExcludingBase: unit -> CcuThunk list + member GetCcusExcludingBase: unit -> CcuThunk list member FindDllInfo: CompilationThreadToken * range * string -> ImportedBinary @@ -167,10 +169,13 @@ type TcImports = member DependencyProvider: DependencyProvider /// Try to resolve a referenced assembly based on TcConfig settings. - member TryResolveAssemblyReference: CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> OperationResult + member TryResolveAssemblyReference: + CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> + OperationResult /// Resolve a referenced assembly and report an error if the resolution fails. - member ResolveAssemblyReference: CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> AssemblyResolution list + member ResolveAssemblyReference: + CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> AssemblyResolution list /// Try to find the given assembly reference by simple name. Used in magic assembly resolution. Effectively does implicit /// unification of assemblies by simple assembly name. @@ -181,7 +186,8 @@ type TcImports = #if !NO_TYPEPROVIDERS /// Try to find a provider-generated assembly - member TryFindProviderGeneratedAssemblyByName: CompilationThreadToken * assemblyName:string -> System.Reflection.Assembly option + member TryFindProviderGeneratedAssemblyByName: + CompilationThreadToken * assemblyName: string -> System.Reflection.Assembly option #endif /// Report unresolved references that also weren't consumed by any type providers. member ReportUnresolvedAssemblyReferences: UnresolvedAssemblyReference list -> unit @@ -191,24 +197,22 @@ type TcImports = member internal Base: TcImports option static member BuildFrameworkTcImports: - TcConfigProvider * - AssemblyResolution list * - AssemblyResolution list - -> NodeCode + TcConfigProvider * AssemblyResolution list * AssemblyResolution list -> NodeCode static member BuildNonFrameworkTcImports: - TcConfigProvider * - TcImports * - AssemblyResolution list * - UnresolvedAssemblyReference list * - DependencyProvider - -> NodeCode + TcConfigProvider * TcImports * AssemblyResolution list * UnresolvedAssemblyReference list * DependencyProvider -> + NodeCode static member BuildTcImports: - tcConfigP: TcConfigProvider * - dependencyProvider: DependencyProvider - -> NodeCode + tcConfigP: TcConfigProvider * dependencyProvider: DependencyProvider -> NodeCode /// Process #r in F# Interactive. /// Adds the reference to the tcImports and add the ccu to the type checking environment. -val RequireDLL: ctok: CompilationThreadToken * tcImports: TcImports * tcEnv: TcEnv * thisAssemblyName: string * referenceRange: range * file: string -> TcEnv * (ImportedBinary list * ImportedAssembly list) +val RequireDLL: + ctok: CompilationThreadToken * + tcImports: TcImports * + tcEnv: TcEnv * + thisAssemblyName: string * + referenceRange: range * + file: string -> + TcEnv * (ImportedBinary list * ImportedAssembly list) diff --git a/src/fsharp/CompilerOptions.fsi b/src/fsharp/CompilerOptions.fsi index a2f9c8cd10c..0fe1a37ae22 100644 --- a/src/fsharp/CompilerOptions.fsi +++ b/src/fsharp/CompilerOptions.fsi @@ -15,7 +15,7 @@ type OptionSwitch = /// The spec value describes the action of the argument, /// and whether it expects a following parameter. -type OptionSpec = +type OptionSpec = | OptionClear of bool ref | OptionFloat of (float -> unit) | OptionInt of (int -> unit) @@ -28,19 +28,24 @@ type OptionSpec = | OptionStringList of (string -> unit) | OptionStringListSwitch of (string -> OptionSwitch -> unit) | OptionUnit of (unit -> unit) - | OptionHelp of (CompilerOptionBlock list -> unit) // like OptionUnit, but given the "options" + | OptionHelp of (CompilerOptionBlock list -> unit) // like OptionUnit, but given the "options" | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs) -and CompilerOption = - | CompilerOption of name: string * argumentDescriptionString: string * actionSpec: OptionSpec * deprecationError: Option * helpText: string option +and CompilerOption = + | CompilerOption of + name: string * + argumentDescriptionString: string * + actionSpec: OptionSpec * + deprecationError: Option * + helpText: string option -and CompilerOptionBlock = - | PublicOptions of heading: string * options: CompilerOption list +and CompilerOptionBlock = + | PublicOptions of heading: string * options: CompilerOption list | PrivateOptions of options: CompilerOption list -val PrintCompilerOptionBlocks: CompilerOptionBlock list -> unit // for printing usage +val PrintCompilerOptionBlocks: CompilerOptionBlock list -> unit // for printing usage -val DumpCompilerOptionBlocks: CompilerOptionBlock list -> unit // for QA +val DumpCompilerOptionBlocks: CompilerOptionBlock list -> unit // for QA val FilterCompilerOptionBlock: (CompilerOption -> bool) -> CompilerOptionBlock -> CompilerOptionBlock diff --git a/src/fsharp/ConstraintSolver.fsi b/src/fsharp/ConstraintSolver.fsi index 37d86e35afd..f1c2d6a2173 100644 --- a/src/fsharp/ConstraintSolver.fsi +++ b/src/fsharp/ConstraintSolver.fsi @@ -18,7 +18,7 @@ open FSharp.Compiler.TypedTreeOps /// Create a type variable representing the use of a "_" in F# code val NewAnonTypar: TyparKind * range * TyparRigidity * TyparStaticReq * TyparDynamicReq -> Typar -/// Create an inference type variable +/// Create an inference type variable val NewInferenceType: TcGlobals -> TType /// Create an inference type variable for the kind of a byref pointer @@ -90,24 +90,21 @@ type ContextInfo = | SequenceExpression of TType /// Captures relevant information for a particular failed overload resolution. -type OverloadInformation = - { - methodSlot: CalledMeth - infoReader: InfoReader - error: exn - } +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 methodName: string - * candidates: OverloadInformation list // methodNames may be different (with operators?), this is refactored from original logic to assemble overload failure message - * cx: TraitConstraintInfo option + | NoOverloadsFound of methodName: string * candidates: OverloadInformation list * cx: TraitConstraintInfo option + | PossibleCandidates of + methodName: string * + candidates: OverloadInformation list * // methodNames may be different (with operators?), this is refactored from original logic to assemble overload failure message + cx: TraitConstraintInfo option /// Represents known information prior to checking an expression or pattern, e.g. it's expected type -type OverallTy = +type OverallTy = /// Each branch of the expression must have the type indicated | MustEqual of TType @@ -115,24 +112,72 @@ type OverallTy = | MustConvertTo of isMethodArg: bool * ty: TType /// Represents a point where no subsumption/widening is possible - member Commit: TType - -exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * 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 * exn * range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * range -exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * exn * ContextInfo * parameterRange: range -exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range -exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range -exception UnresolvedOverloading of displayEnv: DisplayEnv * callerArgs: CallerArgs * failure: OverloadResolutionFailure * range -exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range - -exception ArgDoesNotMatchError of error: ErrorsFromAddingSubsumptionConstraint * calledMeth: CalledMeth * calledArg: CalledArg * callerArg: CallerArg + member Commit: TType + +exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * 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 * exn * range + +exception ErrorFromAddingTypeEquation of + tcGlobals: TcGlobals * + displayEnv: DisplayEnv * + actualTy: TType * + expectedTy: TType * + exn * + range + +exception ErrorsFromAddingSubsumptionConstraint of + tcGlobals: TcGlobals * + displayEnv: DisplayEnv * + actualTy: TType * + expectedTy: TType * + exn * + ContextInfo * + parameterRange: range + +exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range +exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range + +exception UnresolvedOverloading of + displayEnv: DisplayEnv * + callerArgs: CallerArgs * + failure: OverloadResolutionFailure * + range + +exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range + +exception ArgDoesNotMatchError of + error: ErrorsFromAddingSubsumptionConstraint * + calledMeth: CalledMeth * + calledArg: CalledArg * + callerArg: CallerArg + /// 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 @@ -152,7 +197,7 @@ type ConstraintSolverState = val BakedInTraitConstraintNames: Set [] -type Trace +type Trace type OptionalTrace = | NoTrace @@ -161,14 +206,34 @@ type OptionalTrace = val SimplifyMeasuresInTypeScheme: TcGlobals -> bool -> Typars -> TType -> TyparConstraint list -> Typars /// The entry point to resolve the overloading for an entire call -val ResolveOverloadingForCall: DisplayEnv -> ConstraintSolverState -> range -> methodName: string -> callerArgs: CallerArgs -> AccessorDomain -> calledMethGroup: CalledMeth list -> permitOptArgs: bool -> reqdRetTy: OverallTy -> CalledMeth option * OperationResult - -val UnifyUniqueOverloading: DisplayEnv -> ConstraintSolverState -> range -> int * int -> string -> AccessorDomain -> CalledMeth list -> OverallTy -> OperationResult - -/// Remove the global constraints where these type variables appear in the support of the constraint -val EliminateConstraintsForGeneralizedTypars: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> Typars -> unit - -val CheckDeclaredTypars: DisplayEnv -> ConstraintSolverState -> range -> Typars -> Typars -> unit +val ResolveOverloadingForCall: + DisplayEnv -> + ConstraintSolverState -> + range -> + methodName: string -> + callerArgs: CallerArgs -> + AccessorDomain -> + calledMethGroup: CalledMeth list -> + permitOptArgs: bool -> + reqdRetTy: OverallTy -> + CalledMeth option * OperationResult + +val UnifyUniqueOverloading: + DisplayEnv -> + ConstraintSolverState -> + range -> + int * int -> + string -> + AccessorDomain -> + CalledMeth list -> + OverallTy -> + OperationResult + +/// Remove the global constraints where these type variables appear in the support of the constraint +val EliminateConstraintsForGeneralizedTypars: + DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> Typars -> unit + +val CheckDeclaredTypars: DisplayEnv -> ConstraintSolverState -> range -> Typars -> Typars -> unit val AddCxTypeEqualsType: ContextInfo -> DisplayEnv -> ConstraintSolverState -> range -> TType -> TType -> unit @@ -178,11 +243,13 @@ val AddCxTypeEqualsTypeUndoIfFailedOrWarnings: DisplayEnv -> ConstraintSolverSta val AddCxTypeEqualsTypeMatchingOnlyUndoIfFailed: DisplayEnv -> ConstraintSolverState -> range -> TType -> TType -> bool -val AddCxTypeMustSubsumeType: ContextInfo -> DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TType -> TType -> unit +val AddCxTypeMustSubsumeType: + ContextInfo -> DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TType -> TType -> unit val AddCxTypeMustSubsumeTypeUndoIfFailed: DisplayEnv -> ConstraintSolverState -> range -> TType -> TType -> bool -val AddCxTypeMustSubsumeTypeMatchingOnlyUndoIfFailed: DisplayEnv -> ConstraintSolverState -> range -> extraRigidTypars: FreeTypars -> TType -> TType -> bool +val AddCxTypeMustSubsumeTypeMatchingOnlyUndoIfFailed: + DisplayEnv -> ConstraintSolverState -> range -> extraRigidTypars: FreeTypars -> TType -> TType -> bool val AddCxMethodConstraint: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TraitConstraintInfo -> unit @@ -202,28 +269,43 @@ val AddCxTypeIsUnmanaged: DisplayEnv -> ConstraintSolverState -> range -> Option val AddCxTypeIsEnum: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TType -> TType -> unit -val AddCxTypeIsDelegate: DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TType -> TType -> TType -> unit +val AddCxTypeIsDelegate: + DisplayEnv -> ConstraintSolverState -> range -> OptionalTrace -> TType -> TType -> TType -> unit -val AddCxTyparDefaultsTo: DisplayEnv -> ConstraintSolverState -> range -> ContextInfo -> Typar -> int -> TType -> unit +val AddCxTyparDefaultsTo: DisplayEnv -> ConstraintSolverState -> range -> ContextInfo -> Typar -> int -> TType -> unit val SolveTypeAsError: DisplayEnv -> ConstraintSolverState -> range -> TType -> unit val ApplyTyparDefaultAtPriority: DisplayEnv -> ConstraintSolverState -> priority: int -> Typar -> unit /// Generate a witness expression if none is otherwise available, e.g. in legacy non-witness-passing code -val CodegenWitnessExprForTraitConstraint : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> Expr list -> OperationResult +val CodegenWitnessExprForTraitConstraint: + TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> Expr list -> OperationResult /// Generate the arguments passed when using a generic construct that accepts traits witnesses -val CodegenWitnessesForTyparInst : TcValF -> TcGlobals -> ImportMap -> range -> Typars -> TType list -> OperationResult list> +val CodegenWitnessesForTyparInst: + TcValF -> + TcGlobals -> + ImportMap -> + range -> + Typars -> + TType list -> + OperationResult list> /// Generate the lambda argument passed for a use of a generic construct that accepts trait witnesses -val CodegenWitnessArgForTraitConstraint : TcValF -> TcGlobals -> ImportMap -> range -> TraitConstraintInfo -> OperationResult> +val CodegenWitnessArgForTraitConstraint: + TcValF -> + TcGlobals -> + ImportMap -> + range -> + TraitConstraintInfo -> + OperationResult> /// For some code like "let f() = ([] = [])", a free choice is made for a type parameter /// for an interior type variable. This chooses a solution for a type parameter subject /// to its constraints and applies that solution by using a constraint. -val ChooseTyparSolutionAndSolve : ConstraintSolverState -> DisplayEnv -> Typar -> unit +val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> unit val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool -val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit +val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit diff --git a/src/fsharp/CreateILModule.fsi b/src/fsharp/CreateILModule.fsi index 686f587c635..e78f0d7e9f1 100644 --- a/src/fsharp/CreateILModule.fsi +++ b/src/fsharp/CreateILModule.fsi @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.CreateILModule +module internal FSharp.Compiler.CreateILModule open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL @@ -13,10 +13,10 @@ open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypedTree /// Represents the configuration settings used to perform strong-name signing -type StrongNameSigningInfo +type StrongNameSigningInfo /// Validate the attributes and configuration settings used to perform strong-name signing -val ValidateKeySigningAttributes: tcConfig:TcConfig * tcGlobals:TcGlobals * TopAttribs -> StrongNameSigningInfo +val ValidateKeySigningAttributes: tcConfig: TcConfig * tcGlobals: TcGlobals * TopAttribs -> StrongNameSigningInfo /// Get the object used to perform strong-name signing val GetStrongNameSigner: signingInfo: StrongNameSigningInfo -> ILStrongNameSigner option @@ -26,26 +26,26 @@ module AttributeHelpers = val TryFindStringAttribute: g: TcGlobals -> attrib: string -> attribs: Attribs -> string option module MainModuleBuilder = - + /// Put together all the pieces of information to create the overall IL ModuleDef for /// the generated assembly val CreateMainModule: ctok: CompilationThreadToken * - tcConfig: TcConfig * - tcGlobals: TcGlobals * - tcImports: TcImports * - pdbfile: 't option * - assemblyName: string * - outfile: string * - topAttrs: TopAttribs * + tcConfig: TcConfig * + tcGlobals: TcGlobals * + tcImports: TcImports * + pdbfile: 't option * + assemblyName: string * + outfile: string * + topAttrs: TopAttribs * sigDataAttributes: ILAttribute list * sigDataResources: ILResource list * optDataResources: ILResource list * - codegenResults: IlxGenResults * + codegenResults: IlxGenResults * assemVerFromAttrib: ILVersionInfo option * metadataVersion: string * - secDecls: ILSecurityDecls - -> ILModuleDef + secDecls: ILSecurityDecls -> + ILModuleDef /// For unit testing val fileVersion: findStringAttr: (string -> string option) -> assemblyVersion: ILVersionInfo -> ILVersionInfo diff --git a/src/fsharp/DetupleArgs.fsi b/src/fsharp/DetupleArgs.fsi index 6db0ef42b8b..3f3564b82d9 100644 --- a/src/fsharp/DetupleArgs.fsi +++ b/src/fsharp/DetupleArgs.fsi @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.Detuple +module internal FSharp.Compiler.Detuple open Internal.Utilities.Collections open FSharp.Compiler.TcGlobals @@ -8,30 +8,28 @@ open FSharp.Compiler.TypedTree val DetupleImplFile: CcuThunk -> TcGlobals -> TypedImplFile -> TypedImplFile -module GlobalUsageAnalysis = +module GlobalUsageAnalysis = val GetValsBoundInExpr: Expr -> Zset - type accessor + type accessor type Results = - { - /// v -> context / APP inst args - Uses: Zmap + { /// v -> context / APP inst args + Uses: Zmap - /// v -> binding repr - Defns: Zmap + /// v -> binding repr + Defns: Zmap - /// bound in a decision tree? - DecisionTreeBindings: Zset + /// bound in a decision tree? + DecisionTreeBindings: Zset - /// v -> recursive? * v list -- the others in the mutual binding - RecursiveBindings: Zmap + /// v -> recursive? * v list -- the others in the mutual binding + RecursiveBindings: Zmap - /// val not defined under lambdas - TopLevelBindings: Zset + /// val not defined under lambdas + TopLevelBindings: Zset - /// top of expr toplevel? (true) - IterationIsAtTopLevel: bool - } + /// top of expr toplevel? (true) + IterationIsAtTopLevel: bool } val GetUsageInfoOfImplFile: TcGlobals -> TypedImplFile -> Results diff --git a/src/fsharp/Diagnostics.fsi b/src/fsharp/Diagnostics.fsi index b1dc86be20b..ce66bf03080 100644 --- a/src/fsharp/Diagnostics.fsi +++ b/src/fsharp/Diagnostics.fsi @@ -7,10 +7,10 @@ namespace FSharp.Compiler.Diagnostics [] -type FSharpDiagnosticSeverity = +type FSharpDiagnosticSeverity = | Hidden | Info - | Warning + | Warning | Error type FSharpDiagnosticOptions = @@ -22,4 +22,3 @@ type FSharpDiagnosticOptions = WarnAsWarn: int list } static member Default: FSharpDiagnosticOptions - diff --git a/src/fsharp/ErrorLogger.fsi b/src/fsharp/ErrorLogger.fsi index 06725175c1b..a189c7fb488 100644 --- a/src/fsharp/ErrorLogger.fsi +++ b/src/fsharp/ErrorLogger.fsi @@ -28,7 +28,7 @@ exception WrappedError of exn * range /// when a lazy thunk is re-evaluated. exception ReportedError of exn option -val findOriginalException: err:exn -> exn +val findOriginalException: err: exn -> exn type Suggestions = (string -> unit) -> unit @@ -37,7 +37,7 @@ val NoSuggestions: Suggestions /// Thrown when we stop processing the F# Interactive entry or #load. exception StopProcessingExn of exn option -val ( |StopProcessing|_| ): exn:exn -> unit option +val (|StopProcessing|_|): exn: exn -> unit option val StopProcessing<'T> : exn @@ -65,17 +65,17 @@ exception UnresolvedPathReference of string * string * range exception ErrorWithSuggestions of (int * string) * range * string * Suggestions -val inline protectAssemblyExploration: dflt:'a -> f:(unit -> 'a) -> 'a +val inline protectAssemblyExploration: dflt: 'a -> f: (unit -> 'a) -> 'a -val inline protectAssemblyExplorationF: dflt:(string * string -> 'a) -> f:(unit -> 'a) -> 'a +val inline protectAssemblyExplorationF: dflt: (string * string -> 'a) -> f: (unit -> 'a) -> 'a -val inline protectAssemblyExplorationNoReraise: dflt1:'a -> dflt2:'a -> f:(unit -> 'a) -> 'a +val inline protectAssemblyExplorationNoReraise: dflt1: 'a -> dflt2: 'a -> f: (unit -> 'a) -> 'a -val AttachRange: m:range -> exn:exn -> exn +val AttachRange: m: range -> exn: exn -> exn type Exiter = - abstract member Exit: int -> 'T - + abstract member Exit: int -> 'T + val QuitProcessExiter: Exiter /// Closed enumeration of build phases. @@ -95,34 +95,57 @@ type BuildPhase = /// Literal build phase subcategory strings. module BuildPhaseSubcategory = - [] val DefaultPhase: string = "" - [] val Compile: string = "compile" - [] val Parameter: string = "parameter" - [] val Parse: string = "parse" - [] val TypeCheck: string = "typecheck" - [] val CodeGen: string = "codegen" - [] val Optimize: string = "optimize" - [] val IlxGen: string = "ilxgen" - [] val IlGen: string = "ilgen" - [] val Output: string = "output" - [] val Interactive: string = "interactive" - [] val Internal: string = "internal" + [] + val DefaultPhase: string = "" + + [] + val Compile: string = "compile" + + [] + val Parameter: string = "parameter" + + [] + val Parse: string = "parse" + + [] + val TypeCheck: string = "typecheck" + + [] + val CodeGen: string = "codegen" + + [] + val Optimize: string = "optimize" + + [] + val IlxGen: string = "ilxgen" + + [] + val IlGen: string = "ilgen" + + [] + val Output: string = "output" + + [] + val Interactive: string = "interactive" + + [] + val Internal: string = "internal" type PhasedDiagnostic = { Exception: exn Phase: BuildPhase } /// Construct a phased error - static member Create: exn:exn * phase:BuildPhase -> PhasedDiagnostic + static member Create: exn: exn * phase: BuildPhase -> PhasedDiagnostic /// Return true if the textual phase given is from the compile part of the build process. - /// This set needs to be equal to the set of subcategories that the language service can produce. - static member IsSubcategoryOfCompile: subcategory:string -> bool + /// This set needs to be equal to the set of subcategories that the language service can produce. + static member IsSubcategoryOfCompile: subcategory: string -> bool member DebugDisplay: unit -> string /// Return true if this phase is one that's known to be part of the 'compile'. This is the initial phase of the entire compilation that - /// the language service knows about. + /// the language service knows about. member IsPhaseInCompile: unit -> bool /// This is the textual subcategory to display in error and warning messages (shows only under --vserrors): @@ -130,18 +153,18 @@ type PhasedDiagnostic = /// file1.fs(72): subcategory warning FS0072: This is a warning message /// member Subcategory: unit -> string - + [] type ErrorLogger = - new: nameForDebugging:string -> ErrorLogger + new: nameForDebugging: string -> ErrorLogger member DebugDisplay: unit -> string - abstract member DiagnosticSink: phasedError:PhasedDiagnostic * severity:FSharpDiagnosticSeverity -> unit + abstract member DiagnosticSink: phasedError: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit abstract member ErrorCount: int - + val DiscardErrorsLogger: ErrorLogger val AssertFalseErrorLogger: ErrorLogger @@ -149,98 +172,98 @@ val AssertFalseErrorLogger: ErrorLogger type CapturingErrorLogger = inherit ErrorLogger - new: nm:string -> CapturingErrorLogger + new: nm: string -> CapturingErrorLogger - member CommitDelayedDiagnostics: errorLogger:ErrorLogger -> unit + member CommitDelayedDiagnostics: errorLogger: ErrorLogger -> unit - override DiagnosticSink: phasedError:PhasedDiagnostic * severity:FSharpDiagnosticSeverity -> unit + override DiagnosticSink: phasedError: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit member Diagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list override ErrorCount: int - + [] type CompileThreadStatic = static member BuildPhase: BuildPhase with get, set - static member BuildPhaseUnchecked: BuildPhase with get + static member BuildPhaseUnchecked: BuildPhase static member ErrorLogger: ErrorLogger with get, set - + [] module ErrorLoggerExtensions = val tryAndDetectDev15: bool /// Instruct the exception not to reset itself when thrown again. - val PreserveStackTrace: exn:'a -> unit + val PreserveStackTrace: exn: 'a -> unit /// Reraise an exception if it is one we want to report to Watson. - val ReraiseIfWatsonable: exn:exn -> unit + val ReraiseIfWatsonable: exn: exn -> unit type ErrorLogger with - member ErrorR: exn:exn -> unit - member Warning: exn:exn -> unit - member Error: exn:exn -> 'b - member SimulateError: ph:PhasedDiagnostic -> 'a - member ErrorRecovery: exn:exn -> m:range -> unit - member StopProcessingRecovery: exn:exn -> m:range -> unit - member ErrorRecoveryNoRange: exn:exn -> unit + member ErrorR: exn: exn -> unit + member Warning: exn: exn -> unit + member Error: exn: exn -> 'b + member SimulateError: ph: PhasedDiagnostic -> 'a + member ErrorRecovery: exn: exn -> m: range -> unit + member StopProcessingRecovery: exn: exn -> m: range -> unit + member ErrorRecoveryNoRange: exn: exn -> unit /// NOTE: The change will be undone when the returned "unwind" object disposes -val PushThreadBuildPhaseUntilUnwind: phase:BuildPhase -> IDisposable +val PushThreadBuildPhaseUntilUnwind: phase: BuildPhase -> IDisposable /// NOTE: The change will be undone when the returned "unwind" object disposes -val PushErrorLoggerPhaseUntilUnwind: errorLoggerTransformer:(ErrorLogger -> #ErrorLogger) -> IDisposable +val PushErrorLoggerPhaseUntilUnwind: errorLoggerTransformer: (ErrorLogger -> #ErrorLogger) -> IDisposable -val SetThreadBuildPhaseNoUnwind: phase:BuildPhase -> unit +val SetThreadBuildPhaseNoUnwind: phase: BuildPhase -> unit -val SetThreadErrorLoggerNoUnwind: errorLogger:ErrorLogger -> unit +val SetThreadErrorLoggerNoUnwind: errorLogger: ErrorLogger -> unit /// Reports an error diagnostic and continues -val errorR: exn:exn -> unit +val errorR: exn: exn -> unit /// Reports a warning diagnostic -val warning: exn:exn -> unit +val warning: exn: exn -> unit /// Reports an error and raises a ReportedError exception -val error: exn:exn -> 'a +val error: exn: exn -> 'a /// Reports an informational diagnostic -val informationalWarning: exn:exn -> unit +val informationalWarning: exn: exn -> unit -val simulateError: p:PhasedDiagnostic -> 'a +val simulateError: p: PhasedDiagnostic -> 'a -val diagnosticSink: phasedError:PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit +val diagnosticSink: phasedError: PhasedDiagnostic * severity: FSharpDiagnosticSeverity -> unit -val errorSink: pe:PhasedDiagnostic -> unit +val errorSink: pe: PhasedDiagnostic -> unit -val warnSink: pe:PhasedDiagnostic -> unit +val warnSink: pe: PhasedDiagnostic -> unit -val errorRecovery: exn:exn -> m:range -> unit +val errorRecovery: exn: exn -> m: range -> unit -val stopProcessingRecovery: exn:exn -> m:range -> unit +val stopProcessingRecovery: exn: exn -> m: range -> unit -val errorRecoveryNoRange: exn:exn -> unit +val errorRecoveryNoRange: exn: exn -> unit -val report: f:(unit -> 'a) -> 'a +val report: f: (unit -> 'a) -> 'a -val deprecatedWithError: s:string -> m:range -> unit +val deprecatedWithError: s: string -> m: range -> unit -val libraryOnlyError: m:range -> unit +val libraryOnlyError: m: range -> unit -val libraryOnlyWarning: m:range -> unit +val libraryOnlyWarning: m: range -> unit -val deprecatedOperator: m:range -> unit +val deprecatedOperator: m: range -> unit -val mlCompatWarning: s:string -> m:range -> unit +val mlCompatWarning: s: string -> m: range -> unit -val mlCompatError: s:string -> m:range -> unit +val mlCompatError: s: string -> m: range -> unit -val suppressErrorReporting: f:(unit -> 'a) -> 'a +val suppressErrorReporting: f: (unit -> 'a) -> 'a -val conditionallySuppressErrorReporting: cond:bool -> f:(unit -> 'a) -> 'a +val conditionallySuppressErrorReporting: cond: bool -> f: (unit -> 'a) -> 'a /// The result type of a computational modality to colelct warnings and possibly fail [] @@ -250,94 +273,103 @@ type OperationResult<'T> = type ImperativeOperationResult = OperationResult -val ReportWarnings: warns:#exn list -> unit +val ReportWarnings: warns: #exn list -> unit -val CommitOperationResult: res:OperationResult<'a> -> 'a +val CommitOperationResult: res: OperationResult<'a> -> 'a -val RaiseOperationResult: res:OperationResult -> unit +val RaiseOperationResult: res: OperationResult -> unit -val ErrorD: err:exn -> OperationResult<'a> +val ErrorD: err: exn -> OperationResult<'a> -val WarnD: err:exn -> OperationResult +val WarnD: err: exn -> OperationResult val CompleteD: OperationResult -val ResultD: x:'a -> OperationResult<'a> +val ResultD: x: 'a -> OperationResult<'a> -val CheckNoErrorsAndGetWarnings: res:OperationResult<'a> -> (exn list * 'a) option +val CheckNoErrorsAndGetWarnings: res: OperationResult<'a> -> (exn list * 'a) option -val ( ++ ): res:OperationResult<'a> -> f:('a -> OperationResult<'b>) -> OperationResult<'b> +val (++): res: OperationResult<'a> -> f: ('a -> OperationResult<'b>) -> OperationResult<'b> -/// Stop on first error. Accumulate warnings and continue. -val IterateD: f:('a -> OperationResult) -> xs:'a list -> OperationResult +/// Stop on first error. Accumulate warnings and continue. +val IterateD: f: ('a -> OperationResult) -> xs: 'a list -> OperationResult -val WhileD: gd:(unit -> bool) -> body:(unit -> OperationResult) -> OperationResult +val WhileD: gd: (unit -> bool) -> body: (unit -> OperationResult) -> OperationResult -val MapD: f:('a -> OperationResult<'b>) -> xs:'a list -> OperationResult<'b list> +val MapD: f: ('a -> OperationResult<'b>) -> xs: 'a list -> OperationResult<'b list> type TrackErrorsBuilder = new: unit -> TrackErrorsBuilder - member Bind: res:OperationResult<'h> * k:('h -> OperationResult<'i>) -> OperationResult<'i> + member Bind: res: OperationResult<'h> * k: ('h -> OperationResult<'i>) -> OperationResult<'i> - member Combine: expr1:OperationResult<'c> * expr2:('c -> OperationResult<'d>) -> OperationResult<'d> + member Combine: expr1: OperationResult<'c> * expr2: ('c -> OperationResult<'d>) -> OperationResult<'d> - member Delay: fn:(unit -> 'b) -> (unit -> 'b) + member Delay: fn: (unit -> 'b) -> (unit -> 'b) - member For: seq:'e list * k:('e -> OperationResult) -> OperationResult + member For: seq: 'e list * k: ('e -> OperationResult) -> OperationResult - member Return: res:'g -> OperationResult<'g> + member Return: res: 'g -> OperationResult<'g> - member ReturnFrom: res:'f -> 'f + member ReturnFrom: res: 'f -> 'f - member Run: fn:(unit -> 'a) -> 'a + member Run: fn: (unit -> 'a) -> 'a - member While: gd:(unit -> bool) * k:(unit -> OperationResult) -> OperationResult + member While: gd: (unit -> bool) * k: (unit -> OperationResult) -> OperationResult member Zero: unit -> OperationResult - + val trackErrors: TrackErrorsBuilder -val OptionD: f:('a -> OperationResult) -> xs:'a option -> OperationResult +val OptionD: f: ('a -> OperationResult) -> xs: 'a option -> OperationResult -val IterateIdxD: f:(int -> 'a -> OperationResult) -> xs:'a list -> OperationResult +val IterateIdxD: f: (int -> 'a -> OperationResult) -> xs: 'a list -> OperationResult -/// Stop on first error. Accumulate warnings and continue. -val Iterate2D: f:('a -> 'b -> OperationResult) -> xs:'a list -> ys:'b list -> OperationResult +/// Stop on first error. Accumulate warnings and continue. +val Iterate2D: f: ('a -> 'b -> OperationResult) -> xs: 'a list -> ys: 'b list -> OperationResult -val TryD: f:(unit -> OperationResult<'a>) -> g:(exn -> OperationResult<'a>) -> OperationResult<'a> +val TryD: f: (unit -> OperationResult<'a>) -> g: (exn -> OperationResult<'a>) -> OperationResult<'a> -val RepeatWhileD: nDeep:int -> body:(int -> OperationResult) -> OperationResult +val RepeatWhileD: nDeep: int -> body: (int -> OperationResult) -> OperationResult -val inline AtLeastOneD: f:('a -> OperationResult) -> l:'a list -> OperationResult +val inline AtLeastOneD: f: ('a -> OperationResult) -> l: 'a list -> OperationResult -val inline AtLeastOne2D: f:('a -> 'b -> OperationResult) -> xs:'a list -> ys:'b list -> OperationResult +val inline AtLeastOne2D: f: ('a -> 'b -> OperationResult) -> xs: 'a list -> ys: 'b list -> OperationResult -val inline MapReduceD: mapper:('a -> OperationResult<'b>) -> zero: 'b -> reducer: ('b -> 'b -> 'b) -> l:'a list -> OperationResult<'b> +val inline MapReduceD: + mapper: ('a -> OperationResult<'b>) -> zero: 'b -> reducer: ('b -> 'b -> 'b) -> l: 'a list -> OperationResult<'b> -val inline MapReduce2D: mapper:('a -> 'b -> OperationResult<'c>) -> zero: 'c -> reducer: ('c -> 'c -> 'c) -> xs:'a list -> ys:'b list -> OperationResult<'c> +val inline MapReduce2D: + mapper: ('a -> 'b -> OperationResult<'c>) -> + zero: 'c -> + reducer: ('c -> 'c -> 'c) -> + xs: 'a list -> + ys: 'b list -> + OperationResult<'c> module OperationResult = - val inline ignore: res:OperationResult<'a> -> OperationResult + val inline ignore: res: OperationResult<'a> -> OperationResult // For --flaterrors flag that is only used by the IDE val stringThatIsAProxyForANewlineInFlatErrors: String -val NewlineifyErrorString: message:string -> string +val NewlineifyErrorString: message: string -> string /// fixes given string by replacing all control chars with spaces. -/// NOTE: newlines are recognized and replaced with stringThatIsAProxyForANewlineInFlatErrors (ASCII 29, the 'group separator'), +/// NOTE: newlines are recognized and replaced with stringThatIsAProxyForANewlineInFlatErrors (ASCII 29, the 'group separator'), /// which is decoded by the IDE with 'NewlineifyErrorString' back into newlines, so that multi-line errors can be displayed in QuickInfo -val NormalizeErrorString: text:string -> string - -val checkLanguageFeatureError: langVersion:LanguageVersion -> langFeature:LanguageFeature -> m:range -> unit +val NormalizeErrorString: text: string -> string -val checkLanguageFeatureErrorRecover: langVersion:LanguageVersion -> langFeature:LanguageFeature -> m:range -> unit +val checkLanguageFeatureError: langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> unit -val tryLanguageFeatureErrorOption: langVersion:LanguageVersion -> langFeature:LanguageFeature -> m:range -> exn option +val checkLanguageFeatureErrorRecover: langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> unit -val languageFeatureNotSupportedInLibraryError: langVersion:LanguageVersion -> langFeature:LanguageFeature -> m:range -> 'a +val tryLanguageFeatureErrorOption: + langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> exn option + +val languageFeatureNotSupportedInLibraryError: + langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> 'a type StackGuard = new: maxDepth: int -> StackGuard @@ -358,4 +390,3 @@ type CompilationGlobalsScope = member ErrorLogger: ErrorLogger member BuildPhase: BuildPhase - diff --git a/src/fsharp/ErrorResolutionHints.fsi b/src/fsharp/ErrorResolutionHints.fsi index bddc8db70ca..5d1ee7b27d8 100644 --- a/src/fsharp/ErrorResolutionHints.fsi +++ b/src/fsharp/ErrorResolutionHints.fsi @@ -8,19 +8,19 @@ open System.Collections.Generic /// We report a candidate if its edit distance is <= the threshold. /// The threshold is set to about a quarter of the number of characters. -val IsInEditDistanceProximity: idText:string -> suggestion:string -> bool +val IsInEditDistanceProximity: idText: string -> suggestion: string -> bool /// Demangles a suggestion -val DemangleOperator: nm:string -> string +val DemangleOperator: nm: string -> string type SuggestionBuffer = interface IEnumerable interface IEnumerable - new: idText:string -> SuggestionBuffer + new: idText: string -> SuggestionBuffer - member Add: suggestion:string -> unit + member Add: suggestion: string -> unit member Disabled: bool diff --git a/src/fsharp/ExtensionTyping.fsi b/src/fsharp/ExtensionTyping.fsi index 24a426bfc44..869fe863266 100755 --- a/src/fsharp/ExtensionTyping.fsi +++ b/src/fsharp/ExtensionTyping.fsi @@ -17,10 +17,10 @@ module internal ExtensionTyping = type TypeProviderDesignation = TypeProviderDesignation of string - /// Raised when a type provider has thrown an exception. + /// Raised when a type provider has thrown an exception. exception ProvidedTypeResolution of range * exn - /// Raised when an type provider has thrown an exception. + /// Raised when an type provider has thrown an exception. exception ProvidedTypeResolutionNoRange of exn /// Get the list of relative paths searched for type provider design-time components @@ -28,50 +28,49 @@ module internal ExtensionTyping = /// 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. - resolutionFolder: string + { /// The folder from which an extension provider is resolving from. This is typically the project folder. + resolutionFolder: string - /// Output file name - outputFile: string option + /// Output file name + outputFile: string option - /// Whether or not the --showextensionresolution flag was supplied to the compiler. - showResolutionMessages: bool - - /// All referenced assemblies, including the type provider itself, and possibly other type providers. - referencedAssemblies: string[] + /// Whether or not the --showextensionresolution flag was supplied to the compiler. + showResolutionMessages: bool - /// The folder for temporary files - temporaryFolder: string - } + /// All referenced assemblies, including the type provider itself, and possibly other type providers. + referencedAssemblies: string [] + + /// The folder for temporary files + temporaryFolder: string } /// Find and instantiate the set of ITypeProvider components for the given assembly reference - val GetTypeProvidersOfAssembly: - runtimeAssemblyFilename: string * - ilScopeRefOfRuntimeAssembly:ILScopeRef * - designTimeName: string * - resolutionEnvironment: ResolutionEnvironment * - isInvalidationSupported: bool * - isInteractive: bool * - systemRuntimeContainsType: (string -> bool) * - systemRuntimeAssemblyVersion: Version * - compilerToolPaths: string list * - range -> Tainted list + val GetTypeProvidersOfAssembly: + runtimeAssemblyFilename: string * + ilScopeRefOfRuntimeAssembly: ILScopeRef * + designTimeName: string * + resolutionEnvironment: ResolutionEnvironment * + isInvalidationSupported: bool * + isInteractive: bool * + systemRuntimeContainsType: (string -> bool) * + systemRuntimeAssemblyVersion: Version * + compilerToolPaths: string list * + range -> + Tainted list /// Given an extension type resolver, supply a human-readable name suitable for error messages. val DisplayNameOfTypeProvider: Tainted * range -> string - /// The context used to interpret information in the closure of System.Type, System.MethodInfo and other - /// info objects coming from the type provider. - /// - /// At the moment this is the "Type --> ILTypeRef" and "Type --> Tycon" remapping - /// context for generated types (it is empty for erased types). This is computed from - /// while processing the [] declaration related to the type. - /// - /// Immutable (after type generation for a [] declaration populates the dictionaries). - /// - /// 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. + /// The context used to interpret information in the closure of System.Type, System.MethodInfo and other + /// info objects coming from the type provider. + /// + /// At the moment this is the "Type --> ILTypeRef" and "Type --> Tycon" remapping + /// context for generated types (it is empty for erased types). This is computed from + /// while processing the [] declaration related to the type. + /// + /// Immutable (after type generation for a [] declaration populates the dictionaries). + /// + /// 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 = @@ -79,16 +78,20 @@ module internal ExtensionTyping = member TryGetTyconRef: ProvidedType -> obj option - static member Empty: ProvidedTypeContext + static member Empty: ProvidedTypeContext - static member Create: ConcurrentDictionary * ConcurrentDictionary -> ProvidedTypeContext + static member Create: + ConcurrentDictionary * ConcurrentDictionary -> + ProvidedTypeContext - member GetDictionaries: unit -> ConcurrentDictionary * ConcurrentDictionary + member GetDictionaries: + unit -> + ConcurrentDictionary * ConcurrentDictionary /// Map the TyconRef objects, if any - member RemapTyconRefs: (obj -> obj) -> ProvidedTypeContext + member RemapTyconRefs: (obj -> obj) -> ProvidedTypeContext - [] + [] type ProvidedType = inherit ProvidedMemberInfo member IsSuppressRelocate: bool @@ -97,21 +100,21 @@ module internal ExtensionTyping = member Namespace: string member FullName: string member IsArray: bool - member GetInterfaces: unit -> ProvidedType[] + member GetInterfaces: unit -> ProvidedType [] member Assembly: ProvidedAssembly member BaseType: ProvidedType member GetNestedType: string -> ProvidedType - member GetNestedTypes: unit -> ProvidedType[] - member GetAllNestedTypes: unit -> ProvidedType[] - member GetMethods: unit -> ProvidedMethodInfo[] - member GetFields: unit -> ProvidedFieldInfo[] + member GetNestedTypes: unit -> ProvidedType [] + member GetAllNestedTypes: unit -> ProvidedType [] + member GetMethods: unit -> ProvidedMethodInfo [] + member GetFields: unit -> ProvidedFieldInfo [] member GetField: string -> ProvidedFieldInfo - member GetProperties: unit -> ProvidedPropertyInfo[] + member GetProperties: unit -> ProvidedPropertyInfo [] member GetProperty: string -> ProvidedPropertyInfo - member GetEvents: unit -> ProvidedEventInfo[] + member GetEvents: unit -> ProvidedEventInfo [] member GetEvent: string -> ProvidedEventInfo - member GetConstructors: unit -> ProvidedConstructorInfo[] - member GetStaticParameters: ITypeProvider -> ProvidedParameterInfo[] + member GetConstructors: unit -> ProvidedConstructorInfo [] + member GetStaticParameters: ITypeProvider -> ProvidedParameterInfo [] member GetGenericTypeDefinition: unit -> ProvidedType member IsVoid: bool member IsGenericParameter: bool @@ -128,7 +131,7 @@ module internal ExtensionTyping = member IsNestedPublic: bool member GenericParameterPosition: int member GetElementType: unit -> ProvidedType - member GetGenericArguments: unit -> ProvidedType[] + member GetGenericArguments: unit -> ProvidedType [] member GetArrayRank: unit -> int member RawSystemType: Type member GetEnumUnderlyingType: unit -> ProvidedType @@ -136,39 +139,40 @@ module internal ExtensionTyping = member MakeByRefType: unit -> ProvidedType member MakeArrayType: unit -> ProvidedType member MakeArrayType: rank: int -> ProvidedType - member MakeGenericType: args: ProvidedType[] -> ProvidedType + member MakeGenericType: args: ProvidedType [] -> ProvidedType member AsProvidedVar: name: string -> ProvidedVar static member Void: ProvidedType static member CreateNoContext: Type -> ProvidedType member TryGetILTypeRef: unit -> ILTypeRef option member TryGetTyconRef: unit -> obj option static member ApplyContext: ProvidedType * ProvidedTypeContext -> ProvidedType - member Context: ProvidedTypeContext + member Context: ProvidedTypeContext interface IProvidedCustomAttributeProvider - static member TaintedEquals: Tainted * Tainted -> bool + static member TaintedEquals: Tainted * Tainted -> bool - [] + [] type IProvidedCustomAttributeProvider = - abstract GetHasTypeProviderEditorHideMethodsAttribute: provider:ITypeProvider -> bool - abstract GetDefinitionLocationAttribute: provider:ITypeProvider -> (string * int * int) option - abstract GetXmlDocAttributes: provider:ITypeProvider -> string[] - abstract GetAttributeConstructorArgs: provider:ITypeProvider * attribName:string -> (obj option list * (string * obj option) list) option - - [] - type ProvidedAssembly = + abstract GetHasTypeProviderEditorHideMethodsAttribute: provider: ITypeProvider -> bool + abstract GetDefinitionLocationAttribute: provider: ITypeProvider -> (string * int * int) option + abstract GetXmlDocAttributes: provider: ITypeProvider -> string [] + abstract GetAttributeConstructorArgs: + provider: ITypeProvider * attribName: string -> (obj option list * (string * obj option) list) option + + [] + type ProvidedAssembly = member GetName: unit -> System.Reflection.AssemblyName member FullName: string - member GetManifestModuleContents: ITypeProvider -> byte[] + member GetManifestModuleContents: ITypeProvider -> byte [] member Handle: System.Reflection.Assembly - [] - type ProvidedMemberInfo = - member Name :string + [] + type ProvidedMemberInfo = + member Name: string member DeclaringType: ProvidedType - interface IProvidedCustomAttributeProvider + interface IProvidedCustomAttributeProvider - [] - type ProvidedMethodBase = + [] + type ProvidedMethodBase = inherit ProvidedMemberInfo member IsGenericMethod: bool member IsStatic: bool @@ -181,20 +185,20 @@ module internal ExtensionTyping = member IsAbstract: bool member IsHideBySig: bool member IsConstructor: bool - member GetParameters: unit -> ProvidedParameterInfo[] - member GetGenericArguments: unit -> ProvidedType[] - member GetStaticParametersForMethod: ITypeProvider -> ProvidedParameterInfo[] + member GetParameters: unit -> ProvidedParameterInfo [] + member GetGenericArguments: unit -> ProvidedType [] + member GetStaticParametersForMethod: ITypeProvider -> ProvidedParameterInfo [] static member TaintedGetHashCode: Tainted -> int - static member TaintedEquals: Tainted * Tainted -> bool + static member TaintedEquals: Tainted * Tainted -> bool - [] - type ProvidedMethodInfo = + [] + type ProvidedMethodInfo = inherit ProvidedMethodBase member ReturnType: ProvidedType member MetadataToken: int - [] - type ProvidedParameterInfo = + [] + type ProvidedParameterInfo = member Name: string member ParameterType: ProvidedType member IsIn: bool @@ -202,10 +206,10 @@ module internal ExtensionTyping = member IsOptional: bool member RawDefaultValue: obj member HasDefaultValue: bool - interface IProvidedCustomAttributeProvider + interface IProvidedCustomAttributeProvider - [] - type ProvidedFieldInfo = + [] + type ProvidedFieldInfo = inherit ProvidedMemberInfo member IsInitOnly: bool member IsStatic: bool @@ -218,50 +222,50 @@ module internal ExtensionTyping = member IsFamilyAndAssembly: bool member IsFamilyOrAssembly: bool member IsPrivate: bool - static member TaintedEquals: Tainted * Tainted -> bool + static member TaintedEquals: Tainted * Tainted -> bool - [] - type ProvidedPropertyInfo = + [] + type ProvidedPropertyInfo = inherit ProvidedMemberInfo member GetGetMethod: unit -> ProvidedMethodInfo member GetSetMethod: unit -> ProvidedMethodInfo - member GetIndexParameters: unit -> ProvidedParameterInfo[] + member GetIndexParameters: unit -> ProvidedParameterInfo [] member CanRead: bool member CanWrite: bool member PropertyType: ProvidedType static member TaintedGetHashCode: Tainted -> int - static member TaintedEquals: Tainted * Tainted -> bool + static member TaintedEquals: Tainted * Tainted -> bool - [] - type ProvidedEventInfo = + [] + type ProvidedEventInfo = inherit ProvidedMemberInfo member GetAddMethod: unit -> ProvidedMethodInfo member GetRemoveMethod: unit -> ProvidedMethodInfo member EventHandlerType: ProvidedType static member TaintedGetHashCode: Tainted -> int - static member TaintedEquals: Tainted * Tainted -> bool + static member TaintedEquals: Tainted * Tainted -> bool - [] - type ProvidedConstructorInfo = + [] + type ProvidedConstructorInfo = inherit ProvidedMethodBase - + type ProvidedExprType = - | ProvidedNewArrayExpr of ProvidedType * ProvidedExpr[] + | ProvidedNewArrayExpr of ProvidedType * ProvidedExpr [] #if PROVIDED_ADDRESS_OF | ProvidedAddressOfExpr of ProvidedExpr #endif - | ProvidedNewObjectExpr of ProvidedConstructorInfo * ProvidedExpr[] + | ProvidedNewObjectExpr of ProvidedConstructorInfo * ProvidedExpr [] | ProvidedWhileLoopExpr of ProvidedExpr * ProvidedExpr - | ProvidedNewDelegateExpr of ProvidedType * ProvidedVar[] * ProvidedExpr + | ProvidedNewDelegateExpr of ProvidedType * ProvidedVar [] * ProvidedExpr | ProvidedForIntegerRangeLoopExpr of ProvidedVar * ProvidedExpr * ProvidedExpr * ProvidedExpr | ProvidedSequentialExpr of ProvidedExpr * ProvidedExpr | ProvidedTryWithExpr of ProvidedExpr * ProvidedVar * ProvidedExpr * ProvidedVar * ProvidedExpr | ProvidedTryFinallyExpr of ProvidedExpr * ProvidedExpr | ProvidedLambdaExpr of ProvidedVar * ProvidedExpr - | ProvidedCallExpr of ProvidedExpr option * ProvidedMethodInfo * ProvidedExpr[] + | ProvidedCallExpr of ProvidedExpr option * ProvidedMethodInfo * ProvidedExpr [] | ProvidedConstantExpr of obj * ProvidedType | ProvidedDefaultExpr of ProvidedType - | ProvidedNewTupleExpr of ProvidedExpr[] + | ProvidedNewTupleExpr of ProvidedExpr [] | ProvidedTupleGetExpr of ProvidedExpr * int | ProvidedTypeAsExpr of ProvidedExpr * ProvidedType | ProvidedTypeTestExpr of ProvidedExpr * ProvidedType @@ -269,7 +273,7 @@ module internal ExtensionTyping = | ProvidedVarSetExpr of ProvidedVar * ProvidedExpr | ProvidedIfThenElseExpr of ProvidedExpr * ProvidedExpr * ProvidedExpr | ProvidedVarExpr of ProvidedVar - + [] type ProvidedExpr = member Type: ProvidedType @@ -286,54 +290,62 @@ module internal ExtensionTyping = override GetHashCode: unit -> int /// Get the provided expression for a particular use of a method. - val GetInvokerExpression: ITypeProvider * ProvidedMethodBase * ProvidedVar[] -> ProvidedExpr + val GetInvokerExpression: ITypeProvider * ProvidedMethodBase * ProvidedVar [] -> ProvidedExpr /// Validate that the given provided type meets some of the rules for F# provided types - val ValidateProvidedTypeAfterStaticInstantiation: range * Tainted * expectedPath: string[] * expectedName: string-> unit + val ValidateProvidedTypeAfterStaticInstantiation: + range * Tainted * expectedPath: string [] * expectedName: string -> unit - /// Try to apply a provided type to the given static arguments. If successful also return a function + /// Try to apply a provided type to the given static arguments. If successful also return a function /// to check the type name is as expected (this function is called by the caller of TryApplyProvidedType /// after other checks are made). - val TryApplyProvidedType: typeBeforeArguments:Tainted * optGeneratedTypePath: string list option * staticArgs:obj[] * range -> (Tainted * (unit -> unit)) option + val TryApplyProvidedType: + typeBeforeArguments: Tainted * + optGeneratedTypePath: string list option * + staticArgs: obj [] * + range -> + (Tainted * (unit -> unit)) option - /// Try to apply a provided method to the given static arguments. - val TryApplyProvidedMethod: methBeforeArgs:Tainted * staticArgs:obj[] * range -> Tainted option + /// Try to apply a provided method to the given static arguments. + val TryApplyProvidedMethod: + methBeforeArgs: Tainted * staticArgs: obj [] * range -> Tainted option /// Try to resolve a type in the given extension type resolver - val TryResolveProvidedType: Tainted * range * string[] * typeName: string -> Tainted option + val TryResolveProvidedType: + Tainted * range * string [] * typeName: string -> Tainted option /// Try to resolve a type in the given extension type resolver - val TryLinkProvidedType: Tainted * string[] * typeLogicalName: string * range: range -> Tainted option + val TryLinkProvidedType: + Tainted * string [] * typeLogicalName: string * range: range -> Tainted option /// Get the parts of a .NET namespace. Special rules: null means global, empty is not allowed. val GetProvidedNamespaceAsPath: range * Tainted * string -> string list /// Decompose the enclosing name of a type (including any class nestings) into a list of parts. /// e.g. System.Object -> ["System"; "Object"] - val GetFSharpPathToProvidedType: Tainted * range:range-> string list - + val GetFSharpPathToProvidedType: Tainted * range: range -> string list + /// Get the ILTypeRef for the provided type (including for nested types). Take into account /// any type relocations or static linking for generated types. - val GetILTypeRefOfProvidedType: Tainted * range:range -> ILTypeRef + val GetILTypeRefOfProvidedType: Tainted * range: range -> ILTypeRef /// Get the ILTypeRef for the provided type (including for nested types). Do not take into account /// any type relocations or static linking for generated types. - val GetOriginalILTypeRefOfProvidedType: Tainted * range:range -> ILTypeRef + val GetOriginalILTypeRefOfProvidedType: Tainted * range: range -> ILTypeRef /// Represents the remapping information for a generated provided type and its nested types. /// /// There is one overall tree for each root 'type X = ... type generation expr...' specification. - type ProviderGeneratedType = ProviderGeneratedType of ilOrigTyRef: ILTypeRef * ilRenamedTyRef: ILTypeRef * ProviderGeneratedType list + type ProviderGeneratedType = + | ProviderGeneratedType of ilOrigTyRef: ILTypeRef * ilRenamedTyRef: ILTypeRef * ProviderGeneratedType list /// 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 - /// names in the statically linked, embedded assembly. - ILTypeMap: Dictionary - } - + type ProvidedAssemblyStaticLinkingMap = + { /// The table of remappings from type names in the provided assembly to type + /// names in the statically linked, embedded assembly. + ILTypeMap: Dictionary } + /// Create a new static linking map, ready to populate with data. static member CreateNew: unit -> ProvidedAssemblyStaticLinkingMap diff --git a/src/fsharp/FindUnsolved.fsi b/src/fsharp/FindUnsolved.fsi index 12c5c536bb0..1d3e595152f 100644 --- a/src/fsharp/FindUnsolved.fsi +++ b/src/fsharp/FindUnsolved.fsi @@ -8,4 +8,9 @@ open FSharp.Compiler.TcGlobals open FSharp.Compiler.Import /// Find all unsolved inference variables after type inference for an entire file -val UnsolvedTyparsOfModuleDef: g: TcGlobals -> amap: ImportMap -> denv: DisplayEnv -> mdef : ModuleOrNamespaceExpr * extraAttribs: Attrib list -> Typar list +val UnsolvedTyparsOfModuleDef: + g: TcGlobals -> + amap: ImportMap -> + denv: DisplayEnv -> + mdef: ModuleOrNamespaceExpr * extraAttribs: Attrib list -> + Typar list diff --git a/src/fsharp/IlxGen.fsi b/src/fsharp/IlxGen.fsi index c8a33c49587..abeaa477ef9 100644 --- a/src/fsharp/IlxGen.fsi +++ b/src/fsharp/IlxGen.fsi @@ -9,13 +9,13 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals -/// Indicates how the generated IL code is ultimately emitted +/// Indicates how the generated IL code is ultimately emitted type IlxGenBackend = | IlWriteBackend | IlReflectBackend [] -type internal IlxGenOptions = +type internal IlxGenOptions = { fragName: string /// Indicates if we are generating filter blocks @@ -27,7 +27,7 @@ type internal IlxGenOptions = /// Indicates if static array data should be emitted using static blobs emitConstantArraysUsingStaticDataBlobs: bool - /// If this is set, then the last module becomes the "main" module + /// If this is set, then the last module becomes the "main" module mainMethodInfo: Attribs option /// Indicates if local optimizations are active @@ -47,20 +47,18 @@ type internal IlxGenOptions = /// Indicates the code is being generated in FSI.EXE and is executed immediately after code generation /// This includes all interactively compiled code, including #load, definitions, and expressions - isInteractive: bool + isInteractive: bool /// Indicates the code generated is an interactive 'it' expression. We generate a setter to allow clearing of the underlying /// storage, even though 'it' is not logically mutable isInteractiveItExpr: bool /// Indicates that, whenever possible, use callvirt instead of call - alwaysCallVirt: bool - } + alwaysCallVirt: bool } /// The results of the ILX compilation of one fragment of an assembly -type public IlxGenResults = - { - /// The generated IL/ILX type definitions +type public IlxGenResults = + { /// The generated IL/ILX type definitions ilTypeDefs: ILTypeDef list /// The generated IL/ILX assembly attributes @@ -76,27 +74,25 @@ type public IlxGenResults = permissionSets: ILSecurityDecl list /// The generated IL/ILX resources associated with F# quotations - quotationResourceInfo: (ILTypeRef list * byte[]) list - } - + quotationResourceInfo: (ILTypeRef list * byte []) list } + /// Used to support the compilation-inversion operations "ClearGeneratedValue" and "LookupGeneratedValue" type ExecutionContext = - { - LookupTypeRef: ILTypeRef -> Type - LookupType: ILType -> Type - } + { LookupTypeRef: ILTypeRef -> Type + LookupType: ILType -> Type } /// An incremental ILX code generator for a single assembly type public IlxAssemblyGenerator = /// Create an incremental ILX code generator for a single assembly - new: Import.ImportMap * TcGlobals * ConstraintSolver.TcValF * CcuThunk -> IlxAssemblyGenerator - + new: Import.ImportMap * TcGlobals * ConstraintSolver.TcValF * CcuThunk -> IlxAssemblyGenerator + /// Register a set of referenced assemblies with the ILX code generator member AddExternalCcus: CcuThunk list -> unit /// Register a fragment of the current assembly with the ILX code generator. If 'isIncrementalFragment' is true then the input /// is assumed to be a fragment 'typed' into FSI.EXE, otherwise the input is assumed to be the result of a '#load' - member AddIncrementalLocalAssemblyFragment: isIncrementalFragment: bool * fragName:string * typedImplFiles: TypedImplFile list -> unit + member AddIncrementalLocalAssemblyFragment: + isIncrementalFragment: bool * fragName: string * typedImplFiles: TypedImplFile list -> unit /// Generate ILX code for an assembly fragment member GenerateCode: IlxGenOptions * TypedAssemblyAfterOptimization * Attribs * Attribs -> IlxGenResults diff --git a/src/fsharp/InfoReader.fsi b/src/fsharp/InfoReader.fsi index 6e1eebd234d..487e0de771d 100644 --- a/src/fsharp/InfoReader.fsi +++ b/src/fsharp/InfoReader.fsi @@ -5,7 +5,7 @@ module internal FSharp.Compiler.InfoReader open Internal.Utilities.Library -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.Import open FSharp.Compiler.Infos @@ -15,36 +15,63 @@ open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree /// Try to select an F# value when querying members, and if so return a MethInfo that wraps the F# value. -val TrySelectMemberVal: g:TcGlobals -> optFilter:string option -> ty:TType -> pri:ExtensionMethodPriority option -> _membInfo:'a -> vref:ValRef -> MethInfo option +val TrySelectMemberVal: + g: TcGlobals -> + optFilter: string option -> + ty: TType -> + pri: ExtensionMethodPriority option -> + _membInfo: 'a -> + vref: ValRef -> + MethInfo option /// Query the immediate methods of an F# type, not taking into account inherited methods. The optFilter /// parameter is an optional name to restrict the set of properties returned. -val GetImmediateIntrinsicMethInfosOfType: optFilter:string option * ad:AccessorDomain -> g:TcGlobals -> amap:ImportMap -> m:range -> ty:TType -> MethInfo list +val GetImmediateIntrinsicMethInfosOfType: + optFilter: string option * ad: AccessorDomain -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + ty: TType -> + MethInfo list /// A helper type to help collect properties. /// -/// Join up getters and setters which are not associated in the F# data structure +/// Join up getters and setters which are not associated in the F# data structure type PropertyCollector = - new: g:TcGlobals * amap:ImportMap * m:range * ty:TType * optFilter:string option * ad:AccessorDomain -> PropertyCollector + new: + g: TcGlobals * amap: ImportMap * m: range * ty: TType * optFilter: string option * ad: AccessorDomain -> + PropertyCollector member Close: unit -> PropInfo list - member Collect: membInfo:ValMemberInfo * vref:ValRef -> unit - + member Collect: membInfo: ValMemberInfo * vref: ValRef -> unit + /// Query the immediate properties of an F# type, not taking into account inherited properties. The optFilter /// parameter is an optional name to restrict the set of properties returned. -val GetImmediateIntrinsicPropInfosOfType: optFilter:string option * ad:AccessorDomain -> g:TcGlobals -> amap:ImportMap -> m:range -> ty:TType -> PropInfo list +val GetImmediateIntrinsicPropInfosOfType: + optFilter: string option * ad: AccessorDomain -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + ty: TType -> + PropInfo list /// Checks whether the given type has an indexer property. -val IsIndexerType: g:TcGlobals -> amap:ImportMap -> ty:TType -> bool +val IsIndexerType: g: TcGlobals -> amap: ImportMap -> ty: TType -> bool /// Get the items that are considered the most specific in the hierarchy out of the given items by type. -val GetMostSpecificItemsByType: g:TcGlobals -> amap:ImportMap -> f:('a -> (TType * range) option) -> xs:'a list -> 'a list +val GetMostSpecificItemsByType: + g: TcGlobals -> amap: ImportMap -> f: ('a -> (TType * range) option) -> xs: 'a list -> 'a list -/// From the given method sets, filter each set down to the most specific ones. -val FilterMostSpecificMethInfoSets: g:TcGlobals -> amap:ImportMap -> m:range -> minfoSets:NameMultiMap -> NameMultiMap +/// From the given method sets, filter each set down to the most specific ones. +val FilterMostSpecificMethInfoSets: + g: TcGlobals -> + amap: ImportMap -> + m: range -> + minfoSets: NameMultiMap -> + NameMultiMap /// 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 = | MethodItem of MethInfo list list | PropertyItem of PropInfo list list @@ -52,158 +79,244 @@ type HierarchyItem = | EventItem of EventInfo list | ILFieldItem of ILFieldInfo list -/// Indicates if we prefer overrides or abstract slots. -type FindMemberFlag = - /// Prefer items toward the top of the hierarchy, which we do if the items are virtual - /// but not when resolving base calls. - | IgnoreOverrides +/// Indicates if we prefer overrides or abstract slots. +type FindMemberFlag = + /// Prefer items toward the top of the hierarchy, which we do if the items are virtual + /// but not when resolving base calls. + | IgnoreOverrides - /// Get overrides instead of abstract slots when measuring whether a class/interface implements all its required slots. + /// Get overrides instead of abstract slots when measuring whether a class/interface implements all its required slots. | PreferOverrides -/// An InfoReader is an object to help us read and cache infos. -/// We create one of these for each file we typecheck. +/// An InfoReader is an object to help us read and cache infos. +/// We create one of these for each file we typecheck. type InfoReader = /// Get the declared IL fields of a type, not including inherited fields - new: g:TcGlobals * amap:ImportMap -> InfoReader + new: g: TcGlobals * amap: ImportMap -> InfoReader /// Get the super-types of a type, including interface types. - member GetEntireTypeHierarchy: allowMultiIntfInst:AllowMultiIntfInstantiations * m:range * ty:TType -> TType list + member GetEntireTypeHierarchy: allowMultiIntfInst: AllowMultiIntfInstantiations * m: range * ty: TType -> TType list /// Read the events of a type, including inherited ones. Cache the result for monomorphic types. - member GetEventInfosOfType: optFilter:string option * ad:AccessorDomain * m:range * ty:TType -> EventInfo list + member GetEventInfosOfType: optFilter: string option * ad: AccessorDomain * m: range * ty: TType -> EventInfo list /// Read the IL fields of a type, including inherited ones. Cache the result for monomorphic types. - member GetILFieldInfosOfType: optFilter:string option * ad:AccessorDomain * m:range * ty:TType -> ILFieldInfo list - member GetImmediateIntrinsicEventsOfType: optFilter:string option * ad:AccessorDomain * m:range * ty:TType -> EventInfo list + member GetILFieldInfosOfType: + optFilter: string option * ad: AccessorDomain * m: range * ty: TType -> ILFieldInfo list + member GetImmediateIntrinsicEventsOfType: + optFilter: string option * ad: AccessorDomain * m: range * ty: TType -> EventInfo list /// Get the super-types of a type, excluding interface types. - member GetPrimaryTypeHierarchy: allowMultiIntfInst:AllowMultiIntfInstantiations * m:range * ty:TType -> TType list + member GetPrimaryTypeHierarchy: + allowMultiIntfInst: AllowMultiIntfInstantiations * m: range * ty: TType -> TType list /// Read the raw method sets of a type, including inherited ones. Cache the result for monomorphic types - member GetRawIntrinsicMethodSetsOfType: optFilter:string option * ad:AccessorDomain * allowMultiIntfInst:AllowMultiIntfInstantiations * m:range * ty:TType -> MethInfo list list + member GetRawIntrinsicMethodSetsOfType: + optFilter: string option * + ad: AccessorDomain * + allowMultiIntfInst: AllowMultiIntfInstantiations * + m: range * + ty: TType -> + MethInfo list list /// Read the record or class fields of a type, including inherited ones. Cache the result for monomorphic types. - member GetRecordOrClassFieldsOfType: optFilter:string option * ad:AccessorDomain * m:range * ty:TType -> RecdFieldInfo list + member GetRecordOrClassFieldsOfType: + optFilter: string option * ad: AccessorDomain * m: range * ty: TType -> RecdFieldInfo list /// Check if the given language feature is supported by the runtime. - member IsLanguageFeatureRuntimeSupported: langFeature:Features.LanguageFeature -> bool + member IsLanguageFeatureRuntimeSupported: langFeature: Features.LanguageFeature -> bool /// Try and find a record or class field for a type. - member TryFindRecdOrClassFieldInfoOfType: nm:string * m:range * ty:TType -> RecdFieldInfo voption + member TryFindRecdOrClassFieldInfoOfType: nm: string * m: range * ty: TType -> RecdFieldInfo voption member amap: ImportMap member g: TcGlobals - + /// Exclude methods from super types which have the same signature as a method in a more specific type. - static member ExcludeHiddenOfMethInfos: g:TcGlobals -> amap:ImportMap -> m:range -> minfos:MethInfo list list -> MethInfo list + static member ExcludeHiddenOfMethInfos: + g: TcGlobals -> amap: ImportMap -> m: range -> minfos: MethInfo list list -> MethInfo list /// Exclude properties from super types which have the same name as a property in a more specific type. - static member ExcludeHiddenOfPropInfos: g:TcGlobals -> amap:ImportMap -> m:range -> pinfos:PropInfo list list -> PropInfo list + static member ExcludeHiddenOfPropInfos: + g: TcGlobals -> amap: ImportMap -> m: range -> pinfos: PropInfo list list -> PropInfo list /// Get the sets of intrinsic methods in the hierarchy (not including extension methods) - member GetIntrinsicMethInfoSetsOfType: optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> MethInfo list list + member GetIntrinsicMethInfoSetsOfType: + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + MethInfo list list /// Get the sets intrinsic properties in the hierarchy (not including extension properties) - member GetIntrinsicPropInfoSetsOfType: optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> PropInfo list list + member GetIntrinsicPropInfoSetsOfType: + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + PropInfo list list /// Get the flattened list of intrinsic methods in the hierarchy - member GetIntrinsicMethInfosOfType: optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> MethInfo list + member GetIntrinsicMethInfosOfType: + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + MethInfo list /// Get the flattened list of intrinsic properties in the hierarchy - member GetIntrinsicPropInfosOfType: optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> PropInfo list + member GetIntrinsicPropInfosOfType: + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + PropInfo list /// Perform type-directed name resolution of a particular named member in an F# type - member TryFindIntrinsicNamedItemOfType: nm:string * ad:AccessorDomain -> findFlag:FindMemberFlag -> m:range -> ty:TType -> HierarchyItem option + member TryFindIntrinsicNamedItemOfType: + nm: string * ad: AccessorDomain -> findFlag: FindMemberFlag -> m: range -> ty: TType -> HierarchyItem option /// Find the op_Implicit for a type member FindImplicitConversions: m: range -> ad: AccessorDomain -> ty: TType -> MethInfo list -val checkLanguageFeatureRuntimeError: infoReader:InfoReader -> langFeature:Features.LanguageFeature -> m:range -> unit +val checkLanguageFeatureRuntimeError: + infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> unit -val checkLanguageFeatureRuntimeErrorRecover: infoReader:InfoReader -> langFeature:Features.LanguageFeature -> m:range -> unit +val checkLanguageFeatureRuntimeErrorRecover: + infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> unit -val tryLanguageFeatureRuntimeErrorRecover: infoReader:InfoReader -> langFeature:Features.LanguageFeature -> m:range -> bool +val tryLanguageFeatureRuntimeErrorRecover: + infoReader: InfoReader -> langFeature: Features.LanguageFeature -> m: range -> bool /// Get the declared constructors of any F# type -val GetIntrinsicConstructorInfosOfType: infoReader:InfoReader -> m:range -> ty:TType -> MethInfo list +val GetIntrinsicConstructorInfosOfType: infoReader: InfoReader -> m: range -> ty: TType -> MethInfo list /// Exclude methods from super types which have the same signature as a method in a more specific type. -val ExcludeHiddenOfMethInfos: g:TcGlobals -> amap:ImportMap -> m:range -> minfos:MethInfo list list -> MethInfo list +val ExcludeHiddenOfMethInfos: g: TcGlobals -> amap: ImportMap -> m: range -> minfos: MethInfo list list -> MethInfo list /// Exclude properties from super types which have the same name as a property in a more specific type. -val ExcludeHiddenOfPropInfos: g:TcGlobals -> amap:ImportMap -> m:range -> pinfos:PropInfo list list -> PropInfo list +val ExcludeHiddenOfPropInfos: g: TcGlobals -> amap: ImportMap -> m: range -> pinfos: PropInfo list list -> PropInfo list /// Get the sets of intrinsic methods in the hierarchy (not including extension methods) -val GetIntrinsicMethInfoSetsOfType: infoReader:InfoReader -> optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> MethInfo list list +val GetIntrinsicMethInfoSetsOfType: + infoReader: InfoReader -> + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + MethInfo list list /// Get the sets intrinsic properties in the hierarchy (not including extension properties) -val GetIntrinsicPropInfoSetsOfType: infoReader:InfoReader -> optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> PropInfo list list +val GetIntrinsicPropInfoSetsOfType: + infoReader: InfoReader -> + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + PropInfo list list /// Get the flattened list of intrinsic methods in the hierarchy -val GetIntrinsicMethInfosOfType: infoReader:InfoReader -> optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> MethInfo list +val GetIntrinsicMethInfosOfType: + infoReader: InfoReader -> + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + MethInfo list /// Get the flattened list of intrinsic properties in the hierarchy -val GetIntrinsicPropInfosOfType: infoReader:InfoReader -> optFilter:string option -> ad:AccessorDomain -> allowMultiIntfInst:AllowMultiIntfInstantiations -> findFlag:FindMemberFlag -> m:range -> ty:TType -> PropInfo list +val GetIntrinsicPropInfosOfType: + infoReader: InfoReader -> + optFilter: string option -> + ad: AccessorDomain -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + PropInfo list /// Perform type-directed name resolution of a particular named member in an F# type -val TryFindIntrinsicNamedItemOfType: infoReader:InfoReader -> nm:string * ad:AccessorDomain -> findFlag:FindMemberFlag -> m:range -> ty:TType -> HierarchyItem option +val TryFindIntrinsicNamedItemOfType: + infoReader: InfoReader -> + nm: string * ad: AccessorDomain -> + findFlag: FindMemberFlag -> + m: range -> + ty: TType -> + HierarchyItem option /// Try to detect the existence of a method on a type. -val TryFindIntrinsicMethInfo: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> nm:string -> ty:TType -> MethInfo list +val TryFindIntrinsicMethInfo: + infoReader: InfoReader -> m: range -> ad: AccessorDomain -> nm: string -> ty: TType -> MethInfo list /// Try to find a particular named property on a type. Only used to ensure that local 'let' definitions and property names /// are distinct, a somewhat adhoc check in tc.fs. -val TryFindIntrinsicPropInfo: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> nm:string -> ty:TType -> PropInfo list +val TryFindIntrinsicPropInfo: + infoReader: InfoReader -> m: range -> ad: AccessorDomain -> nm: string -> ty: TType -> PropInfo list /// Get a set of most specific override methods. -val GetIntrinisicMostSpecificOverrideMethInfoSetsOfType: infoReader:InfoReader -> m:range -> ty:TType -> NameMultiMap +val GetIntrinisicMostSpecificOverrideMethInfoSetsOfType: + infoReader: InfoReader -> m: range -> ty: TType -> NameMultiMap -/// Represents information about the delegate - the Invoke MethInfo, the delegate argument types, the delegate return type +/// Represents information about the delegate - the Invoke MethInfo, the delegate argument types, the delegate return type /// and the overall F# function type for the function type associated with a .NET delegate type [] type SigOfFunctionForDelegate = - SigOfFunctionForDelegate of - delInvokeMeth: MethInfo * - delArgTys: TType list * - delRetTy: TType * - delFuncTy: TType + | SigOfFunctionForDelegate of delInvokeMeth: MethInfo * delArgTys: TType list * delRetTy: TType * delFuncTy: TType -/// Given a delegate type work out the minfo, argument types, return type -/// and F# function type by looking at the Invoke signature of the delegate. -val GetSigOfFunctionForDelegate: infoReader:InfoReader -> delty:TType -> m:range -> ad:AccessorDomain -> SigOfFunctionForDelegate +/// Given a delegate type work out the minfo, argument types, return type +/// and F# function type by looking at the Invoke signature of the delegate. +val GetSigOfFunctionForDelegate: + infoReader: InfoReader -> delty: TType -> m: range -> ad: AccessorDomain -> SigOfFunctionForDelegate /// Try and interpret a delegate type as a "standard" .NET delegate type associated with an event, with a "sender" parameter. -val TryDestStandardDelegateType: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> delTy:TType -> (TType * TType) option +val TryDestStandardDelegateType: + infoReader: InfoReader -> m: range -> ad: AccessorDomain -> delTy: TType -> (TType * TType) option /// Indicates if an event info is associated with a delegate type that is a "standard" .NET delegate type /// with a sender parameter. -val IsStandardEventInfo: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> einfo:EventInfo -> bool +val IsStandardEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> bool -val ArgsTypOfEventInfo: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> einfo:EventInfo -> TType +val ArgsTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType -val PropTypOfEventInfo: infoReader:InfoReader -> m:range -> ad:AccessorDomain -> einfo:EventInfo -> TType +val PropTypOfEventInfo: infoReader: InfoReader -> m: range -> ad: AccessorDomain -> einfo: EventInfo -> TType -/// Try to find the name of the metadata file for this external definition -val TryFindMetadataInfoOfExternalEntityRef: infoReader:InfoReader -> m:range -> eref:EntityRef -> (string option * Typars * ILTypeInfo) option +/// Try to find the name of the metadata file for this external definition +val TryFindMetadataInfoOfExternalEntityRef: + infoReader: InfoReader -> m: range -> eref: EntityRef -> (string option * Typars * ILTypeInfo) option /// Try to find the xml doc associated with the assembly name and metadata key -val TryFindXmlDocByAssemblyNameAndSig: infoReader:InfoReader -> assemblyName: string -> xmlDocSig: string -> XmlDoc option +val TryFindXmlDocByAssemblyNameAndSig: + infoReader: InfoReader -> assemblyName: string -> xmlDocSig: string -> XmlDoc option -val GetXmlDocSigOfEntityRef: infoReader:InfoReader -> m:range -> eref:EntityRef -> (string option * string) option +val GetXmlDocSigOfEntityRef: infoReader: InfoReader -> m: range -> eref: EntityRef -> (string option * string) option -val GetXmlDocSigOfScopedValRef: TcGlobals -> tcref:TyconRef -> vref:ValRef -> (string option * string) option +val GetXmlDocSigOfScopedValRef: TcGlobals -> tcref: TyconRef -> vref: ValRef -> (string option * string) option -val GetXmlDocSigOfRecdFieldRef: rfref:RecdFieldRef -> (string option * string) option +val GetXmlDocSigOfRecdFieldRef: rfref: RecdFieldRef -> (string option * string) option -val GetXmlDocSigOfUnionCaseRef: ucref:UnionCaseRef -> (string option * string) option +val GetXmlDocSigOfUnionCaseRef: ucref: UnionCaseRef -> (string option * string) option -val GetXmlDocSigOfMethInfo: infoReader: InfoReader -> m:range -> minfo:MethInfo -> (string option * string) option +val GetXmlDocSigOfMethInfo: infoReader: InfoReader -> m: range -> minfo: MethInfo -> (string option * string) option val GetXmlDocSigOfValRef: TcGlobals -> vref: ValRef -> (string option * string) option -val GetXmlDocSigOfProp: infoReader:InfoReader -> m:range -> pinfo:PropInfo -> (string option * string) option +val GetXmlDocSigOfProp: infoReader: InfoReader -> m: range -> pinfo: PropInfo -> (string option * string) option -val GetXmlDocSigOfEvent: infoReader:InfoReader -> m:range -> einfo:EventInfo -> (string option * string) option +val GetXmlDocSigOfEvent: infoReader: InfoReader -> m: range -> einfo: EventInfo -> (string option * string) option -val GetXmlDocSigOfILFieldInfo: infoReader:InfoReader -> m:range -> finfo:ILFieldInfo -> (string option * string) option \ No newline at end of file +val GetXmlDocSigOfILFieldInfo: + infoReader: InfoReader -> m: range -> finfo: ILFieldInfo -> (string option * string) option diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fsi b/src/fsharp/InnerLambdasToTopLevelFuncs.fsi index a66bcdb0248..473bffb8c7f 100644 --- a/src/fsharp/InnerLambdasToTopLevelFuncs.fsi +++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fsi @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.InnerLambdasToTopLevelFuncs +module internal FSharp.Compiler.InnerLambdasToTopLevelFuncs -open FSharp.Compiler.TypedTree +open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals -val MakeTopLevelRepresentationDecisions : CcuThunk -> TcGlobals -> TypedImplFile -> TypedImplFile +val MakeTopLevelRepresentationDecisions: CcuThunk -> TcGlobals -> TypedImplFile -> TypedImplFile diff --git a/src/fsharp/InternalCollections.fsi b/src/fsharp/InternalCollections.fsi index 3cd62bae5fa..712f8373e3e 100755 --- a/src/fsharp/InternalCollections.fsi +++ b/src/fsharp/InternalCollections.fsi @@ -1,86 +1,84 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. namespace Internal.Utilities.Collections - + /// Simple aging lookup table. When a member is accessed it's /// moved to the top of the list and when there are too many elements -/// the least-recently-accessed element falls of the end. +/// the least-recently-accessed element falls of the end. /// /// - areSimilar: Keep at most once association for two similar keys (as given by areSimilar) -type internal AgedLookup<'Token, 'Key, 'Value when 'Value : not struct> = - new : keepStrongly:int - * areSimilar:('Key * 'Key -> bool) - * ?requiredToKeep:('Value -> bool) - * ?keepMax: int - -> AgedLookup<'Token,'Key,'Value> +type internal AgedLookup<'Token, 'Key, 'Value when 'Value: not struct> = + new: + keepStrongly: int * areSimilar: ('Key * 'Key -> bool) * ?requiredToKeep: ('Value -> bool) * ?keepMax: int -> + AgedLookup<'Token, 'Key, 'Value> /// Lookup the value without making it the most recent. /// Returns the original key value because the areSame function /// may have unified two different keys. - member TryPeekKeyValue : 'Token * key:'Key -> ('Key*'Value) option + member TryPeekKeyValue: 'Token * key: 'Key -> ('Key * 'Value) option /// Lookup a value and make it the most recent. /// Returns the original key value because the areSame function /// may have unified two different keys. - member TryGetKeyValue : 'Token * key: 'Key -> ('Key*'Value) option + member TryGetKeyValue: 'Token * key: 'Key -> ('Key * 'Value) option /// Lookup a value and make it the most recent. Return None if it wasn't there. - member TryGet : 'Token * key:'Key -> 'Value option + member TryGet: 'Token * key: 'Key -> 'Value option /// Add an element to the collection. Make it the most recent. - member Put : 'Token * 'Key * 'Value -> unit + member Put: 'Token * 'Key * 'Value -> unit /// Remove the given value from the collection. - member Remove : 'Token * key:'Key -> unit + member Remove: 'Token * key: 'Key -> unit /// Remove all elements. - member Clear : 'Token -> unit + member Clear: 'Token -> unit /// Resize - member Resize : 'Token * newKeepStrongly: int * ?newKeepMax : int -> unit - + member Resize: 'Token * newKeepStrongly: int * ?newKeepMax: int -> unit + /// Simple priority caching for a small number of key/value associations. /// This cache may age-out results that have been Set by the caller. -/// Because of this, the caller must be able to tolerate values -/// that aren't what was originally passed to the Set function. +/// Because of this, the caller must be able to tolerate values +/// that aren't what was originally passed to the Set function. /// /// Concurrency: This collection is thread-safe, though concurrent use may result in different -/// threads seeing different live sets of cached items. +/// threads seeing different live sets of cached items. /// /// - areSimilar: Keep at most once association for two similar keys (as given by areSimilar) -type internal MruCache<'Token, 'Key,'Value when 'Value : not struct> = - new : keepStrongly:int - * areSame:('Key * 'Key -> bool) - * ?isStillValid:('Key * 'Value -> bool) - * ?areSimilar:('Key * 'Key -> bool) - * ?requiredToKeep:('Value -> bool) - * ?keepMax:int - -> MruCache<'Token,'Key,'Value> +type internal MruCache<'Token, 'Key, 'Value when 'Value: not struct> = + new: + keepStrongly: int * + areSame: ('Key * 'Key -> bool) * + ?isStillValid: ('Key * 'Value -> bool) * + ?areSimilar: ('Key * 'Key -> bool) * + ?requiredToKeep: ('Value -> bool) * + ?keepMax: int -> + MruCache<'Token, 'Key, 'Value> /// Clear out the cache. - member Clear : 'Token -> unit + member Clear: 'Token -> unit /// Get the similar (subsumable) value for the given key or None if not already available. - member ContainsSimilarKey : 'Token * key:'Key -> bool + member ContainsSimilarKey: 'Token * key: 'Key -> bool /// Get the value for the given key or None if not still valid. - member TryGetAny : 'Token * key:'Key -> 'Value option + member TryGetAny: 'Token * key: 'Key -> 'Value option /// Get the value for the given key or None, but only if entry is still valid - member TryGet : 'Token * key:'Key -> 'Value option + member TryGet: 'Token * key: 'Key -> 'Value option /// Get the value for the given key or None if not still valid. Skips `areSame` checking unless `areSimilar` is not provided. - member TryGetSimilarAny : 'Token * key:'Key -> 'Value option + member TryGetSimilarAny: 'Token * key: 'Key -> 'Value option /// Get the value for the given key or None, but only if entry is still valid. Skips `areSame` checking unless `areSimilar` is not provided. - member TryGetSimilar : 'Token * key:'Key -> 'Value option + member TryGetSimilar: 'Token * key: 'Key -> 'Value option /// Remove the given value from the mru cache. - member RemoveAnySimilar : 'Token * key:'Key -> unit + member RemoveAnySimilar: 'Token * key: 'Key -> unit - /// Set the given key. - member Set : 'Token * key:'Key * value:'Value -> unit + /// Set the given key. + member Set: 'Token * key: 'Key * value: 'Value -> unit /// Resize - member Resize : 'Token * newKeepStrongly: int * ?newKeepMax : int -> unit - + member Resize: 'Token * newKeepStrongly: int * ?newKeepMax: int -> unit diff --git a/src/fsharp/LegacyMSBuildReferenceResolver.fsi b/src/fsharp/LegacyMSBuildReferenceResolver.fsi index a3d17795009..e57c46f069a 100644 --- a/src/fsharp/LegacyMSBuildReferenceResolver.fsi +++ b/src/fsharp/LegacyMSBuildReferenceResolver.fsi @@ -3,4 +3,4 @@ [] module public FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver -val getResolver: unit -> LegacyReferenceResolver \ No newline at end of file +val getResolver: unit -> LegacyReferenceResolver diff --git a/src/fsharp/LexFilter.fsi b/src/fsharp/LexFilter.fsi index 174f58e959c..40e9090038d 100644 --- a/src/fsharp/LexFilter.fsi +++ b/src/fsharp/LexFilter.fsi @@ -10,14 +10,19 @@ open FSharp.Compiler.Parser /// Match the close of '>' of a set of type parameters. /// This is done for tokens such as '>>' by smashing the token -val (|TyparsCloseOp|_|) : txt: string -> ((bool -> token)[] * token option) option +val (|TyparsCloseOp|_|): txt: string -> ((bool -> token) [] * token option) option /// A stateful filter over the token stream that adjusts it for indentation-aware syntax rules /// Process the token stream prior to parsing. Implements the offside rule and other lexical transformations. type LexFilter = - + /// Create a lex filter - new: lightStatus: LightSyntaxStatus * compilingFsLib: bool * lexer: (LexBuffer -> token) * lexbuf: LexBuffer -> LexFilter + new: + lightStatus: LightSyntaxStatus * + compilingFsLib: bool * + lexer: (LexBuffer -> token) * + lexbuf: LexBuffer -> + LexFilter /// The LexBuffer associated with the filter member LexBuffer: LexBuffer diff --git a/src/fsharp/Logger.fsi b/src/fsharp/Logger.fsi index fcaffdc642b..08134122864 100644 --- a/src/fsharp/Logger.fsi +++ b/src/fsharp/Logger.fsi @@ -16,18 +16,18 @@ type internal LogCompilerFunctionId = [] module internal Logger = - val Log : LogCompilerFunctionId -> unit + val Log: LogCompilerFunctionId -> unit - val LogMessage : message: string -> LogCompilerFunctionId -> unit + val LogMessage: message: string -> LogCompilerFunctionId -> unit - val LogBlockStart : LogCompilerFunctionId -> unit + val LogBlockStart: LogCompilerFunctionId -> unit - val LogBlockStop : LogCompilerFunctionId -> unit + val LogBlockStop: LogCompilerFunctionId -> unit - val LogBlockMessageStart : message: string -> LogCompilerFunctionId -> unit + val LogBlockMessageStart: message: string -> LogCompilerFunctionId -> unit - val LogBlockMessageStop : message: string -> LogCompilerFunctionId -> unit + val LogBlockMessageStop: message: string -> LogCompilerFunctionId -> unit - val LogBlock : LogCompilerFunctionId -> IDisposable + val LogBlock: LogCompilerFunctionId -> IDisposable - val LogBlockMessage : message: string -> LogCompilerFunctionId -> IDisposable + val LogBlockMessage: message: string -> LogCompilerFunctionId -> IDisposable diff --git a/src/fsharp/LowerCallsAndSeqs.fsi b/src/fsharp/LowerCallsAndSeqs.fsi index 87492550623..ae761a19700 100644 --- a/src/fsharp/LowerCallsAndSeqs.fsi +++ b/src/fsharp/LowerCallsAndSeqs.fsi @@ -19,8 +19,13 @@ val LowerImplFile: g: TcGlobals -> assembly: TypedImplFile -> TypedImplFile /// a program counter (pc) that records the current state, and a current generated value (current). /// All these variables are then represented as fields in a hosting closure object along with any additional /// free variables of the sequence expression. -val ConvertSequenceExprToObject: g: TcGlobals -> amap: ImportMap -> overallExpr: Expr -> (ValRef * ValRef * ValRef * ValRef list * Expr * Expr * Expr * TType * range) option +val ConvertSequenceExprToObject: + g: TcGlobals -> + amap: ImportMap -> + overallExpr: Expr -> + (ValRef * ValRef * ValRef * ValRef list * Expr * Expr * Expr * TType * range) option val IsPossibleSequenceExpr: g: TcGlobals -> overallExpr: Expr -> bool -val LowerComputedListOrArrayExpr: tcVal: ConstraintSolver.TcValF -> g: TcGlobals -> amap: ImportMap -> Expr -> Expr option +val LowerComputedListOrArrayExpr: + tcVal: ConstraintSolver.TcValF -> g: TcGlobals -> amap: ImportMap -> Expr -> Expr option diff --git a/src/fsharp/LowerStateMachines.fsi b/src/fsharp/LowerStateMachines.fsi index 5a37c4ada6f..4ee177174e2 100644 --- a/src/fsharp/LowerStateMachines.fsi +++ b/src/fsharp/LowerStateMachines.fsi @@ -6,14 +6,14 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals type LoweredStateMachine = - LoweredStateMachine of - templateStructTy: TType * - dataTy: TType * - stateVars: ValRef list * - thisVars: ValRef list * - moveNext: (Val * Expr) * - setStateMachine: (Val * Val * Expr) * - afterCode: (Val * Expr) + | LoweredStateMachine of + templateStructTy: TType * + dataTy: TType * + stateVars: ValRef list * + thisVars: ValRef list * + moveNext: (Val * Expr) * + setStateMachine: (Val * Val * Expr) * + afterCode: (Val * Expr) type LoweredStateMachineResult = /// A state machine was recognised and was compilable @@ -30,8 +30,4 @@ type LoweredStateMachineResult = /// Analyze a TAST expression to detect the elaborated form of a state machine expression, a special kind /// of object expression that uses special code generation constructs. -val LowerStateMachineExpr: - g: TcGlobals -> - overallExpr: Expr -> - LoweredStateMachineResult - +val LowerStateMachineExpr: g: TcGlobals -> overallExpr: Expr -> LoweredStateMachineResult diff --git a/src/fsharp/MethodCalls.fsi b/src/fsharp/MethodCalls.fsi index de41eda0548..3d3f6b424aa 100644 --- a/src/fsharp/MethodCalls.fsi +++ b/src/fsharp/MethodCalls.fsi @@ -3,7 +3,7 @@ /// Logic associated with resolving method calls. module internal FSharp.Compiler.MethodCalls -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Import @@ -20,15 +20,15 @@ open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.ExtensionTyping #endif -/// In the following, 'T gets instantiated to: -/// 1. the expression being supplied for an argument -/// 2. "unit", when simply checking for the existence of an overload that satisfies -/// a signature, or when finding the corresponding witness. -/// Note the parametricity helps ensure that overload resolution doesn't depend on the -/// expression on the callside (though it is in some circumstances allowed -/// to depend on some type information inferred syntactically from that -/// expression, e.g. a lambda expression may be converted to a delegate as -/// an adhoc conversion. +/// In the following, 'T gets instantiated to: +/// 1. the expression being supplied for an argument +/// 2. "unit", when simply checking for the existence of an overload that satisfies +/// a signature, or when finding the corresponding witness. +/// Note the parametricity helps ensure that overload resolution doesn't depend on the +/// expression on the callside (though it is in some circumstances allowed +/// to depend on some type information inferred syntactically from that +/// expression, e.g. a lambda expression may be converted to a delegate as +/// an adhoc conversion. /// /// The bool indicates if named using a '?', making the caller argument explicit-optional type CallerArg<'T> = @@ -41,7 +41,7 @@ type CallerArg<'T> = member IsExplicitOptional: bool member Range: range - + type CalledArg = { Position: struct (int * int) IsParamArray: bool @@ -53,21 +53,31 @@ type CalledArg = NameOpt: Ident option CalledArgumentType: TType } -val CalledArg: pos:struct (int * int) * isParamArray:bool * optArgInfo:OptionalArgInfo * callerInfo:CallerInfo * isInArg:bool * isOutArg:bool * nameOpt:Ident option * reflArgInfo:ReflectedArgInfo * calledArgTy:TType -> CalledArg +val CalledArg: + pos: struct (int * int) * + isParamArray: bool * + optArgInfo: OptionalArgInfo * + callerInfo: CallerInfo * + isInArg: bool * + isOutArg: bool * + nameOpt: Ident option * + reflArgInfo: ReflectedArgInfo * + calledArgTy: TType -> + 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 - NamedArgIdOpt : Ident option + NamedArgIdOpt: Ident option /// The called argument in the method - CalledArg: CalledArg + CalledArg: CalledArg /// The argument on the caller side CallerArg: CallerArg<'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 PropInfo * MethInfo * TypeInst @@ -75,9 +85,7 @@ 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 AssignedItemSetter<'T> = AssignedItemSetter of Ident * AssignedItemSetterTarget * CallerArg<'T> type CallerNamedArg<'T> = | CallerNamedArg of Ident * CallerArg<'T> @@ -87,7 +95,7 @@ type CallerNamedArg<'T> = member Ident: Ident member Name: string - + /// 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. @@ -103,8 +111,8 @@ type CallerArgs<'T> = member CurriedCallerArgs: (CallerArg<'T> list * CallerNamedArg<'T> list) list static member Empty: CallerArgs<'T> - -/// Indicates whether a type directed conversion (e.g. int32 to int64, or op_Implicit) + +/// Indicates whether a type directed conversion (e.g. int32 to int64, or op_Implicit) /// has been used in F# code [] type TypeDirectedConversionUsed = @@ -114,88 +122,97 @@ type TypeDirectedConversionUsed = /// Performs a set of constraint solver operations returning TypeDirectedConversionUsed and /// combines their results. -val MapCombineTDCD: mapper:('a -> OperationResult) -> xs:'a list -> OperationResult +val MapCombineTDCD: + mapper: ('a -> OperationResult) -> + xs: 'a list -> + OperationResult /// Performs a set of constraint solver operations returning TypeDirectedConversionUsed and /// combines their results. -val MapCombineTDC2D: mapper:('a -> 'b -> OperationResult) -> xs:'a list -> ys:'b list -> OperationResult +val MapCombineTDC2D: + mapper: ('a -> 'b -> OperationResult) -> + xs: 'a list -> + ys: 'b list -> + OperationResult /// F# supports some adhoc conversions to make expression fit known overall type val AdjustRequiredTypeForTypeDirectedConversions: - infoReader:InfoReader -> + infoReader: InfoReader -> ad: AccessorDomain -> isMethodArg: bool -> isConstraint: bool -> reqdTy: TType -> - actualTy:TType -> - m: range - -> TType * TypeDirectedConversionUsed * (TType * TType * (DisplayEnv -> unit)) option + actualTy: TType -> + m: range -> + TType * TypeDirectedConversionUsed * (TType * TType * (DisplayEnv -> unit)) option /// F# supports some adhoc conversions to make expression fit known overall type val AdjustCalledArgType: - infoReader:InfoReader -> + infoReader: InfoReader -> ad: AccessorDomain -> - isConstraint:bool -> - enforceNullableOptionalsKnownTypes:bool -> - calledArg:CalledArg -> - callerArg:CallerArg<'a> - -> TType * TypeDirectedConversionUsed * (TType * TType * (DisplayEnv -> unit)) option + isConstraint: bool -> + enforceNullableOptionalsKnownTypes: bool -> + calledArg: CalledArg -> + callerArg: CallerArg<'a> -> + TType * TypeDirectedConversionUsed * (TType * TType * (DisplayEnv -> unit)) option type CalledMethArgSet<'T> = { /// The called arguments corresponding to "unnamed" arguments - UnnamedCalledArgs : CalledArg list + UnnamedCalledArgs: CalledArg list - /// Any unnamed caller arguments not otherwise assigned - UnnamedCallerArgs : CallerArg<'T> list + /// Any unnamed caller arguments not otherwise assigned + UnnamedCallerArgs: CallerArg<'T> list /// The called "ParamArray" argument, if any - ParamArrayCalledArgOpt : CalledArg option + ParamArrayCalledArgOpt: CalledArg option /// Any unnamed caller arguments assigned to a "param array" argument - ParamArrayCallerArgs : CallerArg<'T> list + ParamArrayCallerArgs: CallerArg<'T> list /// Named args - AssignedNamedArgs: AssignedCalledArg<'T> list } + AssignedNamedArgs: AssignedCalledArg<'T> list } member NumAssignedNamedArgs: int member NumUnnamedCalledArgs: int member NumUnnamedCallerArgs: int - + /// Represents the syntactic matching between a caller of a method and the called method. /// /// The constructor takes all the information about the caller and called side of a method, match up named arguments, property setters etc., /// and returns a CalledMeth object for further analysis. type CalledMeth<'T> = - new: infoReader:InfoReader * - nameEnv:NameResolutionEnv option * - isCheckingAttributeCall:bool * - freshenMethInfo:(range -> MethInfo -> TypeInst) * - m:range * - ad:AccessorDomain * - minfo:MethInfo * - calledTyArgs:TType list * - callerTyArgs:TType list * - pinfoOpt:PropInfo option * - callerObjArgTys:TType list * - callerArgs:CallerArgs<'T> * - allowParamArgs:bool * - allowOutAndOptArgs:bool * - tyargsOpt:TType option -> CalledMeth<'T> - - static member GetMethod: x:CalledMeth<'T> -> MethInfo - - member CalledObjArgTys: m:range -> TType list + new: + infoReader: InfoReader * + nameEnv: NameResolutionEnv option * + isCheckingAttributeCall: bool * + freshenMethInfo: (range -> MethInfo -> TypeInst) * + m: range * + ad: AccessorDomain * + minfo: MethInfo * + calledTyArgs: TType list * + callerTyArgs: TType list * + pinfoOpt: PropInfo option * + callerObjArgTys: TType list * + callerArgs: CallerArgs<'T> * + allowParamArgs: bool * + allowOutAndOptArgs: bool * + tyargsOpt: TType option -> + CalledMeth<'T> + + static member GetMethod: x: CalledMeth<'T> -> MethInfo + + member CalledObjArgTys: m: range -> TType list member GetParamArrayElementType: unit -> TType - member HasCorrectObjArgs: m:range -> bool + member HasCorrectObjArgs: m: range -> bool - member IsAccessible: m:range * ad:AccessorDomain -> bool + member IsAccessible: m: range * ad: AccessorDomain -> bool - member IsCandidate: m:range * ad:AccessorDomain -> bool + member IsCandidate: m: range * ad: AccessorDomain -> bool member AllCalledArgs: CalledArg list list @@ -213,7 +230,7 @@ type CalledMeth<'T> = member AssignsAllNamedArgs: bool - /// The property related to the method we're attempting to call, if any + /// The property related to the method we're attempting to call, if any member AssociatedPropertyInfo: PropInfo option /// Args assigned to specify values for attribute fields and properties (these are not necessarily "property sets") @@ -225,16 +242,16 @@ type CalledMeth<'T> = /// Return type after tupling of out args is taken into account member CalledReturnTypeAfterOutArgTupling: TType - /// The instantiation of the method we're attempting to call + /// The instantiation of the method we're attempting to call member CalledTyArgs: TType list - /// The instantiation of the method we're attempting to call + /// The instantiation of the method we're attempting to call member CalledTyparInst: TypedTreeOps.TyparInst /// The types of the actual object arguments, if any member CallerObjArgTys: TType list - /// The formal instantiation of the method we're attempting to call + /// The formal instantiation of the method we're attempting to call member CallerTyArgs: TType list member HasCorrectArity: bool @@ -247,7 +264,7 @@ type CalledMeth<'T> = member IsIndexParamArraySetter: bool - /// The method we're attempting to call + /// The method we're attempting to call member Method: MethInfo member NumArgSets: int @@ -282,8 +299,8 @@ type CalledMeth<'T> = member amap: ImportMap member infoReader: InfoReader - -val NamesOfCalledArgs: calledArgs:CalledArg list -> Ident list + +val NamesOfCalledArgs: calledArgs: CalledArg list -> Ident list type ArgumentAnalysis = | NoInfo @@ -291,104 +308,160 @@ type ArgumentAnalysis = | CallerLambdaHasArgTypes of TType list | CalledArgMatchesType of adjustedCalledArgTy: TType * noEagerConstraintApplication: bool -val ExamineMethodForLambdaPropagation: g: TcGlobals -> m: range -> meth:CalledMeth -> ad:AccessorDomain -> (ArgumentAnalysis list list * (Ident * ArgumentAnalysis) list list) option +val ExamineMethodForLambdaPropagation: + g: TcGlobals -> + m: range -> + meth: CalledMeth -> + ad: AccessorDomain -> + (ArgumentAnalysis list list * (Ident * ArgumentAnalysis) list list) option /// Is this a 'base' call -val IsBaseCall: objArgs:Expr list -> bool - -val BuildILMethInfoCall: g:TcGlobals -> amap:ImportMap -> m:range -> isProp:bool -> minfo:ILMethInfo -> valUseFlags:ValUseFlag -> minst:TType list -> direct:bool -> args:Exprs -> Expr * TType - -/// Make a call to a method info. Used by the optimizer and code generator to build +val IsBaseCall: objArgs: Expr list -> bool + +val BuildILMethInfoCall: + g: TcGlobals -> + amap: ImportMap -> + m: range -> + isProp: bool -> + minfo: ILMethInfo -> + valUseFlags: ValUseFlag -> + minst: TType list -> + direct: bool -> + args: Exprs -> + Expr * TType + +/// Make a call to a method info. Used by the optimizer and code generator to build /// calls to the type-directed solutions to member constraints. -val MakeMethInfoCall: amap:ImportMap -> m:range -> minfo:MethInfo -> minst:TType list -> args:Exprs -> Expr - -/// Build an expression that calls a given method info. -/// This is called after overload resolution, and also to call other -/// methods such as 'setters' for properties. -// tcVal: used to convert an F# value into an expression. See tc.fs. -// isProp: is it a property get? -// minst: the instantiation to apply for a generic method -// objArgs: the 'this' argument, if any -// args: the arguments, if any -val BuildMethodCall: - tcVal:(ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> - g:TcGlobals -> - amap:ImportMap -> - isMutable:TypedTreeOps.Mutates -> - m:range -> - isProp:bool -> - minfo:MethInfo -> - valUseFlags:ValUseFlag -> - minst:TType list -> - objArgs:Expr list -> - args:Expr list - -> Expr * TType +val MakeMethInfoCall: amap: ImportMap -> m: range -> minfo: MethInfo -> minst: TType list -> args: Exprs -> Expr + +/// Build an expression that calls a given method info. +/// This is called after overload resolution, and also to call other +/// methods such as 'setters' for properties. +// tcVal: used to convert an F# value into an expression. See tc.fs. +// isProp: is it a property get? +// minst: the instantiation to apply for a generic method +// objArgs: the 'this' argument, if any +// args: the arguments, if any +val BuildMethodCall: + tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> + g: TcGlobals -> + amap: ImportMap -> + isMutable: TypedTreeOps.Mutates -> + m: range -> + isProp: bool -> + minfo: MethInfo -> + valUseFlags: ValUseFlag -> + minst: TType list -> + objArgs: Expr list -> + args: Expr list -> + Expr * TType /// Build a call to the System.Object constructor taking no arguments, -val BuildObjCtorCall: g:TcGlobals -> m:range -> Expr +val BuildObjCtorCall: g: TcGlobals -> m: range -> Expr /// Implements the elaborated form of adhoc conversions from functions to delegates at member callsites -val BuildNewDelegateExpr: eventInfoOpt:EventInfo option * g:TcGlobals * amap:ImportMap * delegateTy:TType * delInvokeMeth:MethInfo * delArgTys:TType list * delFuncExpr:Expr * delFuncTy:TType * m:range -> Expr - -val CoerceFromFSharpFuncToDelegate: g:TcGlobals -> amap:ImportMap -> infoReader:InfoReader -> ad:AccessorDomain -> callerArgTy:TType -> m:range -> callerArgExpr:Expr -> delegateTy:TType -> Expr +val BuildNewDelegateExpr: + eventInfoOpt: EventInfo option * + g: TcGlobals * + amap: ImportMap * + delegateTy: TType * + delInvokeMeth: MethInfo * + delArgTys: TType list * + delFuncExpr: Expr * + delFuncTy: TType * + m: range -> + Expr + +val CoerceFromFSharpFuncToDelegate: + g: TcGlobals -> + amap: ImportMap -> + infoReader: InfoReader -> + ad: AccessorDomain -> + callerArgTy: TType -> + m: range -> + callerArgExpr: Expr -> + delegateTy: TType -> + Expr val AdjustExprForTypeDirectedConversions: - tcVal:(ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> - g: TcGlobals -> - amap:ImportMap -> - infoReader:InfoReader -> - ad:AccessorDomain -> - reqdTy:TType -> - actualTy:TType -> - m:range -> - expr:Expr - -> Expr - -val AdjustCallerArgExpr: - tcVal:(ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> - g:TcGlobals -> - amap:ImportMap -> - infoReader:InfoReader -> - ad:AccessorDomain -> - isOutArg:bool -> - calledArgTy:TType -> - reflArgInfo:ReflectedArgInfo -> - callerArgTy:TType -> - m:range -> - callerArgExpr:Expr -> + tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> + g: TcGlobals -> + amap: ImportMap -> + infoReader: InfoReader -> + ad: AccessorDomain -> + reqdTy: TType -> + actualTy: TType -> + m: range -> + expr: Expr -> + Expr + +val AdjustCallerArgExpr: + tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> + g: TcGlobals -> + amap: ImportMap -> + infoReader: InfoReader -> + ad: AccessorDomain -> + isOutArg: bool -> + calledArgTy: TType -> + reflArgInfo: ReflectedArgInfo -> + callerArgTy: TType -> + m: range -> + callerArgExpr: Expr -> 'a option * Expr /// Build the argument list for a method call. Adjust for param array, optional arguments, byref arguments and coercions. -/// For example, if you pass an F# reference cell to a byref then we must get the address of the +/// For example, if you pass an F# reference cell to a byref then we must get the address of the /// contents of the ref. Likewise lots of adjustments are made for optional arguments etc. val AdjustCallerArgs: - tcVal:(ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> - tcFieldInit:(range -> AbstractIL.IL.ILFieldInit -> Const) -> - eCallerMemberName:string option -> - infoReader:InfoReader -> - ad:AccessorDomain -> - calledMeth:CalledMeth -> - objArgs:Expr list -> - lambdaVars:'a option -> - mItem:range -> - mMethExpr:range -> - (Expr -> Expr) * Expr list * - 'b option list * AssignedCalledArg list * - Expr list * (Expr -> Expr) * - 'c option list * Expr list * - Binding list - -val RecdFieldInstanceChecks: g:TcGlobals -> amap:ImportMap -> ad:AccessorDomain -> m:range -> rfinfo:RecdFieldInfo -> unit - -val ILFieldStaticChecks: g:TcGlobals -> amap:ImportMap -> infoReader:InfoReader -> ad:AccessorDomain -> m:range -> finfo:ILFieldInfo -> unit - -val ILFieldInstanceChecks: g:TcGlobals -> amap:ImportMap -> ad:AccessorDomain -> m:range -> finfo:ILFieldInfo -> unit - -val MethInfoChecks: g:TcGlobals -> amap:ImportMap -> isInstance:bool -> tyargsOpt:'a option -> objArgs:Expr list -> ad:AccessorDomain -> m:range -> minfo:MethInfo -> unit + tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> + tcFieldInit: (range -> AbstractIL.IL.ILFieldInit -> Const) -> + eCallerMemberName: string option -> + infoReader: InfoReader -> + ad: AccessorDomain -> + calledMeth: CalledMeth -> + objArgs: Expr list -> + lambdaVars: 'a option -> + mItem: range -> + mMethExpr: range -> + (Expr -> Expr) * + Expr list * + 'b option list * + AssignedCalledArg list * + Expr list * + (Expr -> Expr) * + 'c option list * + Expr list * + Binding list + +val RecdFieldInstanceChecks: + g: TcGlobals -> amap: ImportMap -> ad: AccessorDomain -> m: range -> rfinfo: RecdFieldInfo -> unit + +val ILFieldStaticChecks: + g: TcGlobals -> + amap: ImportMap -> + infoReader: InfoReader -> + ad: AccessorDomain -> + m: range -> + finfo: ILFieldInfo -> + unit + +val ILFieldInstanceChecks: + g: TcGlobals -> amap: ImportMap -> ad: AccessorDomain -> m: range -> finfo: ILFieldInfo -> unit + +val MethInfoChecks: + g: TcGlobals -> + amap: ImportMap -> + isInstance: bool -> + tyargsOpt: 'a option -> + objArgs: Expr list -> + ad: AccessorDomain -> + m: range -> + minfo: MethInfo -> + unit exception FieldNotMutable of TypedTreeOps.DisplayEnv * RecdFieldRef * range -val CheckRecdFieldMutation: m:range -> denv:TypedTreeOps.DisplayEnv -> rfinfo:RecdFieldInfo -> unit +val CheckRecdFieldMutation: m: range -> denv: TypedTreeOps.DisplayEnv -> rfinfo: RecdFieldInfo -> unit /// Generate a witness for the given (solved) constraint. Five possiblilities are taken /// into account. @@ -397,32 +470,39 @@ val CheckRecdFieldMutation: m:range -> denv:TypedTreeOps.DisplayEnv -> rfinfo:Re /// 3. The constraint is solved by an F# anonymous record field /// 4. The constraint is considered solved by a "built in" solution /// 5. The constraint is solved by a closed expression given by a provided method from a type provider -/// +/// /// In each case an expression is returned where the method is applied to the given arguments, or the /// field is dereferenced. -/// +/// /// None is returned in the cases where the trait has not been solved (e.g. is part of generic code) /// or there is an unexpected mismatch of some kind. -val GenWitnessExpr: amap:ImportMap -> g:TcGlobals -> m:range -> traitInfo:TraitConstraintInfo -> argExprs:Expr list -> Expr option +val GenWitnessExpr: + amap: ImportMap -> g: TcGlobals -> m: range -> traitInfo: TraitConstraintInfo -> argExprs: Expr list -> Expr option /// Generate a lambda expression for the given solved trait. -val GenWitnessExprLambda: amap:ImportMap -> g:TcGlobals -> m:range -> traitInfo:TraitConstraintInfo -> Choice +val GenWitnessExprLambda: + amap: ImportMap -> g: TcGlobals -> m: range -> traitInfo: TraitConstraintInfo -> Choice /// Generate the arguments passed for a set of (solved) traits in non-generic code -val GenWitnessArgs: amap:ImportMap -> g:TcGlobals -> m:range -> traitInfos:TraitConstraintInfo list -> Choice list +val GenWitnessArgs: + amap: ImportMap -> + g: TcGlobals -> + m: range -> + traitInfos: TraitConstraintInfo list -> + Choice list #if !NO_TYPEPROVIDERS module ProvidedMethodCalls = - val BuildInvokerExpressionForProvidedMethodCall: - tcVal:(ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> - g:TcGlobals * - amap:ImportMap * - mi:Tainted * - objArgs:Expr list * - mut:TypedTreeOps.Mutates * - isProp:bool * - isSuperInit:ValUseFlag * - allArgs:Exprs * - m:range -> - Tainted option * Expr * TType + val BuildInvokerExpressionForProvidedMethodCall: + tcVal: (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) -> + g: TcGlobals * + amap: ImportMap * + mi: Tainted * + objArgs: Expr list * + mut: TypedTreeOps.Mutates * + isProp: bool * + isSuperInit: ValUseFlag * + allArgs: Exprs * + m: range -> + Tainted option * Expr * TType #endif diff --git a/src/fsharp/MethodOverrides.fsi b/src/fsharp/MethodOverrides.fsi index 1e5a07350a6..f0e369164b7 100644 --- a/src/fsharp/MethodOverrides.fsi +++ b/src/fsharp/MethodOverrides.fsi @@ -3,7 +3,7 @@ /// Primary logic related to method overrides. module internal FSharp.Compiler.MethodOverrides -open Internal.Utilities.Library +open Internal.Utilities.Library open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.InfoReader open FSharp.Compiler.Import @@ -21,26 +21,34 @@ type OverrideCanImplement = | CanImplementAnySlot | CanImplementNoSlots -/// The overall information about a method implementation in a class or object expression +/// The overall information about a method implementation in a class or object expression type OverrideInfo = - | Override of OverrideCanImplement * TyconRef * Ident * (Typars * TyparInst) * TType list list * TType option * bool * bool - + | Override of + OverrideCanImplement * + TyconRef * + Ident * + (Typars * TyparInst) * + TType list list * + TType option * + bool * + bool + member ArgTypes: TType list list - + member BoundingTyconRef: TyconRef - + member CanImplement: OverrideCanImplement - + member IsCompilerGenerated: bool - + member IsFakeEventProperty: bool - + member LogicalName: string - + member Range: range - + member ReturnType: TType option - + type RequiredSlot = | RequiredSlot of MethInfo * isOptional: bool | DefaultInterfaceImplementationSlot of MethInfo * isOptional: bool * possiblyNoMostSpecific: bool @@ -57,7 +65,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 RequiredSlot list * NameMultiMap * OverrideInfo list * PropInfo list exception TypeIsImplicitlyAbstract of range @@ -66,34 +74,88 @@ exception OverrideDoesntOverride of DisplayEnv * OverrideInfo * MethInfo option module DispatchSlotChecking = /// Format the signature of an override as a string as part of an error message - val FormatOverride: denv:DisplayEnv -> d:OverrideInfo -> string + val FormatOverride: denv: DisplayEnv -> d: OverrideInfo -> string /// Format the signature of a MethInfo as a string as part of an error message - val FormatMethInfoSig: g:TcGlobals -> amap:ImportMap -> m:range -> denv:DisplayEnv -> d:MethInfo -> string + val FormatMethInfoSig: g: TcGlobals -> amap: ImportMap -> m: range -> denv: DisplayEnv -> d: MethInfo -> string /// Get the override information for an object expression method being used to implement dispatch slots - val GetObjectExprOverrideInfo: g:TcGlobals -> amap:ImportMap -> implty:TType * id:Ident * memberFlags:SynMemberFlags * ty:TType * arityInfo:ValReprInfo * bindingAttribs:Attribs * rhsExpr:Expr -> OverrideInfo * (Val option * Val * Val list list * Attribs * Expr) + val GetObjectExprOverrideInfo: + g: TcGlobals -> + amap: ImportMap -> + implty: TType * + id: Ident * + memberFlags: SynMemberFlags * + ty: TType * + arityInfo: ValReprInfo * + bindingAttribs: Attribs * + rhsExpr: Expr -> + OverrideInfo * (Val option * Val * Val list list * Attribs * Expr) /// Check if an override exactly matches the requirements for a dispatch slot. - val IsExactMatch: g:TcGlobals -> amap:ImportMap -> m:range -> dispatchSlot:MethInfo -> overrideBy:OverrideInfo -> bool + val IsExactMatch: + g: TcGlobals -> amap: ImportMap -> m: range -> dispatchSlot: MethInfo -> overrideBy: OverrideInfo -> bool /// Check all dispatch slots are implemented by some override. - val CheckDispatchSlotsAreImplemented: denv:DisplayEnv * infoReader:InfoReader * m:range * nenv:NameResolutionEnv * sink:TcResultsSink * isOverallTyAbstract:bool * reqdTy:TType * dispatchSlots:RequiredSlot list * availPriorOverrides:OverrideInfo list * overrides:OverrideInfo list -> bool + val CheckDispatchSlotsAreImplemented: + denv: DisplayEnv * + infoReader: InfoReader * + m: range * + nenv: NameResolutionEnv * + sink: TcResultsSink * + isOverallTyAbstract: bool * + reqdTy: TType * + dispatchSlots: RequiredSlot list * + availPriorOverrides: OverrideInfo list * + overrides: OverrideInfo list -> + bool /// Check all implementations implement some dispatch slot. - val CheckOverridesAreAllUsedOnce: denv:DisplayEnv * g:TcGlobals * infoReader:InfoReader * isObjExpr:bool * reqdTy:TType * dispatchSlotsKeyed:NameMultiMap * availPriorOverrides:OverrideInfo list * overrides:OverrideInfo list -> unit - - /// Get the slots of a type that can or must be implemented. - val GetSlotImplSets: infoReader:InfoReader -> denv:DisplayEnv -> ad:AccessorDomain -> isObjExpr:bool -> allReqdTys:(TType * range) list -> SlotImplSet list + val CheckOverridesAreAllUsedOnce: + denv: DisplayEnv * + g: TcGlobals * + infoReader: InfoReader * + isObjExpr: bool * + reqdTy: TType * + dispatchSlotsKeyed: NameMultiMap * + availPriorOverrides: OverrideInfo list * + overrides: OverrideInfo list -> + unit + + /// Get the slots of a type that can or must be implemented. + val GetSlotImplSets: + infoReader: InfoReader -> + denv: DisplayEnv -> + ad: AccessorDomain -> + isObjExpr: bool -> + allReqdTys: (TType * range) list -> + SlotImplSet list /// "Type Completion" inference and a few other checks at the end of the inference scope -val FinalTypeDefinitionChecksAtEndOfInferenceScope: infoReader:InfoReader * nenv:NameResolutionEnv * sink:TcResultsSink * isImplementation:bool * denv:DisplayEnv -> tycon:Tycon -> unit - -/// Get the methods relevant to determining if a uniquely-identified-override exists based on the syntactic information -/// at the member signature prior to type inference. This is used to pre-assign type information if it does -val GetAbstractMethInfosForSynMethodDecl: infoReader:InfoReader * ad:AccessorDomain * memberName:Ident * bindm:range * typToSearchForAbstractMembers:(TType * SlotImplSet option) * valSynData:SynValInfo -> MethInfo list * MethInfo list - -/// Get the properties relevant to determining if a uniquely-identified-override exists based on the syntactic information -/// at the member signature prior to type inference. This is used to pre-assign type information if it does -val GetAbstractPropInfosForSynPropertyDecl: infoReader:InfoReader * ad:AccessorDomain * memberName:Ident * bindm:range * typToSearchForAbstractMembers:(TType * SlotImplSet option) * _k:'a * _valSynData:'b -> PropInfo list - +val FinalTypeDefinitionChecksAtEndOfInferenceScope: + infoReader: InfoReader * nenv: NameResolutionEnv * sink: TcResultsSink * isImplementation: bool * denv: DisplayEnv -> + tycon: Tycon -> + unit + +/// Get the methods relevant to determining if a uniquely-identified-override exists based on the syntactic information +/// at the member signature prior to type inference. This is used to pre-assign type information if it does +val GetAbstractMethInfosForSynMethodDecl: + infoReader: InfoReader * + ad: AccessorDomain * + memberName: Ident * + bindm: range * + typToSearchForAbstractMembers: (TType * SlotImplSet option) * + valSynData: SynValInfo -> + MethInfo list * MethInfo list + +/// Get the properties relevant to determining if a uniquely-identified-override exists based on the syntactic information +/// at the member signature prior to type inference. This is used to pre-assign type information if it does +val GetAbstractPropInfosForSynPropertyDecl: + infoReader: InfoReader * + ad: AccessorDomain * + memberName: Ident * + bindm: range * + typToSearchForAbstractMembers: (TType * SlotImplSet option) * + _k: 'a * + _valSynData: 'b -> + PropInfo list diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 3386fe231b7..89d7703d053 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -17,7 +17,9 @@ open FSharp.Compiler.TcGlobals /// A NameResolver is a context for name resolution. It primarily holds an InfoReader. type NameResolver = - new: g:TcGlobals * amap:ImportMap * infoReader:InfoReader * instantiationGenerator:(range -> Typars -> TypeInst) -> NameResolver + new: + g: TcGlobals * amap: ImportMap * infoReader: InfoReader * instantiationGenerator: (range -> Typars -> TypeInst) -> + NameResolver member InfoReader: InfoReader @@ -47,9 +49,9 @@ type EnclosingTypeInst = TypeInst /// Represents an item that results from name resolution [] -type Item = +type Item = /// Represents the resolution of a name to an F# value or function. - | Value of ValRef + | Value of ValRef /// Represents the resolution of a name to an F# union case. | UnionCase of UnionCaseInfo * hasRequireQualifiedAccessAttr: bool @@ -58,10 +60,10 @@ type Item = | ActivePatternResult of apinfo: ActivePatternInfo * apOverallTy: TType * index: int * range: range /// Represents the resolution of a name to an F# active pattern case within the body of an active pattern. - | ActivePatternCase of ActivePatternElemRef + | ActivePatternCase of ActivePatternElemRef /// Represents the resolution of a name to an F# exception definition. - | ExnCase of TyconRef + | ExnCase of TyconRef /// Represents the resolution of a name to an F# record or exception field. | RecdField of RecdFieldInfo @@ -72,13 +74,13 @@ type Item = /// Represents the resolution of a name to a field of an anonymous record type. | AnonRecdField of AnonRecdTypeInfo * TTypes * int * range - // The following are never in the items table but are valid results of binding - // an identifier in different circumstances. + // The following are never in the items table but are valid results of binding + // an identifier in different circumstances. /// Represents the resolution of a name at the point of its own definition. | NewDef of Ident - /// Represents the resolution of a name to a .NET field + /// Represents the resolution of a name to a .NET field | ILField of ILFieldInfo /// Represents the resolution of a name to an event @@ -87,7 +89,7 @@ type Item = /// Represents the resolution of a name to a property | Property of string * PropInfo list - /// Represents the resolution of a name to a group of methods. + /// Represents the resolution of a name to a group of methods. | MethodGroup of displayName: string * methods: MethInfo list * uninstantiatedMethodOpt: MethInfo option /// Represents the resolution of a name to a constructor @@ -103,7 +105,7 @@ type Item = | Types of string * TType list /// CustomOperation(nm, helpText, methInfo) - /// + /// /// Used to indicate the availability or resolution of a custom query operation such as 'sortBy' or 'where' in computation expression syntax | CustomOperation of string * (unit -> string option) * MethInfo option @@ -123,7 +125,7 @@ type Item = | ArgName of Ident * TType * ArgumentContainer option /// Represents the resolution of a name to a named property setter - | SetterArg of Ident * Item + | SetterArg of Ident * Item /// Represents the potential resolution of an unqualified name to a type. | UnqualifiedType of TyconRef list @@ -141,9 +143,7 @@ type Item = /// Pairs an Item with a TyparInst showing how generic type variables of the item are instantiated at /// a particular usage point. [] -type ItemWithInst = - { Item: Item - TyparInst: TyparInst } +type ItemWithInst = { Item: Item; TyparInst: TyparInst } val (|ItemWithInst|): ItemWithInst -> Item * TyparInst val ItemWithNoInst: Item -> ItemWithInst @@ -153,89 +153,91 @@ 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 + /// F#-style Extrinsic extension member, defined in F# code + | FSExtMem of ValRef * ExtensionMethodPriority - /// ILExtMem(declaringTyconRef, ilMetadata, pri) - /// - /// IL-style extension member, backed by some kind of method with an [] attribute - | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority + /// ILExtMem(declaringTyconRef, ilMetadata, pri) + /// + /// IL-style extension member, backed by some kind of method with an [] attribute + | ILExtMem of TyconRef * MethInfo * ExtensionMethodPriority - /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced - /// later through 'open' get priority in overload resolution. - member Priority: ExtensionMethodPriority + /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced + /// later through 'open' get priority in overload resolution. + member Priority: ExtensionMethodPriority /// The environment of information used to resolve names [] type NameResolutionEnv = - { /// Display environment information for output - eDisplayEnv: DisplayEnv + { /// Display environment information for output + eDisplayEnv: DisplayEnv - /// Values and Data Tags available by unqualified name - eUnqualifiedItems: LayeredMap + /// Values and Data Tags available by unqualified name + eUnqualifiedItems: LayeredMap /// Enclosing type instantiations that are associated with an unqualified type item eUnqualifiedEnclosingTypeInsts: TyconRefMap - /// Data Tags and Active Pattern Tags available by unqualified name + /// Data Tags and Active Pattern Tags available by unqualified name ePatItems: NameMap - /// Modules accessible via "." notation. Note this is a multi-map. - /// Adding a module abbreviation adds it a local entry to this List.map. - /// Likewise adding a ccu or opening a path adds entries to this List.map. - eModulesAndNamespaces: NameMultiMap + /// Modules accessible via "." notation. Note this is a multi-map. + /// Adding a module abbreviation adds it a local entry to this List.map. + /// Likewise adding a ccu or opening a path adds entries to this List.map. + eModulesAndNamespaces: NameMultiMap - /// Fully qualified modules and namespaces. 'open' does not change this. - eFullyQualifiedModulesAndNamespaces: NameMultiMap + /// Fully qualified modules and namespaces. 'open' does not change this. + eFullyQualifiedModulesAndNamespaces: NameMultiMap - /// RecdField labels in scope. RecdField labels are those where type are inferred - /// by label rather than by known type annotation. - /// Bools indicate if from a record, where no warning is given on indeterminate lookup + /// RecdField labels in scope. RecdField labels are those where type are inferred + /// by label rather than by known type annotation. + /// Bools indicate if from a record, where no warning is given on indeterminate lookup eFieldLabels: NameMultiMap /// Record or unions that may have type instantiations associated with them /// when record labels or union cases are used in an unqualified context. eUnqualifiedRecordOrUnionTypeInsts: TyconRefMap - /// Tycons indexed by the various names that may be used to access them, e.g. - /// "List" --> multiple TyconRef's for the various tycons accessible by this name. - /// "List`1" --> TyconRef - eTyconsByAccessNames: LayeredMultiMap + /// Tycons indexed by the various names that may be used to access them, e.g. + /// "List" --> multiple TyconRef's for the various tycons accessible by this name. + /// "List`1" --> TyconRef + eTyconsByAccessNames: LayeredMultiMap - eFullyQualifiedTyconsByAccessNames: LayeredMultiMap + eFullyQualifiedTyconsByAccessNames: LayeredMultiMap - /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) - eTyconsByDemangledNameAndArity: LayeredMap + /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) + eTyconsByDemangledNameAndArity: LayeredMap - /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) - eFullyQualifiedTyconsByDemangledNameAndArity: LayeredMap + /// Tycons available by unqualified, demangled names (i.e. (List,1) --> TyconRef) + eFullyQualifiedTyconsByDemangledNameAndArity: LayeredMap - /// Extension members by type and name + /// Extension members by type and name eIndexedExtensionMembers: TyconRefMultiMap /// Other extension members unindexed by type eUnindexedExtensionMembers: ExtensionMember list - /// Typars (always available by unqualified names). Further typars can be - /// in the tpenv, a structure folded through each top-level definition. + /// Typars (always available by unqualified names). Further typars can be + /// in the tpenv, a structure folded through each top-level definition. eTypars: NameMap - } - static member Empty: g:TcGlobals -> NameResolutionEnv + } + static member Empty: g: TcGlobals -> NameResolutionEnv member DisplayEnv: DisplayEnv member FindUnqualifiedItem: string -> Item type FullyQualifiedFlag = - | FullyQualified - | OpenQualified + | FullyQualified + | OpenQualified [] -type BulkAdd = Yes | No +type BulkAdd = + | Yes + | No /// Find a field in anonymous record type val internal TryFindAnonRecdFieldOfType: TcGlobals -> TType -> string -> Item option -/// Add extra items to the environment for Visual Studio, e.g. static members +/// Add extra items to the environment for Visual Studio, e.g. static members val internal AddFakeNamedValRefToNameEnv: string -> NameResolutionEnv -> ValRef -> NameResolutionEnv /// Add some extra items to the environment for Visual Studio, e.g. record members @@ -245,28 +247,64 @@ val internal AddFakeNameToNameEnv: string -> NameResolutionEnv -> Item -> NameRe val internal AddValRefToNameEnv: TcGlobals -> NameResolutionEnv -> ValRef -> NameResolutionEnv /// Add active pattern result tags to the environment. -val internal AddActivePatternResultTagsToNameEnv: ActivePatternInfo -> NameResolutionEnv -> TType -> range -> NameResolutionEnv - -/// Add a list of type definitions to the name resolution environment -val internal AddTyconRefsToNameEnv : BulkAdd -> bool -> TcGlobals -> ImportMap -> AccessorDomain -> range -> bool -> NameResolutionEnv -> TyconRef list -> NameResolutionEnv - -/// Add an F# exception definition to the name resolution environment -val internal AddExceptionDeclsToNameEnv : BulkAdd -> NameResolutionEnv -> TyconRef -> NameResolutionEnv - -/// Add a module abbreviation to the name resolution environment -val internal AddModuleAbbrevToNameEnv : Ident -> NameResolutionEnv -> ModuleOrNamespaceRef list -> NameResolutionEnv +val internal AddActivePatternResultTagsToNameEnv: + ActivePatternInfo -> NameResolutionEnv -> TType -> range -> NameResolutionEnv + +/// Add a list of type definitions to the name resolution environment +val internal AddTyconRefsToNameEnv: + BulkAdd -> + bool -> + TcGlobals -> + ImportMap -> + AccessorDomain -> + range -> + bool -> + NameResolutionEnv -> + TyconRef list -> + NameResolutionEnv + +/// Add an F# exception definition to the name resolution environment +val internal AddExceptionDeclsToNameEnv: BulkAdd -> NameResolutionEnv -> TyconRef -> NameResolutionEnv + +/// Add a module abbreviation to the name resolution environment +val internal AddModuleAbbrevToNameEnv: Ident -> NameResolutionEnv -> ModuleOrNamespaceRef list -> NameResolutionEnv /// Add a list of module or namespace to the name resolution environment, including any sub-modules marked 'AutoOpen' -val internal AddModuleOrNamespaceRefsToNameEnv : TcGlobals -> ImportMap -> range -> bool -> AccessorDomain -> NameResolutionEnv -> ModuleOrNamespaceRef list -> NameResolutionEnv +val internal AddModuleOrNamespaceRefsToNameEnv: + TcGlobals -> + ImportMap -> + range -> + bool -> + AccessorDomain -> + NameResolutionEnv -> + ModuleOrNamespaceRef list -> + NameResolutionEnv /// Add a single modules or namespace to the name resolution environment -val internal AddModuleOrNamespaceRefToNameEnv : TcGlobals -> ImportMap -> range -> bool -> AccessorDomain -> NameResolutionEnv -> ModuleOrNamespaceRef -> NameResolutionEnv +val internal AddModuleOrNamespaceRefToNameEnv: + TcGlobals -> + ImportMap -> + range -> + bool -> + AccessorDomain -> + NameResolutionEnv -> + ModuleOrNamespaceRef -> + NameResolutionEnv /// Add a list of modules or namespaces to the name resolution environment -val internal AddModuleOrNamespaceRefsContentsToNameEnv: TcGlobals -> ImportMap -> AccessorDomain -> range -> bool -> NameResolutionEnv -> ModuleOrNamespaceRef list -> NameResolutionEnv +val internal AddModuleOrNamespaceRefsContentsToNameEnv: + TcGlobals -> + ImportMap -> + AccessorDomain -> + range -> + bool -> + NameResolutionEnv -> + ModuleOrNamespaceRef list -> + NameResolutionEnv /// Add the content of a type to the name resolution environment -val internal AddTypeContentsToNameEnv: TcGlobals -> ImportMap -> AccessorDomain -> range -> NameResolutionEnv -> TType -> NameResolutionEnv +val internal AddTypeContentsToNameEnv: + TcGlobals -> ImportMap -> AccessorDomain -> range -> NameResolutionEnv -> TType -> NameResolutionEnv /// A flag which indicates if it is an error to have two declared type parameters with identical names /// in the name resolution environment. @@ -275,7 +313,8 @@ type CheckForDuplicateTyparFlag = | NoCheckForDuplicateTypars /// Add some declared type parameters to the name resolution environment -val internal AddDeclaredTyparsToNameEnv: CheckForDuplicateTyparFlag -> NameResolutionEnv -> Typar list -> NameResolutionEnv +val internal AddDeclaredTyparsToNameEnv: + CheckForDuplicateTyparFlag -> NameResolutionEnv -> Typar list -> NameResolutionEnv /// Qualified lookup of type names in the environment val internal LookupTypeNameInEnvNoArity: FullyQualifiedFlag -> string -> NameResolutionEnv -> TyconRef list @@ -288,22 +327,22 @@ type TypeNameResolutionFlag = /// Indicates we are resolving type names to type definitions | ResolveTypeNamesToTypeRefs -/// Represents information about the generic argument count of a type name when resolving it. +/// Represents information about the generic argument count of a type name when resolving it. /// /// In some situations we resolve "List" to any type definition with that name regardless of the number /// of generic arguments. In others, we know precisely how many generic arguments are needed. -[] -type TypeNameResolutionStaticArgsInfo = +[] +type TypeNameResolutionStaticArgsInfo = /// Indicates definite knowledge of empty type arguments, i.e. the logical equivalent of name< > static member DefiniteEmpty: TypeNameResolutionStaticArgsInfo /// Deduce definite knowledge of type arguments - static member FromTyArgs: numTyArgs:int -> TypeNameResolutionStaticArgsInfo + static member FromTyArgs: numTyArgs: int -> TypeNameResolutionStaticArgsInfo /// Represents information which guides name resolution of types. [] -type TypeNameResolutionInfo = +type TypeNameResolutionInfo = | TypeNameResolutionInfo of TypeNameResolutionFlag * TypeNameResolutionStaticArgsInfo static member Default: TypeNameResolutionInfo @@ -312,16 +351,16 @@ type TypeNameResolutionInfo = /// Represents the kind of the occurrence when reporting a name in name resolution [] -type internal ItemOccurence = - | Binding - | Use - | UseInType - | UseInAttribute - | Pattern - | Implemented +type internal ItemOccurence = + | Binding + | Use + | UseInType + | UseInAttribute + | Pattern + | Implemented | RelatedText | Open - + /// Check for equality, up to signature matching val ItemsAreEffectivelyEqual: TcGlobals -> Item -> Item -> bool @@ -329,7 +368,7 @@ val ItemsAreEffectivelyEqual: TcGlobals -> Item -> Item -> bool val ItemsAreEffectivelyEqualHash: TcGlobals -> Item -> int [] -type internal CapturedNameResolution = +type internal CapturedNameResolution = /// line and column member Pos: pos @@ -355,7 +394,7 @@ type internal CapturedNameResolution = member Range: range [] -type internal TcResolutions = +type internal TcResolutions = /// Name resolution environments for every interesting region in the file. These regions may /// overlap, in which case the smallest region applicable should be used. @@ -373,28 +412,28 @@ type internal TcResolutions = /// See TypeCheckInfo.GetCapturedNameResolutions for example. member CapturedMethodGroupResolutions: ResizeArray - /// Represents the empty set of resolutions + /// Represents the empty set of resolutions static member Empty: TcResolutions [] -type TcSymbolUseData = - { ItemWithInst: ItemWithInst - ItemOccurence: ItemOccurence - DisplayEnv: DisplayEnv - Range: range } +type TcSymbolUseData = + { ItemWithInst: ItemWithInst + ItemOccurence: ItemOccurence + DisplayEnv: DisplayEnv + Range: range } /// Represents container for all name resolutions that were met so far when typechecking some particular file [] -type internal TcSymbolUses = +type internal TcSymbolUses = /// Get all the uses of a particular item within the file - member GetUsesOfSymbol: Item -> TcSymbolUseData[] + member GetUsesOfSymbol: Item -> TcSymbolUseData [] /// All the uses of all items within the file - member AllUsesOfSymbols: TcSymbolUseData[][] + member AllUsesOfSymbols: TcSymbolUseData [] [] /// Get the locations of all the printf format specifiers in the file - member GetFormatSpecifierLocationsAndArity: unit -> (range * int)[] + member GetFormatSpecifierLocationsAndArity: unit -> (range * int) [] /// Empty collection of symbol uses static member Empty: TcSymbolUses @@ -405,8 +444,7 @@ type FormatStringCheckContext = SourceText: ISourceText /// Array of line start positions - LineStartPositions: int[] - } + LineStartPositions: int [] } /// An abstract type for reporting the results of name resolution and type checking type ITypecheckResultsSink = @@ -418,10 +456,12 @@ type ITypecheckResultsSink = abstract NotifyExprHasType: TType * NameResolutionEnv * AccessorDomain * range -> unit /// Record that a name resolution occurred at a specific location in the source - abstract NotifyNameResolution: pos * Item * TyparInst * ItemOccurence * NameResolutionEnv * AccessorDomain * range * bool -> unit + abstract NotifyNameResolution: + pos * Item * TyparInst * ItemOccurence * NameResolutionEnv * AccessorDomain * range * bool -> unit /// Record that a method group name resolution occurred at a specific location in the source - abstract NotifyMethodGroupNameResolution: pos * Item * Item * TyparInst * ItemOccurence * NameResolutionEnv * AccessorDomain * range * bool -> unit + abstract NotifyMethodGroupNameResolution: + pos * Item * Item * TyparInst * ItemOccurence * NameResolutionEnv * AccessorDomain * range * bool -> unit /// Record that a printf format specifier occurred at a specific location in the source abstract NotifyFormatSpecifierLocation: range * int -> unit @@ -448,16 +488,16 @@ type internal TcResultsSinkImpl = member GetSymbolUses: unit -> TcSymbolUses /// Get all open declarations reported to the sink - member GetOpenDeclarations: unit -> OpenDeclaration[] + member GetOpenDeclarations: unit -> OpenDeclaration [] /// Get the format specifier locations - member GetFormatSpecifierLocations: unit -> (range * int)[] + member GetFormatSpecifierLocations: unit -> (range * int) [] interface ITypecheckResultsSink /// 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 = +type TcResultsSink = { mutable CurrentSink: ITypecheckResultsSink option } static member NoSink: TcResultsSink static member WithSink: ITypecheckResultsSink -> TcResultsSink @@ -476,31 +516,60 @@ val internal WithNewTypecheckResultsSink: ITypecheckResultsSink * TcResultsSink val internal TemporarilySuspendReportingTypecheckResultsToSink: TcResultsSink -> System.IDisposable /// Report the active name resolution environment for a source range -val internal CallEnvSink : TcResultsSink -> range * NameResolutionEnv * AccessorDomain -> unit +val internal CallEnvSink: TcResultsSink -> range * NameResolutionEnv * AccessorDomain -> unit /// Report a specific name resolution at a source range -val internal CallNameResolutionSink: TcResultsSink -> range * NameResolutionEnv * Item * TyparInst * ItemOccurence * AccessorDomain -> unit +val internal CallNameResolutionSink: + TcResultsSink -> range * NameResolutionEnv * Item * TyparInst * ItemOccurence * AccessorDomain -> unit /// Report a specific method group name resolution at a source range -val internal CallMethodGroupNameResolutionSink: TcResultsSink -> range * NameResolutionEnv * Item * Item * TyparInst * ItemOccurence * AccessorDomain -> unit +val internal CallMethodGroupNameResolutionSink: + TcResultsSink -> range * NameResolutionEnv * Item * Item * TyparInst * ItemOccurence * AccessorDomain -> unit /// Report a specific name resolution at a source range, replacing any previous resolutions -val internal CallNameResolutionSinkReplacing: TcResultsSink -> range * NameResolutionEnv * Item * TyparInst * ItemOccurence * AccessorDomain -> unit +val internal CallNameResolutionSinkReplacing: + TcResultsSink -> range * NameResolutionEnv * Item * TyparInst * ItemOccurence * AccessorDomain -> unit /// Report a specific name resolution at a source range -val internal CallExprHasTypeSink : TcResultsSink -> range * NameResolutionEnv * TType * AccessorDomain -> unit +val internal CallExprHasTypeSink: TcResultsSink -> range * NameResolutionEnv * TType * AccessorDomain -> unit /// Report an open declaration val internal CallOpenDeclarationSink: TcResultsSink -> OpenDeclaration -> unit /// Get all the available properties of a type (both intrinsic and extension) -val internal AllPropInfosOfTypeInScope: ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> AccessorDomain -> FindMemberFlag -> range -> TType -> PropInfo list +val internal AllPropInfosOfTypeInScope: + ResultCollectionSettings -> + InfoReader -> + NameResolutionEnv -> + string option -> + AccessorDomain -> + FindMemberFlag -> + range -> + TType -> + PropInfo list /// Get all the available properties of a type (only extension) -val internal ExtensionPropInfosOfTypeInScope: ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> AccessorDomain -> range -> TType -> PropInfo list +val internal ExtensionPropInfosOfTypeInScope: + ResultCollectionSettings -> + InfoReader -> + NameResolutionEnv -> + string option -> + AccessorDomain -> + range -> + TType -> + PropInfo list /// Get the available methods of a type (both declared and inherited) -val internal AllMethInfosOfTypeInScope: ResultCollectionSettings -> InfoReader -> NameResolutionEnv -> string option -> AccessorDomain -> FindMemberFlag -> range -> TType -> MethInfo list +val internal AllMethInfosOfTypeInScope: + ResultCollectionSettings -> + InfoReader -> + NameResolutionEnv -> + string option -> + AccessorDomain -> + FindMemberFlag -> + range -> + TType -> + MethInfo list /// Used to report an error condition where name resolution failed due to an indeterminate type exception internal IndeterminateType of range @@ -509,84 +578,177 @@ exception internal IndeterminateType of range exception internal UpperCaseIdentifierInPattern of range /// Generate a new reference to a record field with a fresh type instantiation -val FreshenRecdFieldRef :NameResolver -> range -> RecdFieldRef -> RecdFieldInfo +val FreshenRecdFieldRef: NameResolver -> range -> RecdFieldRef -> RecdFieldInfo /// Indicates the kind of lookup being performed. Note, this type should be made private to nameres.fs. [] type LookupKind = - | RecdField - | Pattern - | Expr - | Type - | Ctor + | RecdField + | Pattern + | Expr + | Type + | Ctor /// Indicates if a warning should be given for the use of upper-case identifiers in patterns type WarnOnUpperFlag = - | WarnOnUpperCase - | AllIdsOK + | WarnOnUpperCase + | AllIdsOK /// Indicates whether we permit a direct reference to a type generator. Only set when resolving the /// right-hand-side of a [] declaration. [] -type PermitDirectReferenceToGeneratedType = - | Yes +type PermitDirectReferenceToGeneratedType = + | Yes | No /// Resolve a long identifier to a namespace, module. -val internal ResolveLongIdentAsModuleOrNamespace: TcResultsSink -> ResultCollectionSettings -> ImportMap -> range -> first: bool -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident -> Ident list -> isOpenDecl: bool -> ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list > +val internal ResolveLongIdentAsModuleOrNamespace: + TcResultsSink -> + ResultCollectionSettings -> + ImportMap -> + range -> + first: bool -> + FullyQualifiedFlag -> + NameResolutionEnv -> + AccessorDomain -> + Ident -> + Ident list -> + isOpenDecl: bool -> + ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list> /// Resolve a long identifier to an object constructor. -val internal ResolveObjectConstructor : NameResolver -> DisplayEnv -> range -> AccessorDomain -> TType -> ResultOrException +val internal ResolveObjectConstructor: + NameResolver -> DisplayEnv -> range -> AccessorDomain -> TType -> ResultOrException /// Resolve a long identifier using type-qualified name resolution. -val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list +val internal ResolveLongIdentInType: + TcResultsSink -> + NameResolver -> + NameResolutionEnv -> + LookupKind -> + range -> + AccessorDomain -> + Ident -> + FindMemberFlag -> + TypeNameResolutionInfo -> + TType -> + Item * Ident list /// Resolve a long identifier when used in a pattern. -val internal ResolvePatternLongIdent : TcResultsSink -> NameResolver -> WarnOnUpperFlag -> bool -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item - -/// Resolve a long identifier representing a type name -val internal ResolveTypeLongIdentInTyconRef : TcResultsSink -> NameResolver -> NameResolutionEnv -> TypeNameResolutionInfo -> AccessorDomain -> range -> ModuleOrNamespaceRef -> Ident list -> TyconRef +val internal ResolvePatternLongIdent: + TcResultsSink -> + NameResolver -> + WarnOnUpperFlag -> + bool -> + range -> + AccessorDomain -> + NameResolutionEnv -> + TypeNameResolutionInfo -> + Ident list -> + Item + +/// Resolve a long identifier representing a type name +val internal ResolveTypeLongIdentInTyconRef: + TcResultsSink -> + NameResolver -> + NameResolutionEnv -> + TypeNameResolutionInfo -> + AccessorDomain -> + range -> + ModuleOrNamespaceRef -> + Ident list -> + TyconRef /// Resolve a long identifier to a type definition -val internal ResolveTypeLongIdent : TcResultsSink -> NameResolver -> ItemOccurence -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident list -> TypeNameResolutionStaticArgsInfo -> PermitDirectReferenceToGeneratedType -> ResultOrException +val internal ResolveTypeLongIdent: + TcResultsSink -> + NameResolver -> + ItemOccurence -> + FullyQualifiedFlag -> + NameResolutionEnv -> + AccessorDomain -> + Ident list -> + TypeNameResolutionStaticArgsInfo -> + PermitDirectReferenceToGeneratedType -> + ResultOrException /// Resolve a long identifier to a field -val internal ResolveField : TcResultsSink -> NameResolver -> NameResolutionEnv -> AccessorDomain -> TType -> Ident list * Ident -> Ident list -> FieldResolution list +val internal ResolveField: + TcResultsSink -> + NameResolver -> + NameResolutionEnv -> + AccessorDomain -> + TType -> + Ident list * Ident -> + Ident list -> + FieldResolution list /// Resolve a long identifier occurring in an expression position -val internal ResolveExprLongIdent : TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> ResultOrException +val internal ResolveExprLongIdent: + TcResultsSink -> + NameResolver -> + range -> + AccessorDomain -> + NameResolutionEnv -> + TypeNameResolutionInfo -> + Ident list -> + ResultOrException val internal getRecordFieldsInScope: NameResolutionEnv -> Item list /// Resolve a (possibly incomplete) long identifier to a loist of possible class or record fields -val internal ResolvePartialLongIdentToClassOrRecdFields: NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> bool -> Item list +val internal ResolvePartialLongIdentToClassOrRecdFields: + NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> bool -> bool -> Item list /// Return the fields for the given class or record -val internal ResolveRecordOrClassFieldsOfType : NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list +val internal ResolveRecordOrClassFieldsOfType: NameResolver -> range -> AccessorDomain -> TType -> bool -> Item list -/// Specifies extra work to do after overload resolution +/// Specifies extra work to do after overload resolution [] type AfterResolution = /// Notification is not needed | DoNothing /// Notify the sink of the information needed to complete recording a use of a symbol - /// for the purposes of the language service. One of the callbacks should be called by + /// for the purposes of the language service. One of the callbacks should be called by /// the checker. /// - /// The first callback represents a case where we have learned the type + /// The first callback represents a case where we have learned the type /// instantiation of a generic method or value. /// - /// The second represents the case where we have resolved overloading and/or + /// The second represents the case where we have resolved overloading and/or /// a specific override. The 'Item option' contains the candidate overrides. - | RecordResolution of Item option * (TyparInst -> unit) * (MethInfo * PropInfo option * TyparInst -> unit) * (unit -> unit) + | RecordResolution of + Item option * + (TyparInst -> unit) * + (MethInfo * PropInfo option * TyparInst -> unit) * + (unit -> unit) /// Resolve a long identifier occurring in an expression position. -val internal ResolveLongIdentAsExprAndComputeRange: TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> ResultOrException +val internal ResolveLongIdentAsExprAndComputeRange: + TcResultsSink -> + NameResolver -> + range -> + AccessorDomain -> + NameResolutionEnv -> + TypeNameResolutionInfo -> + Ident list -> + ResultOrException /// Resolve a long identifier occurring in an expression position, qualified by a type. -val internal ResolveExprDotLongIdentAndComputeRange: TcResultsSink -> NameResolver -> range -> AccessorDomain -> NameResolutionEnv -> TType -> Ident list -> TypeNameResolutionInfo -> FindMemberFlag -> bool -> Item * range * Ident list * AfterResolution +val internal ResolveExprDotLongIdentAndComputeRange: + TcResultsSink -> + NameResolver -> + range -> + AccessorDomain -> + NameResolutionEnv -> + TType -> + Ident list -> + TypeNameResolutionInfo -> + FindMemberFlag -> + bool -> + Item * range * Ident list * AfterResolution /// A generator of type instantiations used when no more specific type instantiation is known. val FakeInstantiationGenerator: range -> Typar list -> TType list @@ -595,7 +757,15 @@ val FakeInstantiationGenerator: range -> Typar list -> TType list val TryToResolveLongIdentAsType: NameResolver -> NameResolutionEnv -> range -> string list -> TType option /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions. -val ResolvePartialLongIdent: NameResolver -> NameResolutionEnv -> (MethInfo -> TType -> bool) -> range -> AccessorDomain -> string list -> bool -> Item list +val ResolvePartialLongIdent: + NameResolver -> + NameResolutionEnv -> + (MethInfo -> TType -> bool) -> + range -> + AccessorDomain -> + string list -> + bool -> + Item list [] type ResolveCompletionTargets = @@ -603,10 +773,20 @@ type ResolveCompletionTargets = | SettablePropertiesAndFields /// Resolve a (possibly incomplete) long identifier to a set of possible resolutions, qualified by type. -val ResolveCompletionsInType : NameResolver -> NameResolutionEnv -> ResolveCompletionTargets -> range -> AccessorDomain -> bool -> TType -> Item list - -val GetVisibleNamespacesAndModulesAtPoint: NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> ModuleOrNamespaceRef list +val ResolveCompletionsInType: + NameResolver -> + NameResolutionEnv -> + ResolveCompletionTargets -> + range -> + AccessorDomain -> + bool -> + TType -> + Item list + +val GetVisibleNamespacesAndModulesAtPoint: + NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> ModuleOrNamespaceRef list val IsItemResolvable: NameResolver -> NameResolutionEnv -> range -> AccessorDomain -> string list -> Item -> bool -val TrySelectExtensionMethInfoOfILExtMem: range -> ImportMap -> TType -> TyconRef * MethInfo * ExtensionMethodPriority -> MethInfo option +val TrySelectExtensionMethInfoOfILExtMem: + range -> ImportMap -> TType -> TyconRef * MethInfo * ExtensionMethodPriority -> MethInfo option diff --git a/src/fsharp/NicePrint.fsi b/src/fsharp/NicePrint.fsi index cf497fb8b88..77e00321a99 100644 --- a/src/fsharp/NicePrint.fsi +++ b/src/fsharp/NicePrint.fsi @@ -4,7 +4,7 @@ module internal FSharp.Compiler.NicePrint open System.Text -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.Import open FSharp.Compiler.Infos @@ -15,108 +15,136 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps module PrintUtilities = - val layoutBuiltinAttribute: denv:DisplayEnv -> attrib:BuiltinAttribInfo -> Layout + val layoutBuiltinAttribute: denv: DisplayEnv -> attrib: BuiltinAttribInfo -> Layout -val layoutTyparConstraint: denv:DisplayEnv -> Typar * TyparConstraint -> Layout +val layoutTyparConstraint: denv: DisplayEnv -> Typar * TyparConstraint -> Layout -val outputType: denv:DisplayEnv -> os:StringBuilder -> x:TType -> unit +val outputType: denv: DisplayEnv -> os: StringBuilder -> x: TType -> unit -val layoutType: denv:DisplayEnv -> x:TType -> Layout +val layoutType: denv: DisplayEnv -> x: TType -> Layout -val outputTypars: denv:DisplayEnv -> nm:TaggedText -> os:StringBuilder -> x:Typars -> unit +val outputTypars: denv: DisplayEnv -> nm: TaggedText -> os: StringBuilder -> x: Typars -> unit -val outputTyconRef: denv:DisplayEnv -> os:StringBuilder -> x:TyconRef -> unit +val outputTyconRef: denv: DisplayEnv -> os: StringBuilder -> x: TyconRef -> unit -val layoutTyconRef: denv:DisplayEnv -> x:TyconRef -> Layout +val layoutTyconRef: denv: DisplayEnv -> x: TyconRef -> Layout -val layoutConst: g:TcGlobals -> ty:TType -> c:Const -> Layout +val layoutConst: g: TcGlobals -> ty: TType -> c: Const -> Layout -val prettyLayoutOfMemberSig: denv:DisplayEnv -> (Typar * TType) list * string * Typars * (TType * ArgReprInfo) list list * TType -> Layout +val prettyLayoutOfMemberSig: + denv: DisplayEnv -> (Typar * TType) list * string * Typars * (TType * ArgReprInfo) list list * TType -> Layout -val prettyLayoutOfUncurriedSig: denv:DisplayEnv -> argInfos:TyparInst -> tau:UncurriedArgInfos -> (TType -> TyparInst * Layout) +val prettyLayoutOfUncurriedSig: + denv: DisplayEnv -> argInfos: TyparInst -> tau: UncurriedArgInfos -> (TType -> TyparInst * Layout) -val prettyLayoutsOfUnresolvedOverloading: denv:DisplayEnv -> argInfos:(TType * ArgReprInfo) list -> retTy:TType -> genericParameters:seq -> Layout * Layout * Layout +val prettyLayoutsOfUnresolvedOverloading: + denv: DisplayEnv -> + argInfos: (TType * ArgReprInfo) list -> + retTy: TType -> + genericParameters: seq -> + Layout * Layout * Layout -val dataExprL: denv:DisplayEnv -> expr:Expr -> Layout +val dataExprL: denv: DisplayEnv -> expr: Expr -> Layout -val outputValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> os:StringBuilder -> x:ValRef -> unit +val outputValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> x: ValRef -> unit -val stringValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> x:ValRef -> string +val stringValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> x: ValRef -> string -val layoutQualifiedValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> typarInst:TyparInst -> v:ValRef -> TyparInst * Layout +val layoutQualifiedValOrMember: + denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInst -> v: ValRef -> TyparInst * Layout -val outputQualifiedValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> os:StringBuilder -> v:ValRef -> unit +val outputQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit -val outputQualifiedValSpec: denv:DisplayEnv -> infoReader:InfoReader -> os:StringBuilder -> v:ValRef -> unit +val outputQualifiedValSpec: denv: DisplayEnv -> infoReader: InfoReader -> os: StringBuilder -> v: ValRef -> unit -val stringOfQualifiedValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> v:ValRef -> string +val stringOfQualifiedValOrMember: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> string -val formatMethInfoToBufferFreeStyle: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> buf:StringBuilder -> d:MethInfo -> unit +val formatMethInfoToBufferFreeStyle: + infoReader: InfoReader -> m: range -> denv: DisplayEnv -> buf: StringBuilder -> d: MethInfo -> unit -val prettyLayoutOfMethInfoFreeStyle: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> typarInst:TyparInst -> minfo:MethInfo -> TyparInst * Layout +val prettyLayoutOfMethInfoFreeStyle: + infoReader: InfoReader -> + m: range -> + denv: DisplayEnv -> + typarInst: TyparInst -> + minfo: MethInfo -> + TyparInst * Layout -val prettyLayoutOfPropInfoFreeStyle: g:TcGlobals -> amap:ImportMap -> m:range -> denv:DisplayEnv -> d:PropInfo -> Layout +val prettyLayoutOfPropInfoFreeStyle: + g: TcGlobals -> amap: ImportMap -> m: range -> denv: DisplayEnv -> d: PropInfo -> Layout -val stringOfMethInfo: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> minfo:MethInfo -> string +val stringOfMethInfo: infoReader: InfoReader -> m: range -> denv: DisplayEnv -> minfo: MethInfo -> string -val multiLineStringOfMethInfos: infoReader:InfoReader -> m:range -> denv:DisplayEnv -> minfos:MethInfo list -> string +val multiLineStringOfMethInfos: + infoReader: InfoReader -> m: range -> denv: DisplayEnv -> minfos: MethInfo list -> string -val stringOfParamData: denv:DisplayEnv -> paramData:ParamData -> string +val stringOfParamData: denv: DisplayEnv -> paramData: ParamData -> string -val layoutOfParamData: denv:DisplayEnv -> paramData:ParamData -> Layout +val layoutOfParamData: denv: DisplayEnv -> paramData: ParamData -> Layout -val layoutExnDef: denv:DisplayEnv -> infoReader:InfoReader -> x:EntityRef -> Layout +val layoutExnDef: denv: DisplayEnv -> infoReader: InfoReader -> x: EntityRef -> Layout -val stringOfTyparConstraints: denv:DisplayEnv -> x:(Typar * TyparConstraint) list -> string +val stringOfTyparConstraints: denv: DisplayEnv -> x: (Typar * TyparConstraint) list -> string -val layoutTyconDefn: denv:DisplayEnv -> infoReader:InfoReader -> ad:AccessorDomain -> m:range -> x:Tycon -> Layout +val layoutTyconDefn: denv: DisplayEnv -> infoReader: InfoReader -> ad: AccessorDomain -> m: range -> x: Tycon -> Layout -val layoutEntityDefn: denv:DisplayEnv -> infoReader:InfoReader -> ad:AccessorDomain -> m:range -> x:EntityRef -> Layout +val layoutEntityDefn: + denv: DisplayEnv -> infoReader: InfoReader -> ad: AccessorDomain -> m: range -> x: EntityRef -> Layout -val layoutUnionCases: denv:DisplayEnv -> infoReader:InfoReader -> enclosingTcref:TyconRef -> x:RecdField list -> Layout +val layoutUnionCases: + denv: DisplayEnv -> infoReader: InfoReader -> enclosingTcref: TyconRef -> x: RecdField list -> Layout -val isGeneratedUnionCaseField: pos:int -> f:RecdField -> bool +val isGeneratedUnionCaseField: pos: int -> f: RecdField -> bool -val isGeneratedExceptionField: pos:'a -> f:RecdField -> bool +val isGeneratedExceptionField: pos: 'a -> f: RecdField -> bool -val stringOfTyparConstraint: denv:DisplayEnv -> Typar * TyparConstraint -> string +val stringOfTyparConstraint: denv: DisplayEnv -> Typar * TyparConstraint -> string -val stringOfTy: denv:DisplayEnv -> x:TType -> string +val stringOfTy: denv: DisplayEnv -> x: TType -> string -val prettyLayoutOfType: denv:DisplayEnv -> x:TType -> Layout +val prettyLayoutOfType: denv: DisplayEnv -> x: TType -> Layout -val prettyLayoutOfTypeNoCx: denv:DisplayEnv -> x:TType -> Layout +val prettyLayoutOfTypeNoCx: denv: DisplayEnv -> x: TType -> Layout -val prettyLayoutOfTypar: denv:DisplayEnv -> x:Typar -> Layout +val prettyLayoutOfTypar: denv: DisplayEnv -> x: Typar -> Layout -val prettyStringOfTy: denv:DisplayEnv -> x:TType -> string +val prettyStringOfTy: denv: DisplayEnv -> x: TType -> string -val prettyStringOfTyNoCx: denv:DisplayEnv -> x:TType -> string +val prettyStringOfTyNoCx: denv: DisplayEnv -> x: TType -> string -val stringOfRecdField: denv:DisplayEnv -> infoReader:InfoReader -> enclosingTcref:TyconRef -> x:RecdField -> string +val stringOfRecdField: denv: DisplayEnv -> infoReader: InfoReader -> enclosingTcref: TyconRef -> x: RecdField -> string -val stringOfUnionCase: denv:DisplayEnv -> infoReader:InfoReader -> enclosingTcref:TyconRef -> x:UnionCase -> string +val stringOfUnionCase: denv: DisplayEnv -> infoReader: InfoReader -> enclosingTcref: TyconRef -> x: UnionCase -> string -val stringOfExnDef: denv:DisplayEnv -> infoReader:InfoReader -> x:EntityRef -> string +val stringOfExnDef: denv: DisplayEnv -> infoReader: InfoReader -> x: EntityRef -> string -val stringOfFSAttrib: denv:DisplayEnv -> x:Attrib -> string +val stringOfFSAttrib: denv: DisplayEnv -> x: Attrib -> string -val stringOfILAttrib: denv:DisplayEnv -> ILType * ILAttribElem list -> string +val stringOfILAttrib: denv: DisplayEnv -> ILType * ILAttribElem list -> string -val layoutInferredSigOfModuleExpr: showHeader:bool -> denv:DisplayEnv -> infoReader:InfoReader -> ad:AccessorDomain -> m:range -> expr:ModuleOrNamespaceExprWithSig -> Layout +val layoutInferredSigOfModuleExpr: + showHeader: bool -> + denv: DisplayEnv -> + infoReader: InfoReader -> + ad: AccessorDomain -> + m: range -> + expr: ModuleOrNamespaceExprWithSig -> + Layout -val prettyLayoutOfValOrMember: denv:DisplayEnv -> infoReader:InfoReader -> typarInst:TyparInst -> v:ValRef -> TyparInst * Layout +val prettyLayoutOfValOrMember: + denv: DisplayEnv -> infoReader: InfoReader -> typarInst: TyparInst -> v: ValRef -> TyparInst * Layout -val prettyLayoutOfValOrMemberNoInst: denv:DisplayEnv -> infoReader:InfoReader -> v:ValRef -> Layout +val prettyLayoutOfValOrMemberNoInst: denv: DisplayEnv -> infoReader: InfoReader -> v: ValRef -> Layout -val prettyLayoutOfMemberNoInstShort: denv:DisplayEnv -> v:Val -> Layout +val prettyLayoutOfMemberNoInstShort: denv: DisplayEnv -> v: Val -> Layout -val layoutOfValReturnType: denv:DisplayEnv -> v:ValRef -> Layout +val layoutOfValReturnType: denv: DisplayEnv -> v: ValRef -> Layout -val prettyLayoutOfInstAndSig: denv:DisplayEnv -> TyparInst * TTypes * TType -> TyparInst * (TTypes * TType) * (Layout list * Layout) * Layout +val prettyLayoutOfInstAndSig: + denv: DisplayEnv -> TyparInst * TTypes * TType -> TyparInst * (TTypes * TType) * (Layout list * Layout) * Layout -val minimalStringsOfTwoTypes: denv:DisplayEnv -> t1:TType -> t2:TType -> string * string * string +val minimalStringsOfTwoTypes: denv: DisplayEnv -> t1: TType -> t2: TType -> string * string * string -val minimalStringsOfTwoValues: denv:DisplayEnv -> infoReader:InfoReader -> v1:ValRef -> v2:ValRef -> string * string +val minimalStringsOfTwoValues: denv: DisplayEnv -> infoReader: InfoReader -> v1: ValRef -> v2: ValRef -> string * string -val minimalStringOfType: denv:DisplayEnv -> ty:TType -> string +val minimalStringOfType: denv: DisplayEnv -> ty: TType -> string diff --git a/src/fsharp/OptimizeInputs.fsi b/src/fsharp/OptimizeInputs.fsi index 5a41c3f9bd4..855f49018ab 100644 --- a/src/fsharp/OptimizeInputs.fsi +++ b/src/fsharp/OptimizeInputs.fsi @@ -13,11 +13,12 @@ open FSharp.Compiler.Optimizer open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypedTree -val GetGeneratedILModuleName : CompilerTarget -> string -> string +val GetGeneratedILModuleName: CompilerTarget -> string -> string -val GetInitialOptimizationEnv : TcImports * TcGlobals -> IncrementalOptimizationEnv +val GetInitialOptimizationEnv: TcImports * TcGlobals -> IncrementalOptimizationEnv -val AddExternalCcuToOptimizationEnv : TcGlobals -> IncrementalOptimizationEnv -> ImportedAssembly -> IncrementalOptimizationEnv +val AddExternalCcuToOptimizationEnv: + TcGlobals -> IncrementalOptimizationEnv -> ImportedAssembly -> IncrementalOptimizationEnv val ApplyAllOptimizations: TcConfig * @@ -28,14 +29,24 @@ val ApplyAllOptimizations: isIncrementalFragment: bool * IncrementalOptimizationEnv * CcuThunk * - TypedImplFile list - -> TypedAssemblyAfterOptimization * LazyModuleInfo * IncrementalOptimizationEnv + TypedImplFile list -> + TypedAssemblyAfterOptimization * LazyModuleInfo * IncrementalOptimizationEnv -val CreateIlxAssemblyGenerator : TcConfig * TcImports * TcGlobals * ConstraintSolver.TcValF * CcuThunk -> IlxAssemblyGenerator +val CreateIlxAssemblyGenerator: + TcConfig * TcImports * TcGlobals * ConstraintSolver.TcValF * CcuThunk -> IlxAssemblyGenerator -val GenerateIlxCode : IlxGenBackend * isInteractiveItExpr:bool * isInteractiveOnMono:bool * TcConfig * TopAttribs * TypedAssemblyAfterOptimization * fragName:string * IlxAssemblyGenerator -> IlxGenResults +val GenerateIlxCode: + IlxGenBackend * + isInteractiveItExpr: bool * + isInteractiveOnMono: bool * + TcConfig * + TopAttribs * + TypedAssemblyAfterOptimization * + fragName: string * + IlxAssemblyGenerator -> + IlxGenResults // Used during static linking -val NormalizeAssemblyRefs : CompilationThreadToken * ILGlobals * TcImports -> (ILScopeRef -> ILScopeRef) +val NormalizeAssemblyRefs: CompilationThreadToken * ILGlobals * TcImports -> (ILScopeRef -> ILScopeRef) -val GetGeneratedILModuleName : CompilerTarget -> string -> string +val GetGeneratedILModuleName: CompilerTarget -> string -> string diff --git a/src/fsharp/Optimizer.fsi b/src/fsharp/Optimizer.fsi index 11af2e43331..8da9fad1650 100644 --- a/src/fsharp/Optimizer.fsi +++ b/src/fsharp/Optimizer.fsi @@ -2,54 +2,52 @@ module internal FSharp.Compiler.Optimizer -open FSharp.Compiler -open FSharp.Compiler.TcGlobals +open FSharp.Compiler +open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypedTreePickle -type OptimizationSettings = - { - abstractBigTargets : bool - - jitOptUser : bool option - - localOptUser : bool option - +type OptimizationSettings = + { abstractBigTargets: bool + + jitOptUser: bool option + + localOptUser: bool option + debugPointsForPipeRight: bool option - - crossAssemblyOptimizationUser : bool option - - /// size after which we start chopping methods in two, though only at match targets - bigTargetSize : int - - /// size after which we start enforcing splitting sub-expressions to new methods, to avoid hitting .NET IL limitations - veryBigExprSize : int - + + crossAssemblyOptimizationUser: bool option + + /// size after which we start chopping methods in two, though only at match targets + bigTargetSize: int + + /// size after which we start enforcing splitting sub-expressions to new methods, to avoid hitting .NET IL limitations + veryBigExprSize: int + /// The size after which we don't inline - lambdaInlineThreshold : int - + lambdaInlineThreshold: int + /// For unit testing - reportingPhase : bool - + reportingPhase: bool + reportNoNeedToTailcall: bool - - reportFunctionSizes : bool - - reportHasEffect : bool - - reportTotalSizes : bool - } + reportFunctionSizes: bool + + reportHasEffect: bool - member JitOptimizationsEnabled: bool + reportTotalSizes: bool } - member LocalOptimizationsEnabled: bool + + member JitOptimizationsEnabled: bool + + member LocalOptimizationsEnabled: bool static member Defaults: OptimizationSettings -/// Optimization information +/// Optimization information type ModuleInfo type LazyModuleInfo = Lazy @@ -62,12 +60,13 @@ type CcuOptimizationInfo = LazyModuleInfo type IncrementalOptimizationEnv = static member Empty: IncrementalOptimizationEnv -/// For building optimization environments incrementally -val internal BindCcu: CcuThunk -> CcuOptimizationInfo -> IncrementalOptimizationEnv -> TcGlobals -> IncrementalOptimizationEnv +/// For building optimization environments incrementally +val internal BindCcu: + CcuThunk -> CcuOptimizationInfo -> IncrementalOptimizationEnv -> TcGlobals -> IncrementalOptimizationEnv /// Optimize one implementation file in the given environment val internal OptimizeImplFile: - OptimizationSettings * + OptimizationSettings * CcuThunk * TcGlobals * ConstraintSolver.TcValF * @@ -76,19 +75,20 @@ val internal OptimizeImplFile: isIncrementalFragment: bool * fsiMultiAssemblyEmit: bool * emitTailcalls: bool * - SignatureHidingInfo * - TypedImplFile - -> (IncrementalOptimizationEnv * TypedImplFile * ImplFileOptimizationInfo * SignatureHidingInfo) * (bool -> Expr -> Expr) + SignatureHidingInfo * + TypedImplFile -> + (IncrementalOptimizationEnv * TypedImplFile * ImplFileOptimizationInfo * SignatureHidingInfo) * + (bool -> Expr -> Expr) #if DEBUG /// Displaying optimization data val internal moduleInfoL: TcGlobals -> LazyModuleInfo -> Layout #endif -/// Saving and re-reading optimization information -val p_CcuOptimizationInfo: CcuOptimizationInfo -> WriterState -> unit +/// Saving and re-reading optimization information +val p_CcuOptimizationInfo: CcuOptimizationInfo -> WriterState -> unit -/// Rewrite the module info using the export remapping +/// Rewrite the module info using the export remapping val RemapOptimizationInfo: TcGlobals -> Remap -> (CcuOptimizationInfo -> CcuOptimizationInfo) /// Ensure that 'internal' items are not exported in the optimization info @@ -104,4 +104,3 @@ val internal u_CcuOptimizationInfo: ReaderState -> CcuOptimizationInfo /// Indicates the value is only mutable during its initialization and before any access or capture val IsKnownOnlyMutableBeforeUse: ValRef -> bool - diff --git a/src/fsharp/ParseAndCheckInputs.fsi b/src/fsharp/ParseAndCheckInputs.fsi index 2ba62e2b4f1..5082d28f57a 100644 --- a/src/fsharp/ParseAndCheckInputs.fsi +++ b/src/fsharp/ParseAndCheckInputs.fsi @@ -26,7 +26,7 @@ val ComputeQualifiedNameOfFileFromUniquePath: range * string list -> QualifiedNa val PrependPathToInput: Ident list -> ParsedInput -> ParsedInput /// State used to de-deduplicate module names along a list of file names -type ModuleNamesDict = Map> +type ModuleNamesDict = Map> /// Checks if a ParsedInput is using a module name that was already given and deduplicates the name if needed. val DeduplicateParsedInputModuleName: ModuleNamesDict -> ParsedInput -> ParsedInput * ModuleNamesDict @@ -39,16 +39,14 @@ val ParseInput: lexbuf: Lexbuf * defaultNamespace: string option * filename: string * - isLastCompiland:(bool * bool) - -> ParsedInput + isLastCompiland: (bool * bool) -> + ParsedInput /// A general routine to process hash directives -val ProcessMetaCommandsFromInput : - ('T -> range * string -> 'T) * - ('T -> range * string * Directive -> 'T) * - ('T -> range * string -> unit) - -> TcConfigBuilder * ParsedInput * string * 'T - -> 'T +val ProcessMetaCommandsFromInput: + ('T -> range * string -> 'T) * ('T -> range * string * Directive -> 'T) * ('T -> range * string -> unit) -> + TcConfigBuilder * ParsedInput * string * 'T -> + 'T /// Process all the #r, #I etc. in an input. For non-scripts report warnings about ignored directives. val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * DependencyProvider -> TcConfig @@ -56,9 +54,7 @@ val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * Depe /// Process the #nowarn in an input and integrate them into the TcConfig val ApplyNoWarnsToTcConfig: TcConfig * ParsedInput * string -> TcConfig -val GetScopedPragmasForInput: - input: ParsedInput - -> ScopedPragma list +val GetScopedPragmasForInput: input: ParsedInput -> ScopedPragma list /// Parse one input stream val ParseOneInputStream: @@ -68,8 +64,8 @@ val ParseOneInputStream: isLastCompiland: (bool * bool) * errorLogger: ErrorLogger * retryLocked: bool * - stream: Stream - -> ParsedInput + stream: Stream -> + ParsedInput /// Parse one input source text val ParseOneInputSourceText: @@ -78,8 +74,8 @@ val ParseOneInputSourceText: filename: string * isLastCompiland: (bool * bool) * errorLogger: ErrorLogger * - sourceText: ISourceText - -> ParsedInput + sourceText: ISourceText -> + ParsedInput /// Parse one input file val ParseOneInputFile: @@ -88,8 +84,8 @@ val ParseOneInputFile: filename: string * isLastCompiland: (bool * bool) * errorLogger: ErrorLogger * - retryLocked: bool - -> ParsedInput + retryLocked: bool -> + ParsedInput val ParseOneInputLexbuf: tcConfig: TcConfig * @@ -97,13 +93,10 @@ val ParseOneInputLexbuf: lexbuf: Lexbuf * filename: string * isLastCompiland: (bool * bool) * - errorLogger: ErrorLogger - -> ParsedInput + errorLogger: ErrorLogger -> + ParsedInput -val EmptyParsedInput: - filename: string * - isLastCompiland: (bool * bool) - -> ParsedInput +val EmptyParsedInput: filename: string * isLastCompiland: (bool * bool) -> ParsedInput /// Parse multiple input files from disk val ParseInputFiles: @@ -113,13 +106,13 @@ val ParseInputFiles: errorLogger: ErrorLogger * exiter: Exiter * createErrorLogger: (Exiter -> CapturingErrorLogger) * - retryLocked: bool - -> (ParsedInput * string) list + retryLocked: bool -> + (ParsedInput * string) list /// Get the initial type checking environment including the loading of mscorlib/System.Core, FSharp.Core /// applying the InternalsVisibleTo in referenced assemblies and opening 'Checked' if requested. val GetInitialTcEnv: assemblyName: string * range * TcConfig * TcImports * TcGlobals -> TcEnv * OpenDeclaration list - + /// Represents the incremental type checking state for a set of inputs [] type TcState = @@ -127,7 +120,7 @@ type TcState = /// The CcuThunk for the current assembly being checked member Ccu: CcuThunk - + /// Get the typing environment implied by the set of signature files and/or inferred signatures of implementation files checked so far member TcEnvFromSignatures: TcEnv @@ -143,16 +136,8 @@ type TcState = member CreatesGeneratedProvidedTypes: bool /// Get the initial type checking state for a set of inputs -val GetInitialTcState: - range * - string * - TcConfig * - TcGlobals * - TcImports * - NiceNameGenerator * - TcEnv * - OpenDeclaration list - -> TcState +val GetInitialTcState: + range * string * TcConfig * TcGlobals * TcImports * NiceNameGenerator * TcEnv * OpenDeclaration list -> TcState /// Check one input, returned as an Eventually computation val CheckOneInput: @@ -164,22 +149,17 @@ val CheckOneInput: NameResolution.TcResultsSink * TcState * ParsedInput * - skipImplIfSigExists: bool - -> Cancellable<(TcEnv * TopAttribs * TypedImplFile option * ModuleOrNamespaceType) * TcState> + skipImplIfSigExists: bool -> + Cancellable<(TcEnv * TopAttribs * TypedImplFile option * ModuleOrNamespaceType) * TcState> -/// Finish the checking of multiple inputs +/// Finish the checking of multiple inputs val CheckMultipleInputsFinish: - (TcEnv * TopAttribs * 'T option * 'U) list * - TcState - -> (TcEnv * TopAttribs * 'T list * 'U list) * TcState - -/// Finish the checking of a closed set of inputs -val CheckClosedInputSetFinish: - TypedImplFile list * - TcState - -> TcState * TypedImplFile list * ModuleOrNamespace - -/// Check a closed set of inputs + (TcEnv * TopAttribs * 'T option * 'U) list * TcState -> (TcEnv * TopAttribs * 'T list * 'U list) * TcState + +/// Finish the checking of a closed set of inputs +val CheckClosedInputSetFinish: TypedImplFile list * TcState -> TcState * TypedImplFile list * ModuleOrNamespace + +/// Check a closed set of inputs val CheckClosedInputSet: CompilationThreadToken * checkForErrors: (unit -> bool) * @@ -188,11 +168,11 @@ val CheckClosedInputSet: TcGlobals * LongIdent option * TcState * - ParsedInput list - -> TcState * TopAttribs * TypedImplFile list * TcEnv + ParsedInput list -> + TcState * TopAttribs * TypedImplFile list * TcEnv /// Check a single input and finish the checking -val CheckOneInputAndFinish : +val CheckOneInputAndFinish: checkForErrors: (unit -> bool) * TcConfig * TcImports * @@ -200,5 +180,5 @@ val CheckOneInputAndFinish : LongIdent option * NameResolution.TcResultsSink * TcState * - ParsedInput - -> Cancellable<(TcEnv * TopAttribs * TypedImplFile list * ModuleOrNamespaceType list) * TcState> + ParsedInput -> + Cancellable<(TcEnv * TopAttribs * TypedImplFile list * ModuleOrNamespaceType list) * TcState> diff --git a/src/fsharp/ParseHelpers.fsi b/src/fsharp/ParseHelpers.fsi index 9c70ab16371..c27d3b3ff76 100644 --- a/src/fsharp/ParseHelpers.fsi +++ b/src/fsharp/ParseHelpers.fsi @@ -19,22 +19,22 @@ exception SyntaxError of obj * range: range exception IndentationProblem of string * range -val warningStringOfCoords: line:int -> column:int -> string +val warningStringOfCoords: line: int -> column: int -> string -val warningStringOfPos: p:pos -> string +val warningStringOfPos: p: pos -> string -val posOfLexPosition: p:Position -> pos +val posOfLexPosition: p: Position -> pos -val mkSynRange: p1:Position -> p2:Position -> range +val mkSynRange: p1: Position -> p2: Position -> range type LexBuffer<'Char> with member LexemeRange: range -val lhs: parseState:IParseState -> range +val lhs: parseState: IParseState -> range -val rhs2: parseState:IParseState -> i:int -> j:int -> range +val rhs2: parseState: IParseState -> i: int -> j: int -> range -val rhs: parseState:IParseState -> i:int -> range +val rhs: parseState: IParseState -> i: int -> range type IParseState with member SynArgNameGenerator: SyntaxTreeOps.SynArgNameGenerator @@ -42,17 +42,17 @@ type IParseState with module LexbufLocalXmlDocStore = - val ClearXmlDoc: lexbuf:UnicodeLexing.Lexbuf -> unit + val ClearXmlDoc: lexbuf: UnicodeLexing.Lexbuf -> unit - val SaveXmlDocLine: lexbuf:UnicodeLexing.Lexbuf * lineText:string * range:range -> unit + val SaveXmlDocLine: lexbuf: UnicodeLexing.Lexbuf * lineText: string * range: range -> unit - val GrabXmlDocBeforeMarker: lexbuf:UnicodeLexing.Lexbuf * markerRange:range -> PreXmlDoc + val GrabXmlDocBeforeMarker: lexbuf: UnicodeLexing.Lexbuf * markerRange: range -> PreXmlDoc - val AddGrabPoint: lexbuf:UnicodeLexing.Lexbuf -> unit + val AddGrabPoint: lexbuf: UnicodeLexing.Lexbuf -> unit - val AddGrabPointDelayed: lexbuf:UnicodeLexing.Lexbuf -> unit + val AddGrabPointDelayed: lexbuf: UnicodeLexing.Lexbuf -> unit - val ReportInvalidXmlDocPositions: lexbuf:UnicodeLexing.Lexbuf -> range list + val ReportInvalidXmlDocPositions: lexbuf: UnicodeLexing.Lexbuf -> range list type LexerIfdefStackEntry = | IfDefIf @@ -72,27 +72,27 @@ type LexerIfdefExpression = | IfdefNot of LexerIfdefExpression | IfdefId of string -val LexerIfdefEval: lookup:(string -> bool) -> _arg1:LexerIfdefExpression -> bool +val LexerIfdefEval: lookup: (string -> bool) -> _arg1: LexerIfdefExpression -> bool module LexbufIfdefStore = - val SaveIfHash: lexbuf:UnicodeLexing.Lexbuf * lexed:string * expr: LexerIfdefExpression * range: range -> unit + val SaveIfHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * expr: LexerIfdefExpression * range: range -> unit - val SaveElseHash: lexbuf:UnicodeLexing.Lexbuf * lexed:string * range: range -> unit + val SaveElseHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * range: range -> unit - val SaveEndIfHash: lexbuf:UnicodeLexing.Lexbuf * lexed:string * range: range -> unit + val SaveEndIfHash: lexbuf: UnicodeLexing.Lexbuf * lexed: string * range: range -> unit - val GetTrivia: lexbuf:UnicodeLexing.Lexbuf -> SyntaxTrivia.ConditionalDirectiveTrivia list + val GetTrivia: lexbuf: UnicodeLexing.Lexbuf -> SyntaxTrivia.ConditionalDirectiveTrivia list module LexbufCommentStore = - val SaveSingleLineComment: lexbuf:UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit - - val SaveBlockComment: lexbuf:UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit + val SaveSingleLineComment: lexbuf: UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit - val GetComments: lexbuf:UnicodeLexing.Lexbuf -> SyntaxTrivia.CommentTrivia list - - val ClearComments: lexbuf:UnicodeLexing.Lexbuf -> unit + val SaveBlockComment: lexbuf: UnicodeLexing.Lexbuf * startRange: range * endRange: range -> unit + + val GetComments: lexbuf: UnicodeLexing.Lexbuf -> SyntaxTrivia.CommentTrivia list + + val ClearComments: lexbuf: UnicodeLexing.Lexbuf -> unit [] type LexerStringStyle = @@ -113,18 +113,27 @@ type LexerStringKind = static member InterpolatedStringPart: LexerStringKind static member String: LexerStringKind - -type LexerInterpolatedStringNesting = - (int * LexerStringStyle * range) list -[] +type LexerInterpolatedStringNesting = (int * LexerStringStyle * range) list + +[] type LexerContinuation = | Token of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting | IfDefSkip of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range - | String of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * style: LexerStringStyle * kind: LexerStringKind * range: range + | String of + ifdef: LexerIfdefStackEntries * + nesting: LexerInterpolatedStringNesting * + style: LexerStringStyle * + kind: LexerStringKind * + range: range | Comment of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range | SingleLineComment of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * int * range: range - | StringInComment of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * style: LexerStringStyle * int * range: range + | StringInComment of + ifdef: LexerIfdefStackEntries * + nesting: LexerInterpolatedStringNesting * + style: LexerStringStyle * + int * + range: range | MLOnly of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * range: range | EndLine of ifdef: LexerIfdefStackEntries * nesting: LexerInterpolatedStringNesting * LexerEndlineContinuation @@ -133,13 +142,15 @@ type LexerContinuation = member LexerInterpStringNesting: LexerInterpolatedStringNesting static member Default: LexerContinuation - + and LexCont = LexerContinuation -val ParseAssemblyCodeInstructions: s:string -> reportLibraryOnlyFeatures: bool -> langVersion: LanguageVersion -> m:range -> ILInstr[] +val ParseAssemblyCodeInstructions: + s: string -> reportLibraryOnlyFeatures: bool -> langVersion: LanguageVersion -> m: range -> ILInstr [] val grabXmlDocAtRangeStart: parseState: IParseState * optAttributes: SynAttributeList list * range: range -> PreXmlDoc val grabXmlDoc: parseState: IParseState * optAttributes: SynAttributeList list * elemIdx: int -> PreXmlDoc -val ParseAssemblyCodeType: s:string -> reportLibraryOnlyFeatures: bool -> langVersion: LanguageVersion -> m:range -> ILType +val ParseAssemblyCodeType: + s: string -> reportLibraryOnlyFeatures: bool -> langVersion: LanguageVersion -> m: range -> ILType diff --git a/src/fsharp/PatternMatchCompilation.fsi b/src/fsharp/PatternMatchCompilation.fsi index 98e195637c1..d7b613ed1c1 100644 --- a/src/fsharp/PatternMatchCompilation.fsi +++ b/src/fsharp/PatternMatchCompilation.fsi @@ -3,7 +3,7 @@ module internal FSharp.Compiler.PatternMatchCompilation open FSharp.Compiler -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.InfoReader open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.TcGlobals @@ -11,12 +11,12 @@ open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps -/// What should the decision tree contain for any incomplete match? -type ActionOnFailure = - | ThrowIncompleteMatchException - | IgnoreWithWarning - | Throw - | Rethrow +/// What should the decision tree contain for any incomplete match? +type ActionOnFailure = + | ThrowIncompleteMatchException + | IgnoreWithWarning + | Throw + | Rethrow | FailFilter /// Represents the typechecked, elaborated form of a pattern, prior to pattern-match compilation. @@ -40,43 +40,37 @@ type Pattern = member Range: range -and PatternValBinding = - | PBind of Val * TypeScheme +and PatternValBinding = PBind of Val * TypeScheme -and TypedMatchClause = - | TClause of Pattern * Expr option * DecisionTreeTarget * range +and TypedMatchClause = TClause of Pattern * Expr option * DecisionTreeTarget * range val ilFieldToTastConst: ILFieldInit -> Const /// Compile a pattern into a decision tree and a set of targets. -val internal CompilePattern: +val internal CompilePattern: TcGlobals -> DisplayEnv -> Import.ImportMap -> - // tcVal (ValRef -> ValUseFlag -> TTypes -> range -> Expr * TType) -> InfoReader -> - // range of the expression we are matching on - range -> + // range of the expression we are matching on + range -> // range to report "incomplete match" on - range -> - // warn on unused? - bool -> - ActionOnFailure -> - // the value being matched against, perhaps polymorphic. Optionally includes the - // input expression, only for the case of immediate matching on a byref pointer - Val * Typars * Expr option -> - // input type-checked syntax of pattern matching - TypedMatchClause list -> - // input type - TType -> - // result type - TType -> - // produce TAST nodes - DecisionTree * DecisionTreeTarget list + range -> + // warn on unused? + bool -> + ActionOnFailure -> + Val * Typars * Expr option -> + // input type-checked syntax of pattern matching + TypedMatchClause list -> + // input type + TType -> + // result type + TType -> + DecisionTree * DecisionTreeTarget list exception internal MatchIncomplete of bool * (string * bool) option * range exception internal RuleNeverMatched of range -exception internal EnumMatchIncomplete of bool * (string * bool) option * range \ No newline at end of file +exception internal EnumMatchIncomplete of bool * (string * bool) option * range diff --git a/src/fsharp/PostInferenceChecks.fsi b/src/fsharp/PostInferenceChecks.fsi index 95647603e56..3d801310618 100644 --- a/src/fsharp/PostInferenceChecks.fsi +++ b/src/fsharp/PostInferenceChecks.fsi @@ -14,13 +14,14 @@ open FSharp.Compiler.TcGlobals val CheckTopImpl: g: TcGlobals * amap: ImportMap * - reportErrors: bool * + reportErrors: bool * infoReader: InfoReader * internalsVisibleToPaths: CompilationPath list * viewCcu: CcuThunk * tcValF: ConstraintSolver.TcValF * denv: DisplayEnv * mexpr: ModuleOrNamespaceExprWithSig * - extraAttribs: Attribs * (bool * bool) * - isInternalTestSpanStackReferring: bool - -> bool * StampMap + extraAttribs: Attribs * + (bool * bool) * + isInternalTestSpanStackReferring: bool -> + bool * StampMap diff --git a/src/fsharp/PrettyNaming.fsi b/src/fsharp/PrettyNaming.fsi index 74f4dddaaaa..fc7cbffcaa1 100644 --- a/src/fsharp/PrettyNaming.fsi +++ b/src/fsharp/PrettyNaming.fsi @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. /// Some general F# utilities for mangling / unmangling / manipulating names. -/// Anything to do with special names of identifiers and other lexical rules +/// Anything to do with special names of identifiers and other lexical rules module public FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.Text @@ -22,11 +22,11 @@ val internal qmarkSet: string = "?<-" [] val internal opNamePrefix: string = "op_" -/// Returns `true` if given string is an operator display name, e.g. +/// Returns `true` if given string is an operator display name, e.g. /// ( |>> ) /// |>> /// .. -val IsOperatorDisplayName: name:string -> bool +val IsOperatorDisplayName: name: string -> bool /// Is the name a valid F# identifier /// A --> true @@ -36,18 +36,18 @@ val IsOperatorDisplayName: name:string -> bool /// |A|B| --> false /// op_Addition --> true /// + --> false -val IsIdentifierName: name:string -> bool +val IsIdentifierName: name: string -> bool /// Determines if the specified name is a valid name for an active pattern. -/// |A|_| --> true -/// |A|B| --> true -/// |A| --> true +/// |A|_| --> true +/// |A|B| --> true +/// |A| --> true /// | --> false /// || --> false /// op_Addition --> false -val IsActivePatternName: name:string -> bool +val IsActivePatternName: name: string -> bool -/// Returns `true` if given string requires double backticks to be a valid identifier, e.g. +/// Returns `true` if given string requires double backticks to be a valid identifier, e.g. /// + true, e.g. ``+`` (this is not op_Addition) /// |>> true, e.g. ``|>>`` (this is not op_Addition) /// A-B true, e.g. ``A-B`` @@ -72,7 +72,7 @@ val NormalizeIdentifierBackticks: name: string -> string /// Is the name a mangled operator name (approximate) /// op_Addition - yes /// op_Quack - yes -val IsMangledOpName: name:string -> bool +val IsMangledOpName: name: string -> bool /// Compiles an operator into a mangled operator name. For example, /// + --> op_Addition @@ -91,7 +91,7 @@ val CompileOpName: string -> string val DecompileOpName: string -> string /// Take a core display name (e.g. "List" or "Strange module name") and convert it to display text -/// by adding backticks if necessary. +/// by adding backticks if necessary. /// Foo --> Foo /// + --> ``+`` /// A-B --> ``A-B`` @@ -129,59 +129,59 @@ val internal opNameNullableEquals: string val internal opNameNullableEqualsNullable: string /// The characters that are allowed to be the first character of an identifier. -val IsIdentifierFirstCharacter: c:char -> bool +val IsIdentifierFirstCharacter: c: char -> bool /// The characters that are allowed to be in an identifier. -val IsIdentifierPartCharacter: c:char -> bool +val IsIdentifierPartCharacter: c: char -> bool /// Is this character a part of a long identifier? -val IsLongIdentifierPartCharacter: c:char -> bool +val IsLongIdentifierPartCharacter: c: char -> bool -val internal isTildeOnlyString: s:string -> bool +val internal isTildeOnlyString: s: string -> bool -val internal IsValidPrefixOperatorUse: s:string -> bool +val internal IsValidPrefixOperatorUse: s: string -> bool -val internal IsValidPrefixOperatorDefinitionName: s:string -> bool +val internal IsValidPrefixOperatorDefinitionName: s: string -> bool -val IsPrefixOperator: s:string -> bool +val IsPrefixOperator: s: string -> bool -val IsPunctuation: s:string -> bool +val IsPunctuation: s: string -> bool -val IsTernaryOperator: s:string -> bool +val IsTernaryOperator: s: string -> bool val IsMangledInfixOperator: string -> bool -val internal ( |Control|Equality|Relational|Indexer|FixedTypes|Other| ): - opName:string -> Choice +val internal (|Control|Equality|Relational|Indexer|FixedTypes|Other|): + opName: string -> Choice -val IsCompilerGeneratedName: nm:string -> bool +val IsCompilerGeneratedName: nm: string -> bool -val internal CompilerGeneratedName: nm:string -> string +val internal CompilerGeneratedName: nm: string -> string -val internal GetBasicNameOfPossibleCompilerGeneratedName: name:string -> string +val internal GetBasicNameOfPossibleCompilerGeneratedName: name: string -> string -val internal CompilerGeneratedNameSuffix: basicName:string -> suffix:string -> string +val internal CompilerGeneratedNameSuffix: basicName: string -> suffix: string -> string -val internal TryDemangleGenericNameAndPos: n:string -> int voption +val internal TryDemangleGenericNameAndPos: n: string -> int voption -type internal NameArityPair = | NameArityPair of string * int +type internal NameArityPair = NameArityPair of string * int -val internal DemangleGenericTypeNameWithPos: pos:int -> mangledName:string -> string +val internal DemangleGenericTypeNameWithPos: pos: int -> mangledName: string -> string -val internal DecodeGenericTypeNameWithPos: pos:int -> mangledName:string -> NameArityPair +val internal DecodeGenericTypeNameWithPos: pos: int -> mangledName: string -> NameArityPair -val internal DemangleGenericTypeName: mangledName:string -> string +val internal DemangleGenericTypeName: mangledName: string -> string -val internal DecodeGenericTypeName: mangledName:string -> NameArityPair +val internal DecodeGenericTypeName: mangledName: string -> NameArityPair /// Try to chop "get_" or "set_" from a string -val TryChopPropertyName: s:string -> string option +val TryChopPropertyName: s: string -> string option /// Try to chop "get_" or "set_" from a string. /// If the string does not start with "get_" or "set_", this function raises an exception. -val internal ChopPropertyName: s:string -> string +val internal ChopPropertyName: s: string -> string -val internal SplitNamesForILPath: s:string -> string list +val internal SplitNamesForILPath: s: string -> string list [] val internal FSharpModuleSuffix: string = "Module" @@ -197,22 +197,23 @@ type internal ActivePatternInfo = member ActiveTagsWithRanges: (string * range) list member IsTotal: bool member Range: range - -val internal ActivePatternInfoOfValName: nm:string -> m:range -> ActivePatternInfo option + +val internal ActivePatternInfoOfValName: nm: string -> m: range -> ActivePatternInfo option exception internal InvalidMangledStaticArg of string -val internal demangleProvidedTypeName: typeLogicalName:string -> string * (string * string) [] +val internal demangleProvidedTypeName: typeLogicalName: string -> string * (string * string) [] /// Mangle the static parameters for a provided type or method -val internal mangleProvidedTypeName: typeLogicalName:string * nonDefaultArgs:(string * string) [] -> string +val internal mangleProvidedTypeName: typeLogicalName: string * nonDefaultArgs: (string * string) [] -> string /// Mangle the static parameters for a provided type or method -val internal computeMangledNameWithoutDefaultArgValues: nm:string * staticArgs:'a [] * defaultArgValues:(string * string option) [] -> string +val internal computeMangledNameWithoutDefaultArgValues: + nm: string * staticArgs: 'a [] * defaultArgValues: (string * string option) [] -> string val internal outArgCompilerGeneratedName: string -val internal ExtraWitnessMethodName: nm:string -> string +val internal ExtraWitnessMethodName: nm: string -> string /// Reuses generated union case field name objects for common field numbers val internal mkUnionCaseFieldName: (int -> int -> string) @@ -249,17 +250,16 @@ val FormatAndOtherOverloadsString: int -> string val FSharpSignatureDataResourceName2: string -/// Mark some variables (the ones we introduce via abstractBigTargets) as don't-eliminate -[] -val internal suffixForVariablesThatMayNotBeEliminated : string = "$cont" +/// Mark some variables (the ones we introduce via abstractBigTargets) as don't-eliminate +[] +val internal suffixForVariablesThatMayNotBeEliminated: string = "$cont" /// Indicates a ValRef generated to facilitate tuple eliminations -[] -val internal suffixForTupleElementAssignmentTarget : string = "$tupleElem" +[] +val internal suffixForTupleElementAssignmentTarget: string = "$tupleElem" -[] -val internal stackVarPrefix : string = "__stack_" +[] +val internal stackVarPrefix: string = "__stack_" /// Keywords paired with their descriptions. Used in completion and quick info. val internal keywordsWithDescription: (string * string) list - diff --git a/src/fsharp/QueueList.fsi b/src/fsharp/QueueList.fsi index 12c531ff17c..bf411994758 100644 --- a/src/fsharp/QueueList.fsi +++ b/src/fsharp/QueueList.fsi @@ -1,7 +1,7 @@ namespace Internal.Utilities.Collections /// Iterable functional collection with O(1) append-1 time. Useful for data structures where elements get added at the -/// end but the collection must occasionally be iterated. Iteration is slower and may allocate because +/// end but the collection must occasionally be iterated. Iteration is slower and may allocate because /// a suffix of elements is stored in reverse order. /// /// The type doesn't support structural hashing or comparison. @@ -11,13 +11,13 @@ type internal QueueList<'T> = interface System.Collections.Generic.IEnumerable<'T> - new: xs:'T list -> QueueList<'T> + new: xs: 'T list -> QueueList<'T> - new: firstElementsIn:'T list * lastElementsRevIn:'T list * numLastElementsIn:int -> QueueList<'T> + new: firstElementsIn: 'T list * lastElementsRevIn: 'T list * numLastElementsIn: int -> QueueList<'T> - member Append: ys:seq<'T> -> QueueList<'T> + member Append: ys: seq<'T> -> QueueList<'T> - member AppendOne: y:'T -> QueueList<'T> + member AppendOne: y: 'T -> QueueList<'T> member ToList: unit -> 'T list @@ -29,30 +29,30 @@ type internal QueueList<'T> = module internal QueueList = - val empty<'T> : QueueList<'T> + val empty<'T> : QueueList<'T> - val ofSeq: x:seq<'a> -> QueueList<'a> + val ofSeq: x: seq<'a> -> QueueList<'a> - val iter: f:('a -> unit) -> x:QueueList<'a> -> unit + val iter: f: ('a -> unit) -> x: QueueList<'a> -> unit - val map: f:('a -> 'b) -> x:QueueList<'a> -> QueueList<'b> + val map: f: ('a -> 'b) -> x: QueueList<'a> -> QueueList<'b> - val exists: f:('a -> bool) -> x:QueueList<'a> -> bool + val exists: f: ('a -> bool) -> x: QueueList<'a> -> bool - val filter: f:('a -> bool) -> x:QueueList<'a> -> QueueList<'a> + val filter: f: ('a -> bool) -> x: QueueList<'a> -> QueueList<'a> - val foldBack: f:('a -> 'b -> 'b) -> x:QueueList<'a> -> acc:'b -> 'b + val foldBack: f: ('a -> 'b -> 'b) -> x: QueueList<'a> -> acc: 'b -> 'b - val forall: f:('a -> bool) -> x:QueueList<'a> -> bool + val forall: f: ('a -> bool) -> x: QueueList<'a> -> bool - val ofList: x:'a list -> QueueList<'a> + val ofList: x: 'a list -> QueueList<'a> - val toList: x:QueueList<'a> -> 'a list + val toList: x: QueueList<'a> -> 'a list - val tryFind: f:('a -> bool) -> x:QueueList<'a> -> 'a option + val tryFind: f: ('a -> bool) -> x: QueueList<'a> -> 'a option - val one: x:'a -> QueueList<'a> + val one: x: 'a -> QueueList<'a> - val appendOne: x:QueueList<'a> -> y:'a -> QueueList<'a> + val appendOne: x: QueueList<'a> -> y: 'a -> QueueList<'a> - val append: x:QueueList<'a> -> ys:QueueList<'a> -> QueueList<'a> + val append: x: QueueList<'a> -> ys: QueueList<'a> -> QueueList<'a> diff --git a/src/fsharp/QuotationPickler.fsi b/src/fsharp/QuotationPickler.fsi index 9b7f355a00d..fd45cde9887 100644 --- a/src/fsharp/QuotationPickler.fsi +++ b/src/fsharp/QuotationPickler.fsi @@ -2,114 +2,113 @@ /// Code to pickle out quotations in the quotation binary format. module internal FSharp.Compiler.QuotationPickler -#nowarn "1178" // The struct, record or union type 'internal_instr_extension' is not structurally comparable because the type +#nowarn "1178" -type TypeData +type TypeData type TypeVarData = { tvName: string } -type NamedTypeData = - /// Indicates an F# 4.0+ reference into the supplied table of type definition references, ultimately resolved by TypeRef/TypeDef data +type NamedTypeData = + /// Indicates an F# 4.0+ reference into the supplied table of type definition references, ultimately resolved by TypeRef/TypeDef data | Idx of int /// Indicates an F# 3.0+ reference to a named type in an assembly loaded by name - | Named of tcName: string * tcAssembly: string + | Named of tcName: string * tcAssembly: string -val mkVarTy : int -> TypeData +val mkVarTy: int -> TypeData -val mkFunTy : TypeData * TypeData -> TypeData +val mkFunTy: TypeData * TypeData -> TypeData -val mkArrayTy : int * TypeData -> TypeData +val mkArrayTy: int * TypeData -> TypeData -val mkILNamedTy : NamedTypeData * TypeData list -> TypeData +val mkILNamedTy: NamedTypeData * TypeData list -> TypeData type ExprData -type VarData +type VarData -type CtorData = - { ctorParent: NamedTypeData +type CtorData = + { ctorParent: NamedTypeData ctorArgTypes: TypeData list } -type MethodData = +type MethodData = { methParent: NamedTypeData methName: string methArgTypes: TypeData list - methRetType: TypeData + methRetType: TypeData numGenericArgs: int } -type ModuleDefnData = +type ModuleDefnData = { Module: NamedTypeData Name: string IsProperty: bool } -type MethodBaseData = +type MethodBaseData = | ModuleDefn of ModuleDefnData * (string * int) option - | Method of MethodData - | Ctor of CtorData - -type PropInfoData = NamedTypeData * string * TypeData * TypeData list - -val mkVar : int -> ExprData -val mkThisVar : TypeData -> ExprData -val mkHole : TypeData * int -> ExprData -val mkApp : ExprData * ExprData -> ExprData -val mkLambda : VarData * ExprData -> ExprData -val mkQuote : ExprData -> ExprData -val mkQuoteRaw40 : ExprData -> ExprData // only available for FSharp.Core 4.4.0.0+ -val mkCond : ExprData * ExprData * ExprData -> ExprData -val mkModuleValueApp : NamedTypeData * string * bool * TypeData list * ExprData list -> ExprData -val mkModuleValueWApp : NamedTypeData * string * bool * string * int * TypeData list * ExprData list -> ExprData -val mkLetRec : (VarData * ExprData) list * ExprData -> ExprData -val mkLet : (VarData * ExprData) * ExprData -> ExprData -val mkRecdMk : NamedTypeData * TypeData list * ExprData list -> ExprData -val mkRecdGet : NamedTypeData * string * TypeData list * ExprData list -> ExprData -val mkRecdSet : NamedTypeData * string * TypeData list * ExprData list -> ExprData -val mkUnion : NamedTypeData * string * TypeData list * ExprData list -> ExprData -val mkUnionFieldGet : NamedTypeData * string * int * TypeData list * ExprData -> ExprData -val mkUnionCaseTagTest : NamedTypeData * string * TypeData list * ExprData -> ExprData -val mkTuple : TypeData * ExprData list -> ExprData -val mkTupleGet : TypeData * int * ExprData -> ExprData -val mkCoerce : TypeData * ExprData -> ExprData -val mkNewArray : TypeData * ExprData list -> ExprData -val mkTypeTest : TypeData * ExprData -> ExprData -val mkAddressSet : ExprData * ExprData -> ExprData -val mkVarSet : ExprData * ExprData -> ExprData -val mkUnit : unit -> ExprData -val mkNull : TypeData -> ExprData -val mkDefaultValue : TypeData -> ExprData -val mkBool : bool * TypeData -> ExprData -val mkString : string * TypeData -> ExprData -val mkSingle : float32 * TypeData -> ExprData -val mkDouble : float * TypeData -> ExprData -val mkChar : char * TypeData -> ExprData -val mkSByte : sbyte * TypeData -> ExprData -val mkByte : byte * TypeData -> ExprData -val mkInt16 : int16 * TypeData -> ExprData -val mkUInt16 : uint16 * TypeData -> ExprData -val mkInt32 : int32 * TypeData -> ExprData -val mkUInt32 : uint32 * TypeData -> ExprData -val mkInt64 : int64 * TypeData -> ExprData -val mkUInt64 : uint64 * TypeData -> ExprData -val mkAddressOf : ExprData -> ExprData -val mkSequential : ExprData * ExprData -> ExprData -val mkIntegerForLoop : ExprData * ExprData * ExprData -> ExprData -val mkWhileLoop : ExprData * ExprData -> ExprData -val mkTryFinally : ExprData * ExprData -> ExprData -val mkTryWith : ExprData * VarData * ExprData * VarData * ExprData -> ExprData -val mkDelegate : TypeData * ExprData -> ExprData -val mkPropGet : PropInfoData * TypeData list * ExprData list -> ExprData -val mkPropSet : PropInfoData * TypeData list * ExprData list -> ExprData -val mkFieldGet : NamedTypeData * string * TypeData list * ExprData list -> ExprData -val mkFieldSet : NamedTypeData * string * TypeData list * ExprData list -> ExprData -val mkCtorCall : CtorData * TypeData list * ExprData list -> ExprData -val mkMethodCall : MethodData * TypeData list * ExprData list -> ExprData -val mkMethodCallW : MethodData * MethodData * int * TypeData list * ExprData list -> ExprData - -val mkAttributedExpression : ExprData * ExprData -> ExprData -val pickle : (ExprData -> byte[]) -val isAttributedExpression : ExprData -> bool - -val PickleDefns : ((MethodBaseData * ExprData) list -> byte[]) -val SerializedReflectedDefinitionsResourceNameBase : string -val freshVar : string * TypeData * bool -> VarData - + | Method of MethodData + | Ctor of CtorData + +type PropInfoData = NamedTypeData * string * TypeData * TypeData list + +val mkVar: int -> ExprData +val mkThisVar: TypeData -> ExprData +val mkHole: TypeData * int -> ExprData +val mkApp: ExprData * ExprData -> ExprData +val mkLambda: VarData * ExprData -> ExprData +val mkQuote: ExprData -> ExprData +val mkQuoteRaw40: ExprData -> ExprData // only available for FSharp.Core 4.4.0.0+ +val mkCond: ExprData * ExprData * ExprData -> ExprData +val mkModuleValueApp: NamedTypeData * string * bool * TypeData list * ExprData list -> ExprData +val mkModuleValueWApp: NamedTypeData * string * bool * string * int * TypeData list * ExprData list -> ExprData +val mkLetRec: (VarData * ExprData) list * ExprData -> ExprData +val mkLet: (VarData * ExprData) * ExprData -> ExprData +val mkRecdMk: NamedTypeData * TypeData list * ExprData list -> ExprData +val mkRecdGet: NamedTypeData * string * TypeData list * ExprData list -> ExprData +val mkRecdSet: NamedTypeData * string * TypeData list * ExprData list -> ExprData +val mkUnion: NamedTypeData * string * TypeData list * ExprData list -> ExprData +val mkUnionFieldGet: NamedTypeData * string * int * TypeData list * ExprData -> ExprData +val mkUnionCaseTagTest: NamedTypeData * string * TypeData list * ExprData -> ExprData +val mkTuple: TypeData * ExprData list -> ExprData +val mkTupleGet: TypeData * int * ExprData -> ExprData +val mkCoerce: TypeData * ExprData -> ExprData +val mkNewArray: TypeData * ExprData list -> ExprData +val mkTypeTest: TypeData * ExprData -> ExprData +val mkAddressSet: ExprData * ExprData -> ExprData +val mkVarSet: ExprData * ExprData -> ExprData +val mkUnit: unit -> ExprData +val mkNull: TypeData -> ExprData +val mkDefaultValue: TypeData -> ExprData +val mkBool: bool * TypeData -> ExprData +val mkString: string * TypeData -> ExprData +val mkSingle: float32 * TypeData -> ExprData +val mkDouble: float * TypeData -> ExprData +val mkChar: char * TypeData -> ExprData +val mkSByte: sbyte * TypeData -> ExprData +val mkByte: byte * TypeData -> ExprData +val mkInt16: int16 * TypeData -> ExprData +val mkUInt16: uint16 * TypeData -> ExprData +val mkInt32: int32 * TypeData -> ExprData +val mkUInt32: uint32 * TypeData -> ExprData +val mkInt64: int64 * TypeData -> ExprData +val mkUInt64: uint64 * TypeData -> ExprData +val mkAddressOf: ExprData -> ExprData +val mkSequential: ExprData * ExprData -> ExprData +val mkIntegerForLoop: ExprData * ExprData * ExprData -> ExprData +val mkWhileLoop: ExprData * ExprData -> ExprData +val mkTryFinally: ExprData * ExprData -> ExprData +val mkTryWith: ExprData * VarData * ExprData * VarData * ExprData -> ExprData +val mkDelegate: TypeData * ExprData -> ExprData +val mkPropGet: PropInfoData * TypeData list * ExprData list -> ExprData +val mkPropSet: PropInfoData * TypeData list * ExprData list -> ExprData +val mkFieldGet: NamedTypeData * string * TypeData list * ExprData list -> ExprData +val mkFieldSet: NamedTypeData * string * TypeData list * ExprData list -> ExprData +val mkCtorCall: CtorData * TypeData list * ExprData list -> ExprData +val mkMethodCall: MethodData * TypeData list * ExprData list -> ExprData +val mkMethodCallW: MethodData * MethodData * int * TypeData list * ExprData list -> ExprData + +val mkAttributedExpression: ExprData * ExprData -> ExprData +val pickle: (ExprData -> byte []) +val isAttributedExpression: ExprData -> bool + +val PickleDefns: ((MethodBaseData * ExprData) list -> byte []) +val SerializedReflectedDefinitionsResourceNameBase: string +val freshVar: string * TypeData * bool -> VarData diff --git a/src/fsharp/QuotationTranslator.fsi b/src/fsharp/QuotationTranslator.fsi index c6f3bcd48e5..9c80c86b74a 100755 --- a/src/fsharp/QuotationTranslator.fsi +++ b/src/fsharp/QuotationTranslator.fsi @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -/// Convert quoted TAST data structures to structures ready for pickling +/// Convert quoted TAST data structures to structures ready for pickling module internal FSharp.Compiler.QuotationTranslator -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Import open FSharp.Compiler.Text @@ -20,26 +20,28 @@ type IsReflectedDefinition = [] type QuotationSerializationFormat = - { - /// Indicates that witness parameters are recorded - SupportsWitnesses: bool - + { /// Indicates that witness parameters are recorded + SupportsWitnesses: bool + /// Indicates that type references are emitted as integer indexes into a supplied table - SupportsDeserializeEx: bool - } + SupportsDeserializeEx: bool } [] -type QuotationGenerationScope = - static member Create: TcGlobals * ImportMap * CcuThunk * ConstraintSolver.TcValF * IsReflectedDefinition -> QuotationGenerationScope +type QuotationGenerationScope = + static member Create: + TcGlobals * ImportMap * CcuThunk * ConstraintSolver.TcValF * IsReflectedDefinition -> QuotationGenerationScope member Close: unit -> ILTypeRef list * (TType * range) list * (Expr * range) list - static member ComputeQuotationFormat : TcGlobals -> QuotationSerializationFormat + static member ComputeQuotationFormat: TcGlobals -> QuotationSerializationFormat + +val ConvExprPublic: QuotationGenerationScope -> suppressWitnesses: bool -> Expr -> QuotationPickler.ExprData -val ConvExprPublic : QuotationGenerationScope -> suppressWitnesses: bool -> Expr -> QuotationPickler.ExprData -val ConvReflectedDefinition: QuotationGenerationScope -> string -> Val -> Expr -> QuotationPickler.MethodBaseData * QuotationPickler.ExprData +val ConvReflectedDefinition: + QuotationGenerationScope -> string -> Val -> Expr -> QuotationPickler.MethodBaseData * QuotationPickler.ExprData -val (|ModuleValueOrMemberUse|_|) : TcGlobals -> Expr -> (ValRef * ValUseFlag * Expr * TType * TypeInst * Expr list) option -val (|SimpleArrayLoopUpperBound|_|) : Expr -> unit option -val (|SimpleArrayLoopBody|_|) : TcGlobals -> Expr -> (Expr * TType * Expr) option -val (|ObjectInitializationCheck|_|) : TcGlobals -> Expr -> unit option -val isSplice : TcGlobals -> ValRef -> bool +val (|ModuleValueOrMemberUse|_|): + TcGlobals -> Expr -> (ValRef * ValUseFlag * Expr * TType * TypeInst * Expr list) option +val (|SimpleArrayLoopUpperBound|_|): Expr -> unit option +val (|SimpleArrayLoopBody|_|): TcGlobals -> Expr -> (Expr * TType * Expr) option +val (|ObjectInitializationCheck|_|): TcGlobals -> Expr -> unit option +val isSplice: TcGlobals -> ValRef -> bool diff --git a/src/fsharp/ReferenceResolver.fsi b/src/fsharp/ReferenceResolver.fsi index 8ef591de7f6..69d572818fb 100644 --- a/src/fsharp/ReferenceResolver.fsi +++ b/src/fsharp/ReferenceResolver.fsi @@ -12,20 +12,18 @@ type internal LegacyResolutionEnvironment = | EditingOrCompilation of isEditing: bool /// Indicates a script or source being dynamically compiled and executed. Uses implementation assemblies. - | CompilationAndEvaluation + | CompilationAndEvaluation type internal LegacyResolvedFile = - { - /// Item specification. - itemSpec:string + { /// Item specification. + itemSpec: string - /// Prepare textual information about where the assembly was resolved from, used for tooltip output - prepareToolTip: string * string -> string + /// Prepare textual information about where the assembly was resolved from, used for tooltip output + prepareToolTip: string * string -> string + + /// Round-tripped baggage + baggage: string } - /// Round-tripped baggage - baggage:string - } - [] type internal ILegacyReferenceResolver = /// Get the "v4.5.1"-style moniker for the highest installed .NET Framework version. @@ -37,28 +35,27 @@ type internal ILegacyReferenceResolver = abstract HighestInstalledNetFrameworkVersion: unit -> string /// Perform assembly resolution on the given references under the given conditions - abstract Resolve: - resolutionEnvironment: LegacyResolutionEnvironment * - references:(string * string) [] * - targetFrameworkVersion:string * - targetFrameworkDirectories:string list * - targetProcessorArchitecture:string * - fsharpCoreDir:string * - explicitIncludeDirs:string list * - implicitIncludeDir:string * - logMessage:(string -> unit) * - logDiagnostic:(bool -> string -> string -> unit) -> - LegacyResolvedFile [] + abstract Resolve: + resolutionEnvironment: LegacyResolutionEnvironment * + references: (string * string) [] * + targetFrameworkVersion: string * + targetFrameworkDirectories: string list * + targetProcessorArchitecture: string * + fsharpCoreDir: string * + explicitIncludeDirs: string list * + implicitIncludeDir: string * + logMessage: (string -> unit) * + logDiagnostic: (bool -> string -> string -> unit) -> + LegacyResolvedFile [] /// Get the Reference Assemblies directory for the .NET Framework (on Windows) - /// This is added to the default resolution path for + /// This is added to the default resolution path for /// design-time compilations. abstract DotNetFrameworkReferenceAssembliesRootDirectory: string - + // Note, two implementations of this are provided, and no further implementations can be added from // outside FSharp.Compiler.Service [] type LegacyReferenceResolver = internal new: impl: ILegacyReferenceResolver -> LegacyReferenceResolver member internal Impl: ILegacyReferenceResolver - diff --git a/src/fsharp/ScriptClosure.fsi b/src/fsharp/ScriptClosure.fsi index 29957edb3be..06896005e07 100644 --- a/src/fsharp/ScriptClosure.fsi +++ b/src/fsharp/ScriptClosure.fsi @@ -21,19 +21,17 @@ type CodeContext = | Editing [] -type LoadClosureInput = - { - FileName: string - +type LoadClosureInput = + { FileName: string + SyntaxTree: ParsedInput option - - ParseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list - - MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list - } + + ParseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list + + MetaCommandDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list } [] -type LoadClosure = +type LoadClosure = { /// The source files along with the ranges of the #load positions in each file. SourceFiles: (string * range list) list @@ -41,7 +39,7 @@ type LoadClosure = References: (string * AssemblyResolution list) list /// The resolved pacakge references along with the ranges of the #r positions in each file. - PackageReferences: (range * string list)[] + PackageReferences: (range * string list) [] /// Whether we're decided to use .NET Framework analysis for this script UseDesktopFramework: bool @@ -62,44 +60,43 @@ type LoadClosure = NoWarns: (string * range list) list /// Diagnostics seen while processing resolutions - ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list + ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list /// Diagnostics to show for root of closure (used by fsc.fs) AllRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list /// Diagnostics seen while processing the compiler options implied root of closure - LoadClosureRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list } + LoadClosureRootFileDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list } - /// Analyze a script text and find the closure of its references. - /// Used from FCS, when editing a script file. + /// Analyze a script text and find the closure of its references. + /// Used from FCS, when editing a script file. // // A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the // same arguments as the rest of the application. static member ComputeClosureOfScriptText: - legacyReferenceResolver: LegacyReferenceResolver * - defaultFSharpBinariesDir: string * - filename: string * - sourceText: ISourceText * - implicitDefines:CodeContext * - useSimpleResolution: bool * - useFsiAuxLib: bool * - useSdkRefs: bool * - sdkDir: string option * - lexResourceManager: Lexhelp.LexResourceManager * - applyCompilerOptions: (TcConfigBuilder -> unit) * - assumeDotNetFramework: bool * + legacyReferenceResolver: LegacyReferenceResolver * + defaultFSharpBinariesDir: string * + filename: string * + sourceText: ISourceText * + implicitDefines: CodeContext * + useSimpleResolution: bool * + useFsiAuxLib: bool * + useSdkRefs: bool * + sdkDir: string option * + lexResourceManager: Lexhelp.LexResourceManager * + applyCompilerOptions: (TcConfigBuilder -> unit) * + assumeDotNetFramework: bool * tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot * reduceMemoryUsage: ReduceMemoryFlag * - dependencyProvider: DependencyProvider - -> LoadClosure + dependencyProvider: DependencyProvider -> + LoadClosure /// Analyze a set of script files and find the closure of their references. The resulting references are then added to the given TcConfig. - /// Used from fsi.fs and fsc.fs, for #load and command line. - static member ComputeClosureOfScriptFiles: - tcConfig:TcConfig * - (string * range) list * - implicitDefines:CodeContext * + /// Used from fsi.fs and fsc.fs, for #load and command line. + static member ComputeClosureOfScriptFiles: + tcConfig: TcConfig * + (string * range) list * + implicitDefines: CodeContext * lexResourceManager: Lexhelp.LexResourceManager * - dependencyProvider: DependencyProvider - -> LoadClosure - + dependencyProvider: DependencyProvider -> + LoadClosure diff --git a/src/fsharp/SignatureConformance.fsi b/src/fsharp/SignatureConformance.fsi index 673e6037d77..d9aec6901dc 100644 --- a/src/fsharp/SignatureConformance.fsi +++ b/src/fsharp/SignatureConformance.fsi @@ -6,7 +6,7 @@ module internal FSharp.Compiler.SignatureConformance open System.Text -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps @@ -14,7 +14,13 @@ open FSharp.Compiler.InfoReader exception RequiredButNotSpecified of DisplayEnv * ModuleOrNamespaceRef * string * (StringBuilder -> unit) * range -exception ValueNotContained of DisplayEnv * InfoReader * ModuleOrNamespaceRef * Val * Val * (string * string * string -> string) +exception ValueNotContained of + DisplayEnv * + InfoReader * + ModuleOrNamespaceRef * + Val * + Val * + (string * string * string -> string) exception ConstrNotContained of DisplayEnv * InfoReader * Tycon * UnionCase * UnionCase * (string * string -> string) @@ -26,13 +32,34 @@ exception InterfaceNotRevealed of DisplayEnv * TType * range type Checker = - new: g:TcGlobals.TcGlobals * amap:Import.ImportMap * denv:DisplayEnv * remapInfo:SignatureRepackageInfo * checkingSig:bool -> Checker + new: + g: TcGlobals.TcGlobals * + amap: Import.ImportMap * + denv: DisplayEnv * + remapInfo: SignatureRepackageInfo * + checkingSig: bool -> + Checker - member CheckSignature: aenv:TypeEquivEnv -> infoReader:InfoReader -> implModRef:ModuleOrNamespaceRef -> signModType:ModuleOrNamespaceType -> bool + member CheckSignature: + aenv: TypeEquivEnv -> + infoReader: InfoReader -> + implModRef: ModuleOrNamespaceRef -> + signModType: ModuleOrNamespaceType -> + bool + + member CheckTypars: m: range -> aenv: TypeEquivEnv -> implTypars: Typars -> signTypars: Typars -> bool - member CheckTypars: m:range -> aenv:TypeEquivEnv -> implTypars:Typars -> signTypars:Typars -> bool - /// Check the names add up between a signature and its implementation. We check this first. -val CheckNamesOfModuleOrNamespaceContents: denv:DisplayEnv -> infoReader:InfoReader -> implModRef:ModuleOrNamespaceRef -> signModType:ModuleOrNamespaceType -> bool +val CheckNamesOfModuleOrNamespaceContents: + denv: DisplayEnv -> + infoReader: InfoReader -> + implModRef: ModuleOrNamespaceRef -> + signModType: ModuleOrNamespaceType -> + bool -val CheckNamesOfModuleOrNamespace: denv:DisplayEnv -> infoReader:InfoReader -> implModRef:ModuleOrNamespaceRef -> signModType:ModuleOrNamespaceType -> bool +val CheckNamesOfModuleOrNamespace: + denv: DisplayEnv -> + infoReader: InfoReader -> + implModRef: ModuleOrNamespaceRef -> + signModType: ModuleOrNamespaceType -> + bool diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fsi b/src/fsharp/SimulatedMSBuildReferenceResolver.fsi index 0221673344c..e9c8118872f 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fsi +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fsi @@ -4,4 +4,3 @@ module internal FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver val getResolver: unit -> LegacyReferenceResolver - diff --git a/src/fsharp/StaticLinking.fsi b/src/fsharp/StaticLinking.fsi index d9f1c6b9a4e..58445dfc3b3 100644 --- a/src/fsharp/StaticLinking.fsi +++ b/src/fsharp/StaticLinking.fsi @@ -11,4 +11,6 @@ open FSharp.Compiler.CompilerImports // Compute a static linker. This only captures tcImports (a large data structure) if // static linking is enabled. Normally this is not the case, which lets us collect tcImports // prior to this point. -val StaticLink: ctok: CompilationThreadToken * tcConfig: TcConfig * tcImports: TcImports * ilGlobals: ILGlobals -> (ILModuleDef -> ILModuleDef) +val StaticLink: + ctok: CompilationThreadToken * tcConfig: TcConfig * tcImports: TcImports * ilGlobals: ILGlobals -> + (ILModuleDef -> ILModuleDef) diff --git a/src/fsharp/SyntaxTree.fsi b/src/fsharp/SyntaxTree.fsi index e2e2106a975..f8ff099dc04 100644 --- a/src/fsharp/SyntaxTree.fsi +++ b/src/fsharp/SyntaxTree.fsi @@ -11,13 +11,12 @@ open FSharp.Compiler.SyntaxTrivia /// Represents an identifier in F# code [] type Ident = - new: text: string * range: range -> Ident - member idText: string - member idRange: range + new: text: string * range: range -> Ident + member idText: string + member idRange: range /// Represents an identifier with potentially additional trivia information. -type SynIdent = - | SynIdent of ident:Ident * trivia:IdentTrivia option +type SynIdent = SynIdent of ident: Ident * trivia: IdentTrivia option /// Represents a long identifier e.g. 'A.B.C' type LongIdent = Ident list @@ -37,13 +36,13 @@ type SynLongIdent = /// Get the long ident for this construct member LongIdent: LongIdent - + /// Get the dot ranges member Dots: range list - + /// Get the trivia of the idents member Trivia: IdentTrivia list - + /// Get the idents with potential trivia attached member IdentsWithTrivia: SynIdent list @@ -59,7 +58,7 @@ module SynLongIdentHelpers = val (|LongIdentWithDots|): SynLongIdent -> LongIdent * range list [] - val LongIdentWithDots: LongIdent * range list -> SynLongIdent + val LongIdentWithDots: LongIdent * range list -> SynLongIdent /// Indicates if the construct arises from error recovery [] @@ -158,21 +157,21 @@ type SynConst = | UserNum of value: string * suffix: string /// F# syntax: verbatim or regular string, e.g. "abc" - | String of text: string * synStringKind :SynStringKind * range: range + | String of text: string * synStringKind: SynStringKind * range: range /// F# syntax: verbatim or regular byte string, e.g. "abc"B. /// /// Also used internally in the typechecker once an array of unit16 constants /// is detected, to allow more efficient processing of large arrays of uint16 constants. - | Bytes of bytes: byte[] * synByteStringKind: SynByteStringKind * range: range + | Bytes of bytes: byte [] * synByteStringKind: SynByteStringKind * range: range /// Used internally in the typechecker once an array of unit16 constants /// is detected, to allow more efficient processing of large arrays of uint16 constants. - | UInt16s of uint16[] + | UInt16s of uint16 [] /// Old comment: "we never iterate, so the const here is not another SynConst.Measure" | Measure of constant: SynConst * constantRange: range * SynMeasure - + /// Source Line, File, and Path Identifiers /// Containing both the original value as the evaluated value. | SourceIdentifier of constant: string * value: string * range: range @@ -211,7 +210,7 @@ type SynMeasure = /// Represents an unchecked syntax tree of F# unit of measure exponents. [] type SynRationalConst = - + | Integer of value: int32 | Rational of numerator: int32 * denominator: int32 * range: range @@ -240,8 +239,7 @@ type DebugPointAtTarget = /// Represents a debug point at a leaf expression (e.g. an application or constant). [] -type DebugPointAtLeafExpr = - | Yes of range +type DebugPointAtLeafExpr = Yes of range /// Represents whether a debug point should be suppressed for either the /// first or second part of a sequential execution, that is whether the @@ -371,72 +369,44 @@ type SynBindingKind = /// Represents the explicit declaration of a type parameter [] -type SynTyparDecl = - | SynTyparDecl of attributes: SynAttributes * SynTypar +type SynTyparDecl = SynTyparDecl of attributes: SynAttributes * SynTypar /// The unchecked abstract syntax tree of F# type constraints [] type SynTypeConstraint = /// F# syntax: is 'typar: struct - | WhereTyparIsValueType of - typar: SynTypar * - range: range + | WhereTyparIsValueType of typar: SynTypar * range: range /// F# syntax: is 'typar: not struct - | WhereTyparIsReferenceType of - typar: SynTypar * - range: range + | WhereTyparIsReferenceType of typar: SynTypar * range: range /// F# syntax is 'typar: unmanaged - | WhereTyparIsUnmanaged of - typar: SynTypar * - range: range + | WhereTyparIsUnmanaged of typar: SynTypar * range: range /// F# syntax is 'typar: null - | WhereTyparSupportsNull of - typar: SynTypar * - range: range + | WhereTyparSupportsNull of typar: SynTypar * range: range /// F# syntax is 'typar: comparison - | WhereTyparIsComparable of - typar: SynTypar * - range: range + | WhereTyparIsComparable of typar: SynTypar * range: range /// F# syntax is 'typar: equality - | WhereTyparIsEquatable of - typar: SynTypar * - range: range + | WhereTyparIsEquatable of typar: SynTypar * range: range /// F# syntax is default ^T: type - | WhereTyparDefaultsToType of - typar: SynTypar * - typeName: SynType * - range: range + | WhereTyparDefaultsToType of typar: SynTypar * typeName: SynType * range: range /// F# syntax is 'typar :> type - | WhereTyparSubtypeOfType of - typar: SynTypar * - typeName: SynType * - range: range + | WhereTyparSubtypeOfType of typar: SynTypar * typeName: SynType * range: range /// F# syntax is ^T: (static member MemberName: ^T * int -> ^T) - | WhereTyparSupportsMember of - typars: SynType list * - memberSig: SynMemberSig * - range: range + | WhereTyparSupportsMember of typars: SynType list * memberSig: SynMemberSig * range: range /// F# syntax is 'typar: enum<'UnderlyingType> - | WhereTyparIsEnum of - typar: SynTypar * - typeArgs: SynType list * - range: range + | WhereTyparIsEnum of typar: SynTypar * typeArgs: SynType list * range: range /// F# syntax is 'typar: delegate<'Args, unit> - | WhereTyparIsDelegate of - typar: SynTypar * - typeArgs: SynType list * - range: range + | WhereTyparIsDelegate of typar: SynTypar * typeArgs: SynType list * range: range member Range: range @@ -453,12 +423,11 @@ type SynTyparDecls = member Range: range /// Represents a syntax tree for F# types -[] -type SynType = - +[] +type SynType = + /// F# syntax: A.B.C - | LongIdent of - longDotId: SynLongIdent + | LongIdent of longDotId: SynLongIdent /// F# syntax: type or type type or (type, ..., type) type /// isPostfix: indicates a postfix type application e.g. "int list" or "(int, string) dict" @@ -466,7 +435,7 @@ type SynType = typeName: SynType * lessRange: range option * typeArgs: SynType list * - commaRanges: range list * // interstitial commas + commaRanges: range list * // interstitial commas greaterRange: range option * isPostfix: bool * range: range @@ -477,170 +446,118 @@ type SynType = longDotId: SynLongIdent * lessRange: range option * typeArgs: SynType list * - commaRanges: range list * // interstitial commas + commaRanges: range list * // interstitial commas greaterRange: range option * range: range /// F# syntax: type * ... * type /// F# syntax: struct (type * ... * type) - // the bool is true if / rather than * follows the type | Tuple of + // the bool is true if / rather than * follows the type isStruct: bool * - elementTypes:(bool*SynType) list * + elementTypes: (bool * SynType) list * range: range /// F# syntax: {| id: type; ...; id: type |} /// F# syntax: struct {| id: type; ...; id: type |} - | AnonRecd of - isStruct: bool * - fields:(Ident * SynType) list * - range: range + | AnonRecd of isStruct: bool * fields: (Ident * SynType) list * range: range /// F# syntax: type[] - | Array of - rank: int * - elementType: SynType * - range: range + | Array of rank: int * elementType: SynType * range: range /// F# syntax: type -> type - | Fun of - argType: SynType * - returnType: SynType * - range: range + | Fun of argType: SynType * returnType: SynType * range: range /// F# syntax: 'Var - | Var of - typar: SynTypar * - range: range + | Var of typar: SynTypar * range: range /// F# syntax: _ | Anon of range: range /// F# syntax: typ with constraints - | WithGlobalConstraints of - typeName: SynType * - constraints: SynTypeConstraint list * - range: range + | WithGlobalConstraints of typeName: SynType * constraints: SynTypeConstraint list * range: range /// F# syntax: #type - | HashConstraint of - innerType: SynType * - range: range + | HashConstraint of innerType: SynType * range: range /// F# syntax: for units of measure e.g. m / s - | MeasureDivide of - dividend: SynType * - divisor: SynType * - range: range + | MeasureDivide of dividend: SynType * divisor: SynType * range: range /// F# syntax: for units of measure e.g. m^3, kg^1/2 - | MeasurePower of - baseMeasure: SynType * - exponent: SynRationalConst * - range: range + | MeasurePower of baseMeasure: SynType * exponent: SynRationalConst * range: range /// F# syntax: 1, "abc" etc, used in parameters to type providers /// For the dimensionless units i.e. 1, and static parameters to provided types - | StaticConstant of - constant: SynConst * - range: range + | StaticConstant of constant: SynConst * range: range /// F# syntax: const expr, used in static parameters to type providers - | StaticConstantExpr of - expr: SynExpr * - range: range + | StaticConstantExpr of expr: SynExpr * range: range /// F# syntax: ident=1 etc., used in static parameters to type providers - | StaticConstantNamed of - ident: SynType * - value: SynType * - range: range + | StaticConstantNamed of ident: SynType * value: SynType * range: range - | Paren of - innerType: SynType * - range: range + | Paren of innerType: SynType * range: range /// Gets the syntax range of this construct member Range: range /// Represents a syntax tree for F# expressions -[] +[] type SynExpr = /// F# syntax: (expr) /// /// Parenthesized expressions. Kept in AST to distinguish A.M((x, y)) /// from A.M(x, y), among other things. - | Paren of - expr: SynExpr * - leftParenRange: range * - rightParenRange: range option * - range: range + | Paren of expr: SynExpr * leftParenRange: range * rightParenRange: range option * range: range /// F# syntax: <@ expr @>, <@@ expr @@> /// /// Quote(operator, isRaw, quotedSynExpr, isFromQueryExpression, m) - | Quote of - operator: SynExpr * - isRaw: bool * - quotedExpr: SynExpr * - isFromQueryExpression: bool * - range: range + | Quote of operator: SynExpr * isRaw: bool * quotedExpr: SynExpr * isFromQueryExpression: bool * range: range /// F# syntax: 1, 1.3, () etc. - | Const of - constant: SynConst * - range: range + | Const of constant: SynConst * range: range /// F# syntax: expr: type - | Typed of - expr: SynExpr * - targetType: SynType * - range: range + | Typed of expr: SynExpr * targetType: SynType * range: range /// F# syntax: e1, ..., eN | Tuple of isStruct: bool * exprs: SynExpr list * - commaRanges: range list * // interstitial commas - range: range + commaRanges: range list * // interstitial commas + range: range /// F# syntax: {| id1=e1; ...; idN=eN |} /// F# syntax: struct {| id1=e1; ...; idN=eN |} | AnonRecd of isStruct: bool * - copyInfo:(SynExpr * BlockSeparator) option * - recordFields:(Ident * range option * SynExpr) list * + copyInfo: (SynExpr * BlockSeparator) option * + recordFields: (Ident * range option * SynExpr) list * range: range /// F# syntax: [ e1; ...; en ], [| e1; ...; en |] - | ArrayOrList of - isArray: bool * - exprs: SynExpr list * - range: range + | ArrayOrList of isArray: bool * exprs: SynExpr list * range: range /// F# syntax: { f1=e1; ...; fn=en } /// inherit includes location of separator (for tooling) /// copyOpt contains range of the following WITH part (for tooling) /// every field includes range of separator after the field (for tooling) | Record of - baseInfo:(SynType * SynExpr * range * BlockSeparator option * range) option * - copyInfo:(SynExpr * BlockSeparator) option * + baseInfo: (SynType * SynExpr * range * BlockSeparator option * range) option * + copyInfo: (SynExpr * BlockSeparator) option * recordFields: SynExprRecordField list * range: range /// F# syntax: new C(...) /// The flag is true if known to be 'family' ('protected') scope - | New of - isProtected: bool * - targetType: SynType * - expr: SynExpr * - range: range + | New of isProtected: bool * targetType: SynType * expr: SynExpr * range: range /// F# syntax: { new ... with ... } | ObjExpr of objType: SynType * - argOptions:(SynExpr * Ident option) option * + argOptions: (SynExpr * Ident option) option * withKeyword: range option * bindings: SynBinding list * members: SynMemberDefn list * @@ -649,11 +566,7 @@ type SynExpr = range: range /// F# syntax: 'while ... do ...' - | While of - whileDebugPoint: DebugPointAtWhile * - whileExpr: SynExpr * - doExpr: SynExpr * - range: range + | While of whileDebugPoint: DebugPointAtWhile * whileExpr: SynExpr * doExpr: SynExpr * range: range /// F# syntax: 'for i = ... to ... do ...' | For of @@ -679,10 +592,7 @@ type SynExpr = range: range /// F# syntax: [ expr ], [| expr |] - | ArrayOrListComputed of - isArray: bool * - expr: SynExpr * - range: range + | ArrayOrListComputed of isArray: bool * expr: SynExpr * range: range /// F# syntax: expr.. /// F# syntax: ..expr @@ -693,26 +603,21 @@ type SynExpr = | IndexRange of expr1: SynExpr option * opm: range * - expr2: SynExpr option* + expr2: SynExpr option * range1: range * range2: range * range: range /// F# syntax: ^expr - | IndexFromEnd of - expr: SynExpr * - range: range + | IndexFromEnd of expr: SynExpr * range: range /// F# syntax: { expr } - | ComputationExpr of - hasSeqBuilder: bool * - expr: SynExpr * - range: range + | ComputationExpr of hasSeqBuilder: bool * expr: SynExpr * range: range /// First bool indicates if lambda originates from a method. Patterns here are always "simple" /// Second bool indicates if this is a "later" part of an iterated sequence of lambdas /// parsedData keeps original parsed patterns and expression, - /// prior to transforming to "simple" patterns and iterated lambdas + /// prior to transforming to "simple" patterns and iterated lambdas /// /// F# syntax: fun pat -> expr | Lambda of @@ -741,26 +646,17 @@ type SynExpr = trivia: SynExprMatchTrivia /// F# syntax: do expr - | Do of - expr: SynExpr * - range: range + | Do of expr: SynExpr * range: range /// F# syntax: assert expr - | Assert of - expr: SynExpr * - range: range + | Assert of expr: SynExpr * range: range /// F# syntax: f x /// /// flag: indicates if the application is syntactically atomic, e.g. f.[1] is atomic, but 'f x' is not /// isInfix is true for the first app of an infix operator, e.g. 1+2 /// becomes App(App(+, 1), 2), where the inner node is marked isInfix - | App of - flag: ExprAtomicFlag * - isInfix: bool * - funcExpr: SynExpr * - argExpr: SynExpr * - range: range + | App of flag: ExprAtomicFlag * isInfix: bool * funcExpr: SynExpr * argExpr: SynExpr * range: range /// F# syntax: expr | TypeApp of @@ -803,9 +699,7 @@ type SynExpr = trivia: SynExprTryFinallyTrivia /// F# syntax: lazy expr - | Lazy of - expr: SynExpr * - range: range + | Lazy of expr: SynExpr * range: range /// F# syntax: expr; expr /// @@ -830,8 +724,7 @@ type SynExpr = /// F# syntax: ident /// Optimized representation for SynExpr.LongIdent (false, [id], id.idRange) - | Ident of - ident: Ident + | Ident of ident: Ident /// F# syntax: ident.ident...ident /// @@ -845,37 +738,19 @@ type SynExpr = range: range /// F# syntax: ident.ident...ident <- expr - | LongIdentSet of - longDotId: SynLongIdent * - expr: SynExpr * - range: range + | LongIdentSet of longDotId: SynLongIdent * expr: SynExpr * range: range /// F# syntax: expr.ident.ident - | DotGet of - expr: SynExpr * - rangeOfDot: range * - longDotId: SynLongIdent * - range: range + | DotGet of expr: SynExpr * rangeOfDot: range * longDotId: SynLongIdent * range: range /// F# syntax: expr.ident...ident <- expr - | DotSet of - targetExpr: SynExpr * - longDotId: SynLongIdent * - rhsExpr: SynExpr * - range: range + | DotSet of targetExpr: SynExpr * longDotId: SynLongIdent * rhsExpr: SynExpr * range: range /// F# syntax: expr <- expr - | Set of - targetExpr: SynExpr * - rhsExpr: SynExpr * - range: range + | Set of targetExpr: SynExpr * rhsExpr: SynExpr * range: range /// F# syntax: expr.[expr, ..., expr] - | DotIndexedGet of - objectExpr: SynExpr * - indexArgs: SynExpr * - dotRange: range * - range: range + | DotIndexedGet of objectExpr: SynExpr * indexArgs: SynExpr * dotRange: range * range: range /// F# syntax: expr.[expr, ..., expr] <- expr | DotIndexedSet of @@ -887,11 +762,7 @@ type SynExpr = range: range /// F# syntax: Type.Items(e1) <- e2, rarely used named-property-setter notation, e.g. Foo.Bar.Chars(3) <- 'a' - | NamedIndexedPropertySet of - longDotId: SynLongIdent * - expr1: SynExpr * - expr2: SynExpr * - range: range + | NamedIndexedPropertySet of longDotId: SynLongIdent * expr1: SynExpr * expr2: SynExpr * range: range /// F# syntax: expr.Items (e1) <- e2, rarely used named-property-setter notation, e.g. (stringExpr).Chars(3) <- 'a' | DotNamedIndexedPropertySet of @@ -902,86 +773,53 @@ type SynExpr = range: range /// F# syntax: expr :? type - | TypeTest of - expr: SynExpr * - targetType: SynType * - range: range + | TypeTest of expr: SynExpr * targetType: SynType * range: range /// F# syntax: expr :> type - | Upcast of - expr: SynExpr * - targetType: SynType * - range: range + | Upcast of expr: SynExpr * targetType: SynType * range: range /// F# syntax: expr :?> type - | Downcast of - expr: SynExpr * - targetType: SynType * - range: range + | Downcast of expr: SynExpr * targetType: SynType * range: range /// F# syntax: upcast expr - | InferredUpcast of - expr: SynExpr * - range: range + | InferredUpcast of expr: SynExpr * range: range /// F# syntax: downcast expr - | InferredDowncast of - expr: SynExpr * - range: range + | InferredDowncast of expr: SynExpr * range: range /// F# syntax: null - | Null of - range: range + | Null of range: range /// F# syntax: &expr, &&expr - | AddressOf of - isByref: bool * - expr: SynExpr * - opRange: range * - range: range + | AddressOf of isByref: bool * expr: SynExpr * opRange: range * range: range /// F# syntax: ((typar1 or ... or typarN): (member-dig) expr) - | TraitCall of - supportTys: SynTypar list * - traitSig: SynMemberSig * - argExpr: SynExpr * - range: range + | TraitCall of supportTys: SynTypar list * traitSig: SynMemberSig * argExpr: SynExpr * range: range /// F# syntax: ... in ... /// Computation expressions only, based on JOIN_IN token from lex filter - | JoinIn of - lhsExpr: SynExpr * - lhsRange: range * - rhsExpr: SynExpr * - range: range + | JoinIn of lhsExpr: SynExpr * lhsRange: range * rhsExpr: SynExpr * range: range /// Used in parser error recovery and internally during type checking for translating computation expressions. - | ImplicitZero of - range: range + | ImplicitZero of range: range /// Used internally during type checking for translating computation expressions. | SequentialOrImplicitYield of - debugPoint:DebugPointAtSequential * - expr1:SynExpr * - expr2:SynExpr * - ifNotStmt:SynExpr * - range:range + debugPoint: DebugPointAtSequential * + expr1: SynExpr * + expr2: SynExpr * + ifNotStmt: SynExpr * + range: range /// F# syntax: yield expr /// F# syntax: return expr /// Computation expressions only - | YieldOrReturn of - flags: (bool * bool) * - expr: SynExpr * - range: range + | YieldOrReturn of flags: (bool * bool) * expr: SynExpr * range: range /// F# syntax: yield! expr /// F# syntax: return! expr /// Computation expressions only - | YieldOrReturnFrom of - flags: (bool * bool) * - expr: SynExpr * - range: range + | YieldOrReturnFrom of flags: (bool * bool) * expr: SynExpr * range: range /// F# syntax: let! pat = expr in expr /// F# syntax: use! pat = expr in expr @@ -994,7 +832,7 @@ type SynExpr = pat: SynPat * rhs: SynExpr * andBangs: SynExprAndBang list * - body:SynExpr * + body: SynExpr * range: range * trivia: SynExprLetOrUseBangTrivia @@ -1008,13 +846,11 @@ type SynExpr = /// F# syntax: do! expr /// Computation expressions only - | DoBang of - expr: SynExpr * - range: range + | DoBang of expr: SynExpr * range: range /// Only used in FSharp.Core | LibraryOnlyILAssembly of - ilCode: obj * // this type is ILInstr[] but is hidden to avoid the representation of AbstractIL being public + ilCode: obj * // this type is ILInstr[] but is hidden to avoid the representation of AbstractIL being public typeArgs: SynType list * args: SynExpr list * retTy: SynType list * @@ -1028,11 +864,7 @@ type SynExpr = range: range /// Only used in FSharp.Core - | LibraryOnlyUnionCaseFieldGet of - expr: SynExpr * - longId: LongIdent * - fieldNum: int * - range: range + | LibraryOnlyUnionCaseFieldGet of expr: SynExpr * longId: LongIdent * fieldNum: int * range: range /// Only used in FSharp.Core | LibraryOnlyUnionCaseFieldSet of @@ -1043,37 +875,23 @@ type SynExpr = range: range /// Inserted for error recovery - | ArbitraryAfterError of - debugStr: string * - range: range + | ArbitraryAfterError of debugStr: string * range: range /// Inserted for error recovery - | FromParseError of - expr: SynExpr * - range: range + | FromParseError of expr: SynExpr * range: range /// Inserted for error recovery when there is "expr." and missing tokens or error recovery after the dot - | DiscardAfterMissingQualificationAfterDot of - expr: SynExpr * - range: range + | DiscardAfterMissingQualificationAfterDot of expr: SynExpr * range: range /// 'use x = fixed expr' - | Fixed of - expr: SynExpr * - range: range + | Fixed of expr: SynExpr * range: range /// F# syntax: interpolated string, e.g. "abc{x}" or "abc{x,3}" or "abc{x:N4}" /// Note the string ranges include the quotes, verbatim markers, dollar sign and braces - | InterpolatedString of - contents: SynInterpolatedStringPart list * - synStringKind :SynStringKind * - range: range + | InterpolatedString of contents: SynInterpolatedStringPart list * synStringKind: SynStringKind * range: range /// Debug points arising from computation expressions - | DebugPoint of - debugPoint: DebugPointAtLeafExpr * - isControlFlow: bool * - innerExpr: SynExpr + | DebugPoint of debugPoint: DebugPointAtLeafExpr * isControlFlow: bool * innerExpr: SynExpr /// Gets the syntax range of this construct member Range: range @@ -1136,16 +954,10 @@ type SynSimplePat = range: range /// A type annotated simple pattern - | Typed of - pat: SynSimplePat * - targetType: SynType * - range: range + | Typed of pat: SynSimplePat * targetType: SynType * range: range /// An attributed simple pattern - | Attrib of - pat: SynSimplePat * - attributes: SynAttributes * - range: range + | Attrib of pat: SynSimplePat * attributes: SynAttributes * range: range member Range: range @@ -1164,15 +976,10 @@ type SynSimplePatAlternativeIdInfo = type SynStaticOptimizationConstraint = /// A static optimization conditional that activates for a particular type instantiation - | WhenTyparTyconEqualsTycon of - typar: SynTypar * - rhsType: SynType * - range: range + | WhenTyparTyconEqualsTycon of typar: SynTypar * rhsType: SynType * range: range /// A static optimization conditional that activates for a struct - | WhenTyparIsStruct of - typar: SynTypar * - range: range + | WhenTyparIsStruct of typar: SynTypar * range: range /// Represents a simple set of variable bindings a, (a, b) or (a: Type, b: Type) at a lambda, /// function definition or other binding point, after the elimination of pattern matching @@ -1180,26 +987,18 @@ type SynStaticOptimizationConstraint = /// "fun v -> match v with ..." [] type SynSimplePats = - | SimplePats of - pats: SynSimplePat list * - range: range + | SimplePats of pats: SynSimplePat list * range: range - | Typed of - pats: SynSimplePats * - targetType: SynType * - range: range + | Typed of pats: SynSimplePats * targetType: SynType * range: range member Range: range -/// Represents a syntax tree for arguments patterns +/// Represents a syntax tree for arguments patterns [] type SynArgPats = - | Pats of - pats: SynPat list + | Pats of pats: SynPat list - | NamePatPairs of - pats: (Ident * range * SynPat) list * - range: range + | NamePatPairs of pats: (Ident * range * SynPat) list * range: range member Patterns: SynPat list @@ -1208,120 +1007,76 @@ type SynArgPats = type SynPat = /// A constant in a pattern - | Const of - constant: SynConst * - range: range + | Const of constant: SynConst * range: range /// A wildcard '_' in a pattern - | Wild of - range: range + | Wild of range: range - /// A name pattern 'ident' - | Named of - ident: SynIdent * - isThisVal: bool * - accessibility: SynAccess option * - range: range + /// A name pattern 'ident' + | Named of ident: SynIdent * isThisVal: bool * accessibility: SynAccess option * range: range /// A typed pattern 'pat : type' - | Typed of - pat: SynPat * - targetType: SynType * - range: range + | Typed of pat: SynPat * targetType: SynType * range: range /// An attributed pattern, used in argument or declaration position - | Attrib of - pat: SynPat * - attributes: SynAttributes * - range: range + | Attrib of pat: SynPat * attributes: SynAttributes * range: range /// A disjunctive pattern 'pat1 | pat2' - | Or of - lhsPat: SynPat * - rhsPat: SynPat * - range: range * - trivia: SynPatOrTrivia + | Or of lhsPat: SynPat * rhsPat: SynPat * range: range * trivia: SynPatOrTrivia /// A conjunctive pattern 'pat1 & pat2' - | Ands of - pats: SynPat list * - range: range + | Ands of pats: SynPat list * range: range /// A conjunctive pattern 'pat1 as pat2' - | As of - lhsPat: SynPat * - rhsPat: SynPat * - range: range + | As of lhsPat: SynPat * rhsPat: SynPat * range: range /// A long identifier pattern possibly with argument patterns | LongIdent of longDotId: SynLongIdent * propertyKeyword: PropertyKeyword option * - extraId: Ident option * // holds additional ident for tooling - typarDecls: SynValTyparDecls option * // usually None: temporary used to parse "f<'a> x = x" + extraId: Ident option * // holds additional ident for tooling + typarDecls: SynValTyparDecls option * // usually None: temporary used to parse "f<'a> x = x" argPats: SynArgPats * accessibility: SynAccess option * range: range /// A tuple pattern - | Tuple of - isStruct: bool * - elementPats: SynPat list * - range: range + | Tuple of isStruct: bool * elementPats: SynPat list * range: range /// A parenthesized pattern - | Paren of - pat: SynPat * - range: range + | Paren of pat: SynPat * range: range /// An array or a list as a pattern - | ArrayOrList of - isArray: bool * - elementPats: SynPat list * - range: range + | ArrayOrList of isArray: bool * elementPats: SynPat list * range: range /// A record pattern - | Record of - fieldPats: ((LongIdent * Ident) * range * SynPat) list * - range: range + | Record of fieldPats: ((LongIdent * Ident) * range * SynPat) list * range: range /// The 'null' pattern - | Null of - range: range + | Null of range: range /// '?id' -- for optional argument names - | OptionalVal of - ident: Ident * - range: range + | OptionalVal of ident: Ident * range: range /// A type test pattern ':? type ' - | IsInst of - pat: SynType * - range: range + | IsInst of pat: SynType * range: range /// <@ expr @>, used for active pattern arguments - | QuoteExpr of - expr: SynExpr * - range: range + | QuoteExpr of expr: SynExpr * range: range /// Deprecated character range: ranges - | DeprecatedCharRange of - startChar: char * - endChar: char * - range: range + | DeprecatedCharRange of startChar: char * endChar: char * range: range /// Used internally in the type checker | InstanceMember of thisId: Ident * memberId: Ident * - toolingId: Ident option * // holds additional ident for tooling + toolingId: Ident option * // holds additional ident for tooling accessibility: SynAccess option * range: range /// A pattern arising from a parse error - | FromParseError of - pat: SynPat * - range: range + | FromParseError of pat: SynPat * range: range /// Gets the syntax range of this construct member Range: range @@ -1333,7 +1088,7 @@ type PropertyKeyword = | And of range /// Represents a set of bindings that implement an interface -[] +[] type SynInterfaceImpl = | SynInterfaceImpl of interfaceTy: SynType * @@ -1375,29 +1130,23 @@ type SynAttribute = AppliesToGetterAndSetter: bool /// The syntax range of the attribute - Range: range - } + Range: range } /// List of attributes enclosed in [< ... >]. [] type SynAttributeList = - { - /// The list of attributes + { /// The list of attributes Attributes: SynAttribute list - + /// The syntax range of the list of attributes - Range: range - } + Range: range } type SynAttributes = SynAttributeList list /// Represents extra information about the declaration of a value [] type SynValData = - | SynValData of - memberFlags: SynMemberFlags option * - valInfo: SynValInfo * - thisIdOpt: Ident option + | SynValData of memberFlags: SynMemberFlags option * valInfo: SynValInfo * thisIdOpt: Ident option member SynValInfo: SynValInfo @@ -1414,7 +1163,7 @@ type SynBinding = valData: SynValData * headPat: SynPat * returnInfo: SynBindingReturnInfo option * - expr: SynExpr * + expr: SynExpr * range: range * debugPoint: DebugPointAtBinding * trivia: SynBindingTrivia @@ -1431,23 +1180,18 @@ type SynBinding = /// Represents the return information in a binding for a 'let' or 'member' declaration [] -type SynBindingReturnInfo = - | SynBindingReturnInfo of - typeName: SynType * - range: range * - attributes: SynAttributes +type SynBindingReturnInfo = SynBindingReturnInfo of typeName: SynType * range: range * attributes: SynAttributes /// Represents the flags for a 'member' declaration [] type SynMemberFlags = - { - /// The member is an instance member (non-static) + { /// The member is an instance member (non-static) IsInstance: bool /// The member is a dispatch slot IsDispatchSlot: bool - /// The member is an 'override' or explicit interface implementation + /// The member is an 'override' or explicit interface implementation IsOverrideOrExplicitImpl: bool /// The member is 'final' @@ -1455,10 +1199,9 @@ type SynMemberFlags = /// The kind of the member MemberKind: SynMemberKind - + /// Additional information - Trivia: SynMemberFlagsTrivia - } + Trivia: SynMemberFlagsTrivia } /// Note the member kind is actually computed partially by a syntax tree transformation in tc.fs [] @@ -1489,30 +1232,19 @@ type SynMemberKind = type SynMemberSig = /// A member definition in a type in a signature file - | Member of - memberSig: SynValSig * - flags: SynMemberFlags * - range: range + | Member of memberSig: SynValSig * flags: SynMemberFlags * range: range /// An interface definition in a type in a signature file - | Interface of - interfaceType: SynType * - range: range + | Interface of interfaceType: SynType * range: range /// An 'inherit' definition in a type in a signature file - | Inherit of - inheritedType: SynType * - range: range + | Inherit of inheritedType: SynType * range: range /// A 'val' definition in a type in a signature file - | ValField of - field: SynField * - range: range + | ValField of field: SynField * range: range /// A nested type definition in a signature file (an unimplemented feature) - | NestedType of - nestedType: SynTypeDefnSig * - range: range + | NestedType of nestedType: SynTypeDefnSig * range: range /// Gets the syntax range of this construct member Range: range @@ -1538,21 +1270,13 @@ type SynTypeDefnKind = type SynTypeDefnSimpleRepr = /// A union type definition, type X = A | B - | Union of - accessibility: SynAccess option * - unionCases: SynUnionCase list * - range: range + | Union of accessibility: SynAccess option * unionCases: SynUnionCase list * range: range /// An enum type definition, type X = A = 1 | B = 2 - | Enum of - cases: SynEnumCase list * - range: range + | Enum of cases: SynEnumCase list * range: range /// A record type definition, type X = { A: int; B: int } - | Record of - accessibility: SynAccess option * - recordFields: SynField list * - range: range + | Record of accessibility: SynAccess option * recordFields: SynField list * range: range /// An object oriented type definition. This is not a parse-tree form, but represents the core /// type representation which the type checker splits out from the "ObjectModel" cases of type definitions. @@ -1570,22 +1294,17 @@ type SynTypeDefnSimpleRepr = /// /// F# syntax: "type X = (# "..."#) | LibraryOnlyILAssembly of - ilType: obj * // this type is ILType but is hidden to avoid the representation of AbstractIL being public + ilType: obj * // this type is ILType but is hidden to avoid the representation of AbstractIL being public range: range /// A type abbreviation, "type X = A.B.C" - | TypeAbbrev of - detail: ParserDetail * - rhsType: SynType * - range: range + | TypeAbbrev of detail: ParserDetail * rhsType: SynType * range: range /// An abstract definition, "type X" - | None of - range: range + | None of range: range /// An exception definition, "exception E = ..." - | Exception of - exnRepr: SynExceptionDefnRepr + | Exception of exnRepr: SynExceptionDefnRepr /// Gets the syntax range of this construct member Range: range @@ -1628,13 +1347,10 @@ type SynUnionCase = type SynUnionCaseKind = /// Normal style declaration - | Fields of - cases: SynField list + | Fields of cases: SynField list /// Full type spec given by 'UnionCase: ty1 * tyN -> rty'. Only used in FSharp.Core, otherwise a warning. - | FullType of - fullType: SynType * - fullTypeInfo: SynValInfo + | FullType of fullType: SynType * fullTypeInfo: SynValInfo /// Represents the syntax tree for the right-hand-side of a type definition in a signature. /// Note: in practice, using a discriminated union to make a distinction between @@ -1643,18 +1359,12 @@ type SynUnionCaseKind = type SynTypeDefnSigRepr = /// Indicates the right right-hand-side is a class, struct, interface or other object-model type - | ObjectModel of - kind: SynTypeDefnKind * - memberSigs: SynMemberSig list * - range: range + | ObjectModel of kind: SynTypeDefnKind * memberSigs: SynMemberSig list * range: range /// Indicates the right right-hand-side is a record, union or other simple type. - | Simple of - repr: SynTypeDefnSimpleRepr * - range: range + | Simple of repr: SynTypeDefnSimpleRepr * range: range - | Exception of - repr: SynExceptionDefnRepr + | Exception of repr: SynExceptionDefnRepr /// Gets the syntax range of this construct member Range: range @@ -1747,10 +1457,7 @@ type SynValInfo = [] type SynArgInfo = - | SynArgInfo of - attributes: SynAttributes * - optional: bool * - ident: Ident option + | SynArgInfo of attributes: SynAttributes * optional: bool * ident: Ident option member Ident: Ident option @@ -1758,15 +1465,11 @@ type SynArgInfo = /// Represents the names and other metadata for the type parameters for a member or function [] -type SynValTyparDecls = - | SynValTyparDecls of - typars: SynTyparDecls option * - canInfer: bool +type SynValTyparDecls = SynValTyparDecls of typars: SynTyparDecls option * canInfer: bool -/// Represents the syntactic elements associated with the "return" of a function or method. +/// Represents the syntactic elements associated with the "return" of a function or method. [] -type SynReturnInfo = - | SynReturnInfo of returnType: (SynType * SynArgInfo) * range: range +type SynReturnInfo = SynReturnInfo of returnType: (SynType * SynArgInfo) * range: range /// Represents the right hand side of an exception declaration 'exception E = ... ' [] @@ -1781,7 +1484,7 @@ type SynExceptionDefnRepr = range: range /// Gets the syntax range of this construct - member Range: range + member Range: range /// Represents the right hand side of an exception declaration 'exception E = ... ' plus /// any member definitions for the exception @@ -1803,19 +1506,13 @@ type SynExceptionDefn = type SynTypeDefnRepr = /// An object model type definition (class or interface) - | ObjectModel of - kind: SynTypeDefnKind * - members: SynMemberDefns * - range: range + | ObjectModel of kind: SynTypeDefnKind * members: SynMemberDefns * range: range /// A simple type definition (record, union, abbreviation) - | Simple of - simpleRepr: SynTypeDefnSimpleRepr * - range: range + | Simple of simpleRepr: SynTypeDefnSimpleRepr * range: range /// An exception definition - | Exception of - exnRepr: SynExceptionDefnRepr + | Exception of exnRepr: SynExceptionDefnRepr /// Gets the syntax range of this construct member Range: range @@ -1835,19 +1532,15 @@ type SynTypeDefn = /// Gets the syntax range of this construct member Range: range -/// Represents a definition element within a type definition, e.g. 'member ... ' +/// Represents a definition element within a type definition, e.g. 'member ... ' [] type SynMemberDefn = /// An 'open' definition within a type - | Open of - target: SynOpenDeclTarget * - range: range + | Open of target: SynOpenDeclTarget * range: range /// A 'member' definition within a type - | Member of - memberDefn: SynBinding * - range: range + | Member of memberDefn: SynBinding * range: range /// An implicit constructor definition | ImplicitCtor of @@ -1859,48 +1552,25 @@ type SynMemberDefn = range: range /// An implicit inherit definition, 'inherit (args...) as base' - | ImplicitInherit of - inheritType: SynType * - inheritArgs: SynExpr * - inheritAlias: Ident option * - range: range + | ImplicitInherit of inheritType: SynType * inheritArgs: SynExpr * inheritAlias: Ident option * range: range /// A 'let' definition within a class - | LetBindings of - bindings: SynBinding list * - isStatic: bool * - isRecursive: bool * - range: range + | LetBindings of bindings: SynBinding list * isStatic: bool * isRecursive: bool * range: range /// An abstract slot definition within a class or interface - | AbstractSlot of - slotSig: SynValSig * - flags: SynMemberFlags * - range: range + | AbstractSlot of slotSig: SynValSig * flags: SynMemberFlags * range: range /// An interface implementation definition within a class - | Interface of - interfaceType: SynType * - withKeyword: range option * - members: SynMemberDefns option * - range: range + | Interface of interfaceType: SynType * withKeyword: range option * members: SynMemberDefns option * range: range /// An 'inherit' definition within a class - | Inherit of - baseType: SynType * - asIdent: Ident option * - range: range + | Inherit of baseType: SynType * asIdent: Ident option * range: range /// A 'val' definition within a class - | ValField of - fieldInfo: SynField * - range: range + | ValField of fieldInfo: SynField * range: range /// A nested type definition, a feature that is not implemented - | NestedType of - typeDefn: SynTypeDefn * - accessibility: SynAccess option * - range: range + | NestedType of typeDefn: SynTypeDefn * accessibility: SynAccess option * range: range /// An auto-property definition, F# syntax: 'member val X = expr' | AutoProperty of @@ -1909,7 +1579,7 @@ type SynMemberDefn = ident: Ident * typeOpt: SynType option * propKind: SynMemberKind * - memberFlags:(SynMemberKind -> SynMemberFlags) * + memberFlags: (SynMemberKind -> SynMemberFlags) * xmlDoc: PreXmlDoc * accessibility: SynAccess option * equalsRange: range * @@ -1924,14 +1594,11 @@ type SynMemberDefn = type SynMemberDefns = SynMemberDefn list /// Represents a definition within a module -[] +[] type SynModuleDecl = /// A module abbreviation definition 'module X = A.B.C' - | ModuleAbbrev of - ident: Ident * - longId: LongIdent * - range: range + | ModuleAbbrev of ident: Ident * longId: LongIdent * range: range /// A nested module definition 'module X = ...' | NestedModule of @@ -1943,51 +1610,35 @@ type SynModuleDecl = trivia: SynModuleDeclNestedModuleTrivia /// A 'let' definition within a module - | Let of - isRecursive: bool * - bindings: SynBinding list * - range: range + | Let of isRecursive: bool * bindings: SynBinding list * range: range /// An 'expr' within a module. - | Expr of - expr: SynExpr * - range: range + | Expr of expr: SynExpr * range: range /// One or more 'type' definitions within a module - | Types of - typeDefns: SynTypeDefn list * - range: range + | Types of typeDefns: SynTypeDefn list * range: range /// An 'exception' definition within a module - | Exception of - exnDefn: SynExceptionDefn * - range: range + | Exception of exnDefn: SynExceptionDefn * range: range /// An 'open' definition within a module - | Open of - target: SynOpenDeclTarget * - range: range + | Open of target: SynOpenDeclTarget * range: range /// An attribute definition within a module, for assembly and .NET module attributes - | Attributes of - attributes: SynAttributes * - range: range + | Attributes of attributes: SynAttributes * range: range /// A hash directive within a module - | HashDirective of - hashDirective: ParsedHashDirective * - range: range + | HashDirective of hashDirective: ParsedHashDirective * range: range /// A namespace fragment within a module - | NamespaceFragment of - fragment: SynModuleOrNamespace + | NamespaceFragment of fragment: SynModuleOrNamespace /// Gets the syntax range of this construct member Range: range /// Represents the target of the open declaration [] -type SynOpenDeclTarget = +type SynOpenDeclTarget = /// A 'open' declaration | ModuleOrNamespace of longId: LongIdent * range: range @@ -2012,10 +1663,7 @@ type SynExceptionSig = type SynModuleSigDecl = /// A module abbreviation definition within a module or namespace in a signature file - | ModuleAbbrev of - ident: Ident * - longId: LongIdent * - range: range + | ModuleAbbrev of ident: Ident * longId: LongIdent * range: range /// A nested module definition within a module or namespace in a signature file | NestedModule of @@ -2027,32 +1675,22 @@ type SynModuleSigDecl = /// A 'val' definition within a module or namespace in a signature file, corresponding /// to a 'let' definition in the implementation - | Val of - valSig: SynValSig * range: range + | Val of valSig: SynValSig * range: range /// A set of one or more type definitions within a module or namespace in a signature file - | Types of - types: SynTypeDefnSig list * - range: range + | Types of types: SynTypeDefnSig list * range: range /// An exception definition within a module or namespace in a signature file - | Exception of - exnSig: SynExceptionSig * - range: range + | Exception of exnSig: SynExceptionSig * range: range /// An 'open' definition within a module or namespace in a signature file - | Open of - target: SynOpenDeclTarget * - range: range + | Open of target: SynOpenDeclTarget * range: range /// A hash directive within a module or namespace in a signature file - | HashDirective of - hashDirective: ParsedHashDirective * - range: range + | HashDirective of hashDirective: ParsedHashDirective * range: range /// A namespace fragment within a namespace in a signature file - | NamespaceFragment of - SynModuleOrNamespaceSig + | NamespaceFragment of SynModuleOrNamespaceSig /// Gets the syntax range of this construct member Range: range @@ -2118,24 +1756,17 @@ type ParsedHashDirectiveArgument = /// Represents a parsed hash directive [] -type ParsedHashDirective = - | ParsedHashDirective of - ident: string * - args: ParsedHashDirectiveArgument list * - range: range +type ParsedHashDirective = ParsedHashDirective of ident: string * args: ParsedHashDirectiveArgument list * range: range /// Represents the syntax tree for the contents of a parsed implementation file [] type ParsedImplFileFragment = /// An implementation file which is an anonymous module definition, e.g. a script - | AnonModule of - decls: SynModuleDecl list * - range: range + | AnonModule of decls: SynModuleDecl list * range: range /// An implementation file is a named module definition, 'module N' - | NamedModule of - namedModule: SynModuleOrNamespace + | NamedModule of namedModule: SynModuleOrNamespace /// An implementation file fragment which declares a namespace fragment | NamespaceFragment of @@ -2152,13 +1783,10 @@ type ParsedImplFileFragment = type ParsedSigFileFragment = /// A signature file which is an anonymous module, e.g. the signature file for the final file in an application - | AnonModule of - decls: SynModuleSigDecl list * - range: range + | AnonModule of decls: SynModuleSigDecl list * range: range /// A signature file which is a module, 'module N' - | NamedModule of - namedModule: SynModuleOrNamespaceSig + | NamedModule of namedModule: SynModuleOrNamespaceSig /// A signature file namespace fragment | NamespaceFragment of @@ -2173,29 +1801,20 @@ type ParsedSigFileFragment = /// Represents a parsed syntax tree for an F# Interactive interaction [] type ParsedScriptInteraction = - | Definitions of - defns: SynModuleDecl list * - range: range + | Definitions of defns: SynModuleDecl list * range: range - | HashDirective of - hashDirective: ParsedHashDirective * - range: range + | HashDirective of hashDirective: ParsedHashDirective * range: range -/// Represents a parsed implementation file made up of fragments +/// Represents a parsed implementation file made up of fragments [] type ParsedImplFile = - | ParsedImplFile of - hashDirectives: ParsedHashDirective list * - fragments: ParsedImplFileFragment list + | ParsedImplFile of hashDirectives: ParsedHashDirective list * fragments: ParsedImplFileFragment list -/// Represents a parsed signature file made up of fragments +/// Represents a parsed signature file made up of fragments [] -type ParsedSigFile = - | ParsedSigFile of - hashDirectives: ParsedHashDirective list * - fragments: ParsedSigFileFragment list +type ParsedSigFile = ParsedSigFile of hashDirectives: ParsedHashDirective list * fragments: ParsedSigFileFragment list -/// Represents a scoped pragma +/// Represents a scoped pragma [] type ScopedPragma = /// A pragma to turn a warning off @@ -2206,10 +1825,10 @@ type ScopedPragma = type QualifiedNameOfFile = | QualifiedNameOfFile of Ident - /// The name of the file + /// The name of the file member Text: string - /// The identifier for the name of the file + /// The identifier for the name of the file member Id: Ident /// Gets the syntax range of this construct diff --git a/src/fsharp/SyntaxTreeOps.fsi b/src/fsharp/SyntaxTreeOps.fsi index 53b3587e668..7f66c937e75 100644 --- a/src/fsharp/SyntaxTreeOps.fsi +++ b/src/fsharp/SyntaxTreeOps.fsi @@ -12,79 +12,82 @@ type SynArgNameGenerator = new: unit -> SynArgNameGenerator member New: unit -> string member Reset: unit -> unit - -val ident: s:string * r:range -> Ident -val textOfId: id:Ident -> string +val ident: s: string * r: range -> Ident -val pathOfLid: lid:Ident list -> string list +val textOfId: id: Ident -> string -val arrPathOfLid: lid:Ident list -> string [] +val pathOfLid: lid: Ident list -> string list -val textOfPath: path:seq -> string +val arrPathOfLid: lid: Ident list -> string [] -val textOfLid: lid:Ident list -> string +val textOfPath: path: seq -> string -val rangeOfLid: lid:Ident list -> range +val textOfLid: lid: Ident list -> string -val mkSynId: m:range -> s:string -> Ident +val rangeOfLid: lid: Ident list -> range -val pathToSynLid: m:range -> p:string list -> Ident list +val mkSynId: m: range -> s: string -> Ident -val mkSynIdGet: m:range -> n:string -> SynExpr +val pathToSynLid: m: range -> p: string list -> Ident list -val mkSynLidGet: m:range -> path:string list -> n:string -> SynExpr +val mkSynIdGet: m: range -> n: string -> SynExpr -val mkSynIdGetWithAlt: m:range -> id:Ident -> altInfo:SynSimplePatAlternativeIdInfo ref option -> SynExpr +val mkSynLidGet: m: range -> path: string list -> n: string -> SynExpr -val mkSynSimplePatVar: isOpt:bool -> id:Ident -> SynSimplePat +val mkSynIdGetWithAlt: m: range -> id: Ident -> altInfo: SynSimplePatAlternativeIdInfo ref option -> SynExpr -val mkSynCompGenSimplePatVar: id:Ident -> SynSimplePat +val mkSynSimplePatVar: isOpt: bool -> id: Ident -> SynSimplePat + +val mkSynCompGenSimplePatVar: id: Ident -> SynSimplePat /// Match a long identifier, including the case for single identifiers which gets a more optimized node in the syntax tree. -val (|LongOrSingleIdent|_|): inp:SynExpr -> (bool * SynLongIdent * SynSimplePatAlternativeIdInfo ref option * range) option +val (|LongOrSingleIdent|_|): + inp: SynExpr -> (bool * SynLongIdent * SynSimplePatAlternativeIdInfo ref option * range) option -val (|SingleIdent|_|): inp:SynExpr -> Ident option +val (|SingleIdent|_|): inp: SynExpr -> Ident option /// This affects placement of debug points -val IsControlFlowExpression: e:SynExpr -> bool +val IsControlFlowExpression: e: SynExpr -> bool // The debug point for a 'let' extends to include the 'let' if we're not defining a function and the r.h.s. is not a control-flow // expression. Otherwise, there is no debug point at the binding. val IsDebugPointBinding: synPat: SynPat -> synExpr: SynExpr -> bool -val mkSynAnonField: ty:SynType * xmlDoc:PreXmlDoc -> SynField +val mkSynAnonField: ty: SynType * xmlDoc: PreXmlDoc -> SynField -val mkSynNamedField: ident:Ident * ty:SynType * xmlDoc:PreXmlDoc * m:range -> SynField +val mkSynNamedField: ident: Ident * ty: SynType * xmlDoc: PreXmlDoc * m: range -> SynField -val mkSynPatVar: vis:SynAccess option -> id:Ident -> SynPat +val mkSynPatVar: vis: SynAccess option -> id: Ident -> SynPat -val mkSynThisPatVar: id:Ident -> SynPat +val mkSynThisPatVar: id: Ident -> SynPat -val mkSynPatMaybeVar: lidwd:SynLongIdent -> vis:SynAccess option -> m:range -> SynPat +val mkSynPatMaybeVar: lidwd: SynLongIdent -> vis: SynAccess option -> m: range -> SynPat -val ( |SynPatForConstructorDecl|_| ): x:SynPat -> SynPat option +val (|SynPatForConstructorDecl|_|): x: SynPat -> SynPat option /// Recognize the '()' in 'new()' -val (|SynPatForNullaryArgs|_|): x:SynPat -> unit option +val (|SynPatForNullaryArgs|_|): x: SynPat -> unit option -val ( |SynExprErrorSkip| ): p:SynExpr -> SynExpr +val (|SynExprErrorSkip|): p: SynExpr -> SynExpr -val ( |SynExprParen|_| ): e:SynExpr -> (SynExpr * range * range option * range) option +val (|SynExprParen|_|): e: SynExpr -> (SynExpr * range * range option * range) option -val ( |SynPatErrorSkip| ): p:SynPat -> SynPat +val (|SynPatErrorSkip|): p: SynPat -> SynPat /// Push non-simple parts of a patten match over onto the r.h.s. of a lambda. /// Return a simple pattern and a function to build a match on the r.h.s. if the pattern is complex -val SimplePatOfPat: synArgNameGenerator:SynArgNameGenerator -> p:SynPat -> SynSimplePat * (SynExpr -> SynExpr) option +val SimplePatOfPat: synArgNameGenerator: SynArgNameGenerator -> p: SynPat -> SynSimplePat * (SynExpr -> SynExpr) option -val appFunOpt: funOpt:('a -> 'a) option -> x:'a -> 'a +val appFunOpt: funOpt: ('a -> 'a) option -> x: 'a -> 'a -val composeFunOpt: funOpt1:('a -> 'a) option -> funOpt2:('a -> 'a) option -> ('a -> 'a) option +val composeFunOpt: funOpt1: ('a -> 'a) option -> funOpt2: ('a -> 'a) option -> ('a -> 'a) option -val SimplePatsOfPat: synArgNameGenerator:SynArgNameGenerator -> p:SynPat -> SynSimplePats * (SynExpr -> SynExpr) option +val SimplePatsOfPat: + synArgNameGenerator: SynArgNameGenerator -> p: SynPat -> SynSimplePats * (SynExpr -> SynExpr) option -val PushPatternToExpr: synArgNameGenerator:SynArgNameGenerator -> isMember:bool -> pat:SynPat -> rhs:SynExpr -> SynSimplePats * SynExpr +val PushPatternToExpr: + synArgNameGenerator: SynArgNameGenerator -> isMember: bool -> pat: SynPat -> rhs: SynExpr -> SynSimplePats * SynExpr /// "fun (UnionCase x) (UnionCase y) -> body" /// ==> @@ -92,83 +95,98 @@ val PushPatternToExpr: synArgNameGenerator:SynArgNameGenerator -> isMember:bool /// let (UnionCase x) = tmp1 in /// let (UnionCase y) = tmp2 in /// body" -val PushCurriedPatternsToExpr: synArgNameGenerator:SynArgNameGenerator -> wholem:range -> isMember:bool -> pats:SynPat list -> arrow:Range option -> rhs:SynExpr -> SynSimplePats list * SynExpr +val PushCurriedPatternsToExpr: + synArgNameGenerator: SynArgNameGenerator -> + wholem: range -> + isMember: bool -> + pats: SynPat list -> + arrow: Range option -> + rhs: SynExpr -> + SynSimplePats list * SynExpr val opNameParenGet: string val opNameQMark: string -val mkSynOperator: opm:range -> oper:string -> SynExpr +val mkSynOperator: opm: range -> oper: string -> SynExpr -val mkSynInfix: opm:range -> l:SynExpr -> oper:string -> r:SynExpr -> SynExpr +val mkSynInfix: opm: range -> l: SynExpr -> oper: string -> r: SynExpr -> SynExpr -val mkSynBifix: m:range -> oper:string -> x1:SynExpr -> x2:SynExpr -> SynExpr +val mkSynBifix: m: range -> oper: string -> x1: SynExpr -> x2: SynExpr -> SynExpr -val mkSynTrifix: m:range -> oper:string -> x1:SynExpr -> x2:SynExpr -> x3:SynExpr -> SynExpr +val mkSynTrifix: m: range -> oper: string -> x1: SynExpr -> x2: SynExpr -> x3: SynExpr -> SynExpr -val mkSynPrefixPrim: opm:range -> m:range -> oper:string -> x:SynExpr -> SynExpr +val mkSynPrefixPrim: opm: range -> m: range -> oper: string -> x: SynExpr -> SynExpr -val mkSynPrefix: opm:range -> m:range -> oper:string -> x:SynExpr -> SynExpr +val mkSynPrefix: opm: range -> m: range -> oper: string -> x: SynExpr -> SynExpr -val mkSynCaseName: m:range -> n:string -> Ident list +val mkSynCaseName: m: range -> n: string -> Ident list -val mkSynApp1: f:SynExpr -> x1:SynExpr -> m:range -> SynExpr +val mkSynApp1: f: SynExpr -> x1: SynExpr -> m: range -> SynExpr -val mkSynApp2: f:SynExpr -> x1:SynExpr -> x2:SynExpr -> m:range -> SynExpr +val mkSynApp2: f: SynExpr -> x1: SynExpr -> x2: SynExpr -> m: range -> SynExpr -val mkSynApp3: f:SynExpr -> x1:SynExpr -> x2:SynExpr -> x3:SynExpr -> m:range -> SynExpr +val mkSynApp3: f: SynExpr -> x1: SynExpr -> x2: SynExpr -> x3: SynExpr -> m: range -> SynExpr -val mkSynApp4: f:SynExpr -> x1:SynExpr -> x2:SynExpr -> x3:SynExpr -> x4:SynExpr -> m:range -> SynExpr +val mkSynApp4: f: SynExpr -> x1: SynExpr -> x2: SynExpr -> x3: SynExpr -> x4: SynExpr -> m: range -> SynExpr -val mkSynApp5: f:SynExpr -> x1:SynExpr -> x2:SynExpr -> x3:SynExpr -> x4:SynExpr -> x5:SynExpr -> m:range -> SynExpr +val mkSynApp5: + f: SynExpr -> x1: SynExpr -> x2: SynExpr -> x3: SynExpr -> x4: SynExpr -> x5: SynExpr -> m: range -> SynExpr -val mkSynDotParenSet: m:range -> a:SynExpr -> b:SynExpr -> c:SynExpr -> SynExpr +val mkSynDotParenSet: m: range -> a: SynExpr -> b: SynExpr -> c: SynExpr -> SynExpr -val mkSynDotBrackGet: m:range -> mDot:range -> a:SynExpr -> b:SynExpr -> SynExpr +val mkSynDotBrackGet: m: range -> mDot: range -> a: SynExpr -> b: SynExpr -> SynExpr -val mkSynQMarkSet: m:range -> a:SynExpr -> b:SynExpr -> c:SynExpr -> SynExpr +val mkSynQMarkSet: m: range -> a: SynExpr -> b: SynExpr -> c: SynExpr -> SynExpr //val mkSynDotBrackSliceGet: m:range -> mDot:range -> arr:SynExpr -> sliceArg:SynIndexerArg -> SynExpr //val mkSynDotBrackSeqSliceGet: m:range -> mDot:range -> arr:SynExpr -> argsList:SynIndexerArg list -> SynExpr -val mkSynDotParenGet: lhsm:range -> dotm:range -> a:SynExpr -> b:SynExpr -> SynExpr +val mkSynDotParenGet: lhsm: range -> dotm: range -> a: SynExpr -> b: SynExpr -> SynExpr -val mkSynUnit: m:range -> SynExpr +val mkSynUnit: m: range -> SynExpr -val mkSynUnitPat: m:range -> SynPat +val mkSynUnitPat: m: range -> SynPat -val mkSynDelay: m:range -> e:SynExpr -> SynExpr +val mkSynDelay: m: range -> e: SynExpr -> SynExpr -val mkSynAssign: l:SynExpr -> r:SynExpr -> SynExpr +val mkSynAssign: l: SynExpr -> r: SynExpr -> SynExpr -val mkSynDot: dotm:range -> m:range -> l:SynExpr -> r:SynIdent -> SynExpr +val mkSynDot: dotm: range -> m: range -> l: SynExpr -> r: SynIdent -> SynExpr -val mkSynDotMissing: dotm:range -> m:range -> l:SynExpr -> SynExpr +val mkSynDotMissing: dotm: range -> m: range -> l: SynExpr -> SynExpr -val mkSynFunMatchLambdas: synArgNameGenerator:SynArgNameGenerator -> isMember:bool -> wholem:range -> ps:SynPat list -> arrow:Range option -> e:SynExpr -> SynExpr +val mkSynFunMatchLambdas: + synArgNameGenerator: SynArgNameGenerator -> + isMember: bool -> + wholem: range -> + ps: SynPat list -> + arrow: Range option -> + e: SynExpr -> + SynExpr -val arbExpr: debugStr:string * range:range -> SynExpr +val arbExpr: debugStr: string * range: range -> SynExpr -val unionRangeWithListBy: projectRangeFromThing:('a -> range) -> m:range -> listOfThing:'a list -> range +val unionRangeWithListBy: projectRangeFromThing: ('a -> range) -> m: range -> listOfThing: 'a list -> range -val inline unionRangeWithXmlDoc: xmlDoc:PreXmlDoc -> range:range -> range +val inline unionRangeWithXmlDoc: xmlDoc: PreXmlDoc -> range: range -> range -val mkAttributeList: attrs:SynAttribute list -> range:range -> SynAttributeList list +val mkAttributeList: attrs: SynAttribute list -> range: range -> SynAttributeList list -val ConcatAttributesLists: attrsLists:SynAttributeList list -> SynAttribute list +val ConcatAttributesLists: attrsLists: SynAttributeList list -> SynAttribute list -val ( |Attributes| ): synAttributes:SynAttributeList list -> SynAttribute list +val (|Attributes|): synAttributes: SynAttributeList list -> SynAttribute list -val ( |TyparDecls| ): typarDecls: SynTyparDecls option -> SynTyparDecl list -val ( |TyparsAndConstraints| ): typarDecls: SynTyparDecls option -> SynTyparDecl list * SynTypeConstraint list -val ( |ValTyparDecls| ): valTyparDecls: SynValTyparDecls -> SynTyparDecl list * SynTypeConstraint list * bool +val (|TyparDecls|): typarDecls: SynTyparDecls option -> SynTyparDecl list +val (|TyparsAndConstraints|): typarDecls: SynTyparDecls option -> SynTyparDecl list * SynTypeConstraint list +val (|ValTyparDecls|): valTyparDecls: SynValTyparDecls -> SynTyparDecl list * SynTypeConstraint list * bool -val rangeOfNonNilAttrs: attrs:SynAttributes -> range +val rangeOfNonNilAttrs: attrs: SynAttributes -> range -val stripParenTypes: synType:SynType -> SynType +val stripParenTypes: synType: SynType -> SynType -val ( |StripParenTypes| ): synType:SynType -> SynType +val (|StripParenTypes|): synType: SynType -> SynType /// Operations related to the syntactic analysis of arguments of value, function and member definitions and signatures. module SynInfo = @@ -217,52 +235,70 @@ module SynInfo = val AttribsOfArgData: SynArgInfo -> SynAttribute list /// Infer the syntactic argument info for a single argument from a simple pattern. - val InferSynArgInfoFromSimplePat: attribs:SynAttributes -> p:SynSimplePat -> SynArgInfo + val InferSynArgInfoFromSimplePat: attribs: SynAttributes -> p: SynSimplePat -> SynArgInfo /// Infer the syntactic argument info for one or more arguments one or more simple patterns. - val InferSynArgInfoFromSimplePats: x:SynSimplePats -> SynArgInfo list + val InferSynArgInfoFromSimplePats: x: SynSimplePats -> SynArgInfo list /// Infer the syntactic argument info for one or more arguments a pattern. - val InferSynArgInfoFromPat: p:SynPat -> SynArgInfo list + val InferSynArgInfoFromPat: p: SynPat -> SynArgInfo list /// Make sure only a solitary unit argument has unit elimination - val AdjustArgsForUnitElimination: infosForArgs:SynArgInfo list list -> SynArgInfo list list + val AdjustArgsForUnitElimination: infosForArgs: SynArgInfo list list -> SynArgInfo list list /// Transform a property declared using '[static] member P = expr' to a method taking a "unit" argument. /// This is similar to IncorporateEmptyTupledArgForPropertyGetter, but applies to member definitions /// rather than member signatures. - val AdjustMemberArgs: memFlags:SynMemberKind -> infosForArgs:'a list list -> 'a list list + val AdjustMemberArgs: memFlags: SynMemberKind -> infosForArgs: 'a list list -> 'a list list - val InferSynReturnData: retInfo:SynReturnInfo option -> SynArgInfo + val InferSynReturnData: retInfo: SynReturnInfo option -> SynArgInfo val emptySynValData: SynValData /// Infer the syntactic information for a 'let' or 'member' definition, based on the argument pattern, /// any declared return information (e.g. .NET attributes on the return element), and the r.h.s. expression /// in the case of 'let' definitions. - val InferSynValData: memberFlagsOpt:SynMemberFlags option * pat:SynPat option * retInfo:SynReturnInfo option * origRhsExpr:SynExpr -> SynValData - -val mkSynBindingRhs: staticOptimizations:(SynStaticOptimizationConstraint list * SynExpr) list -> rhsExpr:SynExpr -> mRhs:range -> retInfo:SynReturnInfo option -> SynExpr * SynBindingReturnInfo option + val InferSynValData: + memberFlagsOpt: SynMemberFlags option * + pat: SynPat option * + retInfo: SynReturnInfo option * + origRhsExpr: SynExpr -> + SynValData + +val mkSynBindingRhs: + staticOptimizations: (SynStaticOptimizationConstraint list * SynExpr) list -> + rhsExpr: SynExpr -> + mRhs: range -> + retInfo: SynReturnInfo option -> + SynExpr * SynBindingReturnInfo option val mkSynBinding: - xmlDoc:PreXmlDoc * headPat:SynPat -> - vis:SynAccess option * isInline:bool * isMutable:bool * mBind:range * - spBind:DebugPointAtBinding * retInfo:SynReturnInfo option * origRhsExpr:SynExpr * mRhs:range * - staticOptimizations:(SynStaticOptimizationConstraint list * SynExpr) list * attrs:SynAttributes * memberFlagsOpt:SynMemberFlags option * - trivia: SynBindingTrivia - -> SynBinding + xmlDoc: PreXmlDoc * headPat: SynPat -> + vis: SynAccess option * + isInline: bool * + isMutable: bool * + mBind: range * + spBind: DebugPointAtBinding * + retInfo: SynReturnInfo option * + origRhsExpr: SynExpr * + mRhs: range * + staticOptimizations: (SynStaticOptimizationConstraint list * SynExpr) list * + attrs: SynAttributes * + memberFlagsOpt: SynMemberFlags option * + trivia: SynBindingTrivia -> + SynBinding -val NonVirtualMemberFlags: trivia:SynMemberFlagsTrivia -> k:SynMemberKind -> SynMemberFlags +val NonVirtualMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags -val CtorMemberFlags: trivia:SynMemberFlagsTrivia -> SynMemberFlags +val CtorMemberFlags: trivia: SynMemberFlagsTrivia -> SynMemberFlags -val ClassCtorMemberFlags: trivia:SynMemberFlagsTrivia -> SynMemberFlags +val ClassCtorMemberFlags: trivia: SynMemberFlagsTrivia -> SynMemberFlags -val OverrideMemberFlags: trivia:SynMemberFlagsTrivia -> k:SynMemberKind -> SynMemberFlags +val OverrideMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags -val AbstractMemberFlags: trivia:SynMemberFlagsTrivia -> k:SynMemberKind -> SynMemberFlags +val AbstractMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags -val StaticMemberFlags: trivia:SynMemberFlagsTrivia -> k:SynMemberKind -> SynMemberFlags +val StaticMemberFlags: trivia: SynMemberFlagsTrivia -> k: SynMemberKind -> SynMemberFlags val MemberSynMemberFlagsTrivia: mMember: range -> SynMemberFlagsTrivia @@ -282,9 +318,9 @@ val noInferredTypars: SynValTyparDecls val unionBindingAndMembers: bindings: SynBinding list -> members: SynMemberDefn list -> SynBinding list -val synExprContainsError: inpExpr:SynExpr -> bool +val synExprContainsError: inpExpr: SynExpr -> bool -val ( |ParsedHashDirectiveArguments| ) : ParsedHashDirectiveArgument list -> string list +val (|ParsedHashDirectiveArguments|): ParsedHashDirectiveArgument list -> string list /// 'e1 && e2' val (|SynAndAlso|_|): SynExpr -> (SynExpr * SynExpr) option @@ -301,4 +337,4 @@ val (|SynPipeRight2|_|): SynExpr -> (SynExpr * SynExpr * SynExpr) option /// 'e1 |||> e2' val (|SynPipeRight3|_|): SynExpr -> (SynExpr * SynExpr * SynExpr * SynExpr) option -val prependIdentInLongIdentWithTrivia: ident: SynIdent -> dotm: range -> lid: SynLongIdent -> SynLongIdent \ No newline at end of file +val prependIdentInLongIdentWithTrivia: ident: SynIdent -> dotm: range -> lid: SynLongIdent -> SynLongIdent diff --git a/src/fsharp/SyntaxTrivia.fsi b/src/fsharp/SyntaxTrivia.fsi index b86daf1052b..38875de8a5e 100644 --- a/src/fsharp/SyntaxTrivia.fsi +++ b/src/fsharp/SyntaxTrivia.fsi @@ -13,7 +13,7 @@ type IdentTrivia = /// The ident originally had a different notation and parenthesis /// Example: let (>=>) a b = ... /// The operator ident will be compiled into "op_GreaterEqualsGreater", while the original notation was ">=>" and had parenthesis - | OriginalNotationWithParen of leftParenRange: range * text:string * rightParenRange: range + | OriginalNotationWithParen of leftParenRange: range * text: string * rightParenRange: range /// The ident had parenthesis /// Example: let (|Odd|Even|) = ... /// The active pattern ident will be "|Odd|Even|", while originally there were parenthesis. @@ -21,11 +21,12 @@ type IdentTrivia = [] type ConditionalDirectiveTrivia = - | If of expr:IfDirectiveExpression * range:range - | Else of range:range - | EndIf of range:range + | If of expr: IfDirectiveExpression * range: range + | Else of range: range + | EndIf of range: range -type [] IfDirectiveExpression = +[] +type IfDirectiveExpression = | And of IfDirectiveExpression * IfDirectiveExpression | Or of IfDirectiveExpression * IfDirectiveExpression | Not of IfDirectiveExpression @@ -39,215 +40,175 @@ type CommentTrivia = /// Represents additional information for ParsedImplFileInput [] type ParsedImplFileInputTrivia = - { - /// Preprocessor directives of type #if, #else or #endif - ConditionalDirectives: ConditionalDirectiveTrivia list - /// Represent code comments found in the source file - CodeComments: CommentTrivia list - } + { /// Preprocessor directives of type #if, #else or #endif + ConditionalDirectives: ConditionalDirectiveTrivia list + /// Represent code comments found in the source file + CodeComments: CommentTrivia list } /// Represents additional information for ParsedSigFileInputTrivia [] type ParsedSigFileInputTrivia = - { - /// Preprocessor directives of type #if, #else or #endif - ConditionalDirectives: ConditionalDirectiveTrivia list - /// Represent code comments found in the source file - CodeComments: CommentTrivia list - } + { /// Preprocessor directives of type #if, #else or #endif + ConditionalDirectives: ConditionalDirectiveTrivia list + /// Represent code comments found in the source file + CodeComments: CommentTrivia list } /// Represents additional information for SynExpr.TryWith [] type SynExprTryWithTrivia = - { - /// The syntax range of the `try` keyword. - TryKeyword: range - /// The syntax range from the beginning of the `try` keyword till the end of the `with` keyword. - TryToWithRange: range - /// The syntax range of the `with` keyword - WithKeyword: range - /// The syntax range from the beginning of the `with` keyword till the end of the TryWith expression. - WithToEndRange: range - } + { /// The syntax range of the `try` keyword. + TryKeyword: range + /// The syntax range from the beginning of the `try` keyword till the end of the `with` keyword. + TryToWithRange: range + /// The syntax range of the `with` keyword + WithKeyword: range + /// The syntax range from the beginning of the `with` keyword till the end of the TryWith expression. + WithToEndRange: range } /// Represents additional information for SynExpr.TryFinally [] type SynExprTryFinallyTrivia = - { - /// The syntax range of the `try` keyword. - TryKeyword: range - /// The syntax range of the `finally` keyword - FinallyKeyword: range - } + { /// The syntax range of the `try` keyword. + TryKeyword: range + /// The syntax range of the `finally` keyword + FinallyKeyword: range } /// Represents additional information for SynExpr.IfThenElse [] type SynExprIfThenElseTrivia = - { - /// The syntax range of the `if` keyword. - IfKeyword: range - /// Indicates if the `elif` keyword was used - IsElif: bool - /// The syntax range of the `then` keyword. - ThenKeyword: range - /// The syntax range of the `else` keyword. - ElseKeyword: range option - /// The syntax range from the beginning of the `if` keyword till the end of the `then` keyword. - IfToThenRange: range - } + { /// The syntax range of the `if` keyword. + IfKeyword: range + /// Indicates if the `elif` keyword was used + IsElif: bool + /// The syntax range of the `then` keyword. + ThenKeyword: range + /// The syntax range of the `else` keyword. + ElseKeyword: range option + /// The syntax range from the beginning of the `if` keyword till the end of the `then` keyword. + IfToThenRange: range } /// Represents additional information for SynExpr.Lambda [] type SynExprLambdaTrivia = - { - /// The syntax range of the `->` token. - ArrowRange: range option - } + { /// The syntax range of the `->` token. + ArrowRange: range option } static member Zero: SynExprLambdaTrivia /// Represents additional information for SynExpr.LetOrUse [] type SynExprLetOrUseTrivia = - { - /// The syntax range of the `in` keyword. - InKeyword: range option - } + { /// The syntax range of the `in` keyword. + InKeyword: range option } /// Represents additional information for SynExpr.LetOrUseBang [] type SynExprLetOrUseBangTrivia = - { - /// The syntax range of the `=` token. - EqualsRange: range option - } + { /// The syntax range of the `=` token. + EqualsRange: range option } static member Zero: SynExprLetOrUseBangTrivia /// Represents additional information for SynExpr.Match [] type SynExprMatchTrivia = - { - /// The syntax range of the `match` keyword - MatchKeyword: range - /// The syntax range of the `with` keyword - WithKeyword: range - } + { /// The syntax range of the `match` keyword + MatchKeyword: range + /// The syntax range of the `with` keyword + WithKeyword: range } /// Represents additional information for SynExpr.MatchBang [] type SynExprMatchBangTrivia = - { - /// The syntax range of the `match!` keyword - MatchBangKeyword: range - /// The syntax range of the `with` keyword - WithKeyword: range - } + { /// The syntax range of the `match!` keyword + MatchBangKeyword: range + /// The syntax range of the `with` keyword + WithKeyword: range } /// Represents additional information for SynMatchClause [] type SynMatchClauseTrivia = - { - /// The syntax range of the `->` token. - ArrowRange: range option - /// The syntax range of the `|` token. - BarRange: range option - } + { /// The syntax range of the `->` token. + ArrowRange: range option + /// The syntax range of the `|` token. + BarRange: range option } static member Zero: SynMatchClauseTrivia -/// Represents additional information for +/// Represents additional information for [] type SynEnumCaseTrivia = - { - /// The syntax range of the `|` token. - BarRange: range option - /// The syntax range of the `=` token. - EqualsRange: range - } + { /// The syntax range of the `|` token. + BarRange: range option + /// The syntax range of the `=` token. + EqualsRange: range } /// Represents additional information for SynUnionCase [] type SynUnionCaseTrivia = - { - /// The syntax range of the `|` token. - BarRange: range option - } + { /// The syntax range of the `|` token. + BarRange: range option } /// Represents additional information for SynPat.Or [] type SynPatOrTrivia = - { - /// The syntax range of the `|` token. - BarRange: range - } + { /// The syntax range of the `|` token. + BarRange: range } /// Represents additional information for SynTypeDefn [] type SynTypeDefnTrivia = - { - /// The syntax range of the `type` keyword. - TypeKeyword: range option - /// The syntax range of the `=` token. - EqualsRange: range option - /// The syntax range of the `with` keyword - WithKeyword: range option - } + { /// The syntax range of the `type` keyword. + TypeKeyword: range option + /// The syntax range of the `=` token. + EqualsRange: range option + /// The syntax range of the `with` keyword + WithKeyword: range option } static member Zero: SynTypeDefnTrivia /// Represents additional information for SynBinding [] type SynBindingTrivia = - { - /// The syntax range of the `let` keyword. - LetKeyword: range option - /// The syntax range of the `=` token. - EqualsRange: range option - } + { /// The syntax range of the `let` keyword. + LetKeyword: range option + /// The syntax range of the `=` token. + EqualsRange: range option } static member Zero: SynBindingTrivia /// Represents additional information for SynMemberFlags [] type SynMemberFlagsTrivia = - { - /// The syntax range of the `member` keyword - MemberRange: range option - /// The syntax range of the `override` keyword - OverrideRange: range option - /// The syntax range of the `abstract` keyword - AbstractRange: range option - /// The syntax range of the `member` keyword - StaticRange: range option - /// The syntax range of the `default` keyword - DefaultRange: range option - } + { /// The syntax range of the `member` keyword + MemberRange: range option + /// The syntax range of the `override` keyword + OverrideRange: range option + /// The syntax range of the `abstract` keyword + AbstractRange: range option + /// The syntax range of the `member` keyword + StaticRange: range option + /// The syntax range of the `default` keyword + DefaultRange: range option } static member Zero: SynMemberFlagsTrivia /// Represents additional information for SynExprAndBang [] type SynExprAndBangTrivia = - { - /// The syntax range of the `=` token. - EqualsRange: range - /// The syntax range of the `in` keyword. - InKeyword: range option - } + { /// The syntax range of the `=` token. + EqualsRange: range + /// The syntax range of the `in` keyword. + InKeyword: range option } /// Represents additional information for SynModuleDecl.NestedModule [] type SynModuleDeclNestedModuleTrivia = - { - /// The syntax range of the `module` keyword - ModuleKeyword: range option - /// The syntax range of the `=` token. - EqualsRange: range option - } + { /// The syntax range of the `module` keyword + ModuleKeyword: range option + /// The syntax range of the `=` token. + EqualsRange: range option } static member Zero: SynModuleDeclNestedModuleTrivia /// Represents additional information for SynModuleSigDecl.NestedModule [] type SynModuleSigDeclNestedModuleTrivia = - { - /// The syntax range of the `module` keyword - ModuleKeyword: range option - /// The syntax range of the `=` token. - EqualsRange: range option - } + { /// The syntax range of the `module` keyword + ModuleKeyword: range option + /// The syntax range of the `=` token. + EqualsRange: range option } static member Zero: SynModuleSigDeclNestedModuleTrivia diff --git a/src/fsharp/TextLayoutRender.fsi b/src/fsharp/TextLayoutRender.fsi index 4d8b5415e04..59fd4f60266 100644 --- a/src/fsharp/TextLayoutRender.fsi +++ b/src/fsharp/TextLayoutRender.fsi @@ -13,8 +13,8 @@ type public NavigableTaggedText = member Range: range inherit TaggedText -/// Render a Layout yielding an 'a using a 'b (hidden state) type -type internal LayoutRenderer<'a,'b> = +/// Render a Layout yielding an 'a using a 'b (hidden state) type +type internal LayoutRenderer<'a, 'b> = abstract Start: unit -> 'b abstract AddText: 'b -> TaggedText -> 'b abstract AddBreak: 'b -> int -> 'b @@ -24,9 +24,9 @@ type internal LayoutRenderer<'a,'b> = type internal NoState = NoState type internal NoResult = NoResult -module internal LayoutRender = +module internal LayoutRender = - val internal toArray: Layout -> TaggedText[] + val internal toArray: Layout -> TaggedText [] val internal emitL: (TaggedText -> unit) -> Layout -> unit @@ -38,17 +38,17 @@ module internal LayoutRender = val internal bufferL: StringBuilder -> Layout -> unit - /// Run a render on a Layout - val internal renderL: LayoutRenderer<'b,'a> -> Layout -> 'b + /// Run a render on a Layout + val internal renderL: LayoutRenderer<'b, 'a> -> Layout -> 'b - /// Render layout to string - val internal stringR: LayoutRenderer + /// Render layout to string + val internal stringR: LayoutRenderer /// Render layout to channel - val internal channelR: TextWriter -> LayoutRenderer + val internal channelR: TextWriter -> LayoutRenderer /// Render layout to StringBuilder - val internal bufferR: StringBuilder -> LayoutRenderer + val internal bufferR: StringBuilder -> LayoutRenderer /// Render layout to collector of TaggedText val internal taggedTextListR: collector: (TaggedText -> unit) -> LayoutRenderer @@ -114,4 +114,3 @@ module internal RightL = val rightAngle: Layout val rightBracketAngle: Layout val rightBracketBar: Layout - diff --git a/src/fsharp/TypeRelations.fsi b/src/fsharp/TypeRelations.fsi index 2138e0e57f8..a33eb284c35 100644 --- a/src/fsharp/TypeRelations.fsi +++ b/src/fsharp/TypeRelations.fsi @@ -14,44 +14,69 @@ type CanCoerce = | NoCoerce /// Implements a :> b without coercion based on finalized (no type variable) types -val TypeDefinitelySubsumesTypeNoCoercion: ndeep:int -> g:TcGlobals -> amap:ImportMap -> m:range -> ty1:TType -> ty2:TType -> bool +val TypeDefinitelySubsumesTypeNoCoercion: + ndeep: int -> g: TcGlobals -> amap: ImportMap -> m: range -> ty1: TType -> ty2: TType -> bool /// The feasible equivalence relation. Part of the language spec. -val TypesFeasiblyEquivalent: stripMeasures:bool -> ndeep:int -> g:TcGlobals -> amap:'a -> m:range -> ty1:TType -> ty2:TType -> bool +val TypesFeasiblyEquivalent: + stripMeasures: bool -> ndeep: int -> g: TcGlobals -> amap: 'a -> m: range -> ty1: TType -> ty2: TType -> bool /// The feasible equivalence relation. Part of the language spec. -val TypesFeasiblyEquiv: ndeep:int -> g:TcGlobals -> amap:'a -> m:range -> ty1:TType -> ty2:TType -> bool +val TypesFeasiblyEquiv: ndeep: int -> g: TcGlobals -> amap: 'a -> m: range -> ty1: TType -> ty2: TType -> bool /// The feasible equivalence relation after stripping Measures. -val TypesFeasiblyEquivStripMeasures: g:TcGlobals -> amap:'a -> m:range -> ty1:TType -> ty2:TType -> bool +val TypesFeasiblyEquivStripMeasures: g: TcGlobals -> amap: 'a -> m: range -> ty1: TType -> ty2: TType -> bool /// The feasible coercion relation. Part of the language spec. -val TypeFeasiblySubsumesType: ndeep:int -> g:TcGlobals -> amap:ImportMap -> m:range -> ty1:TType -> canCoerce:CanCoerce -> ty2:TType -> bool +val TypeFeasiblySubsumesType: + ndeep: int -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + ty1: TType -> + canCoerce: CanCoerce -> + ty2: TType -> + bool /// Choose solutions for Expr.TyChoose type "hidden" variables introduced /// by letrec nodes. Also used by the pattern match compiler to choose type /// variables when compiling patterns at generalized bindings. /// e.g. let ([], x) = ([], []) /// Here x gets a generalized type "list<'T>". -val ChooseTyparSolutionAndRange: g:TcGlobals -> amap:ImportMap -> tp:Typar -> TType * range +val ChooseTyparSolutionAndRange: g: TcGlobals -> amap: ImportMap -> tp: Typar -> TType * range -val ChooseTyparSolution: g:TcGlobals -> amap:ImportMap -> tp:Typar -> TType +val ChooseTyparSolution: g: TcGlobals -> amap: ImportMap -> tp: Typar -> TType -val IterativelySubstituteTyparSolutions: g:TcGlobals -> tps:Typars -> solutions:TTypes -> TypeInst +val IterativelySubstituteTyparSolutions: g: TcGlobals -> tps: Typars -> solutions: TTypes -> TypeInst -val ChooseTyparSolutionsForFreeChoiceTypars: g:TcGlobals -> amap:ImportMap -> e:Expr -> Expr +val ChooseTyparSolutionsForFreeChoiceTypars: g: TcGlobals -> amap: ImportMap -> e: Expr -> Expr /// Break apart lambdas. Needs ChooseTyparSolutionsForFreeChoiceTypars because it's used in /// PostTypeCheckSemanticChecks before we've eliminated these nodes. -val tryDestTopLambda: g:TcGlobals -> amap:ImportMap -> ValReprInfo -> e:Expr * ty:TType -> (Typars * Val option * Val option * Val list list * Expr * TType) option - -val destTopLambda: g:TcGlobals -> amap:ImportMap -> topValInfo:ValReprInfo -> e:Expr * ty:TType -> Typars * Val option * Val option * Val list list * Expr * TType - -/// Do AdjustArityOfLambdaBody for a series of iterated lambdas, producing one method. -/// The required iterated function arity (List.length topValInfo) must be identical -/// to the iterated function arity of the input lambda (List.length vsl) -val IteratedAdjustArityOfLambda: g:TcGlobals -> amap:ImportMap -> topValInfo:ValReprInfo -> e:Expr -> Typars * Val option * Val option * Val list list * Expr * TType +val tryDestTopLambda: + g: TcGlobals -> + amap: ImportMap -> + ValReprInfo -> + e: Expr * ty: TType -> + (Typars * Val option * Val option * Val list list * Expr * TType) option + +val destTopLambda: + g: TcGlobals -> + amap: ImportMap -> + topValInfo: ValReprInfo -> + e: Expr * ty: TType -> + Typars * Val option * Val option * Val list list * Expr * TType + +/// Do AdjustArityOfLambdaBody for a series of iterated lambdas, producing one method. +/// The required iterated function arity (List.length topValInfo) must be identical +/// to the iterated function arity of the input lambda (List.length vsl) +val IteratedAdjustArityOfLambda: + g: TcGlobals -> + amap: ImportMap -> + topValInfo: ValReprInfo -> + e: Expr -> + Typars * Val option * Val option * Val list list * Expr * TType /// "Single Feasible Type" inference /// Look for the unique supertype of ty2 for which ty2 :> ty1 might feasibly hold -val FindUniqueFeasibleSupertype: g:TcGlobals -> amap:ImportMap -> m:range -> ty1:TType -> ty2:TType -> TType option +val FindUniqueFeasibleSupertype: g: TcGlobals -> amap: ImportMap -> m: range -> ty1: TType -> ty2: TType -> TType option diff --git a/src/fsharp/TypedTreeBasics.fsi b/src/fsharp/TypedTreeBasics.fsi index fd9fe751e9e..546fdb75af6 100644 --- a/src/fsharp/TypedTreeBasics.fsi +++ b/src/fsharp/TypedTreeBasics.fsi @@ -2,7 +2,7 @@ //------------------------------------------------------------------------- // Defines the typed abstract syntax trees used throughout the F# compiler. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- module internal FSharp.Compiler.TypedTreeBasics @@ -12,9 +12,9 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -val getNameOfScopeRef: sref:ILScopeRef -> string +val getNameOfScopeRef: sref: ILScopeRef -> string -/// Metadata on values (names of arguments etc. +/// Metadata on values (names of arguments etc. module ValReprInfo = val unnamedTopArg1: ArgReprInfo @@ -29,179 +29,184 @@ module ValReprInfo = val emptyValData: ValReprInfo - val InferTyparInfo: tps:Typar list -> TyparReprInfo list + val InferTyparInfo: tps: Typar list -> TyparReprInfo list - val InferArgReprInfo: v:Val -> ArgReprInfo + val InferArgReprInfo: v: Val -> ArgReprInfo - val InferArgReprInfos: vs:Val list list -> ValReprInfo + val InferArgReprInfos: vs: Val list list -> ValReprInfo val HasNoArgs: ValReprInfo -> bool -val typeOfVal: v:Val -> TType +val typeOfVal: v: Val -> TType -val typesOfVals: v:Val list -> TType list +val typesOfVals: v: Val list -> TType list -val nameOfVal: v:Val -> string +val nameOfVal: v: Val -> string -val arityOfVal: v:Val -> ValReprInfo +val arityOfVal: v: Val -> ValReprInfo val tupInfoRef: TupInfo val tupInfoStruct: TupInfo -val mkTupInfo: b:bool -> TupInfo +val mkTupInfo: b: bool -> TupInfo val structnessDefault: bool -val mkRawRefTupleTy: tys:TTypes -> TType +val mkRawRefTupleTy: tys: TTypes -> TType -val mkRawStructTupleTy: tys:TTypes -> TType +val mkRawStructTupleTy: tys: TTypes -> TType -val mapTImplFile: f:(ModuleOrNamespaceExprWithSig -> ModuleOrNamespaceExprWithSig) -> TypedImplFile -> TypedImplFile +val mapTImplFile: f: (ModuleOrNamespaceExprWithSig -> ModuleOrNamespaceExprWithSig) -> TypedImplFile -> TypedImplFile -val mapAccImplFile: f:('a -> ModuleOrNamespaceExprWithSig -> ModuleOrNamespaceExprWithSig * 'b) -> z:'a -> TypedImplFile -> TypedImplFile * 'b +val mapAccImplFile: + f: ('a -> ModuleOrNamespaceExprWithSig -> ModuleOrNamespaceExprWithSig * 'b) -> + z: 'a -> + TypedImplFile -> + TypedImplFile * 'b -val foldTImplFile: f:('a -> ModuleOrNamespaceExprWithSig -> 'b) -> z:'a -> TypedImplFile -> 'b +val foldTImplFile: f: ('a -> ModuleOrNamespaceExprWithSig -> 'b) -> z: 'a -> TypedImplFile -> 'b -val typarEq: lv1:Typar -> lv2:Typar -> bool +val typarEq: lv1: Typar -> lv2: Typar -> bool /// Equality on type variables, implemented as reference equality. This should be equivalent to using typarEq. -val typarRefEq: tp1:Typar -> tp2:Typar -> bool +val typarRefEq: tp1: Typar -> tp2: Typar -> bool /// Equality on value specs, implemented as reference equality -val valEq: lv1:Val -> lv2:Val -> bool +val valEq: lv1: Val -> lv2: Val -> bool /// Equality on CCU references, implemented as reference equality except when unresolved -val ccuEq: mv1:CcuThunk -> mv2:CcuThunk -> bool +val ccuEq: mv1: CcuThunk -> mv2: CcuThunk -> bool /// For dereferencing in the middle of a pattern -val ( |ValDeref| ): vr:ValRef -> Val +val (|ValDeref|): vr: ValRef -> Val -val mkRecdFieldRef: tcref:TyconRef -> f:string -> RecdFieldRef +val mkRecdFieldRef: tcref: TyconRef -> f: string -> RecdFieldRef -val mkUnionCaseRef: tcref:TyconRef -> c:string -> UnionCaseRef +val mkUnionCaseRef: tcref: TyconRef -> c: string -> UnionCaseRef -val ERefLocal: x:NonNullSlot -> EntityRef +val ERefLocal: x: NonNullSlot -> EntityRef -val ERefNonLocal: x:NonLocalEntityRef -> EntityRef +val ERefNonLocal: x: NonLocalEntityRef -> EntityRef -val ERefNonLocalPreResolved: x:NonNullSlot -> xref:NonLocalEntityRef -> EntityRef +val ERefNonLocalPreResolved: x: NonNullSlot -> xref: NonLocalEntityRef -> EntityRef -val ( |ERefLocal|ERefNonLocal| ): x:EntityRef -> Choice,NonLocalEntityRef> +val (|ERefLocal|ERefNonLocal|): x: EntityRef -> Choice, NonLocalEntityRef> -val mkLocalTyconRef: x:NonNullSlot -> EntityRef +val mkLocalTyconRef: x: NonNullSlot -> EntityRef -val mkNonLocalEntityRef: ccu:CcuThunk -> mp:string [] -> NonLocalEntityRef +val mkNonLocalEntityRef: ccu: CcuThunk -> mp: string [] -> NonLocalEntityRef -val mkNestedNonLocalEntityRef: nleref:NonLocalEntityRef -> id:string -> NonLocalEntityRef +val mkNestedNonLocalEntityRef: nleref: NonLocalEntityRef -> id: string -> NonLocalEntityRef -val mkNonLocalTyconRef: nleref:NonLocalEntityRef -> id:string -> EntityRef +val mkNonLocalTyconRef: nleref: NonLocalEntityRef -> id: string -> EntityRef -val mkNonLocalTyconRefPreResolved: x:NonNullSlot -> nleref:NonLocalEntityRef -> id:string -> EntityRef +val mkNonLocalTyconRefPreResolved: x: NonNullSlot -> nleref: NonLocalEntityRef -> id: string -> EntityRef type EntityRef with - member NestedTyconRef: x:Entity -> EntityRef - member RecdFieldRefInNestedTycon: tycon:Entity -> id:Ident -> RecdFieldRef + member NestedTyconRef: x: Entity -> EntityRef + member RecdFieldRefInNestedTycon: tycon: Entity -> id: Ident -> RecdFieldRef /// Make a reference to a union case for type in a module or namespace -val mkModuleUnionCaseRef: modref:ModuleOrNamespaceRef -> tycon:Entity -> uc:UnionCase -> UnionCaseRef val VRefLocal: x:NonNullSlot -> ValRef +val mkModuleUnionCaseRef: modref: ModuleOrNamespaceRef -> tycon: Entity -> uc: UnionCase -> UnionCaseRef +val VRefLocal: x: NonNullSlot -> ValRef -val VRefNonLocal: x:NonLocalValOrMemberRef -> ValRef +val VRefNonLocal: x: NonLocalValOrMemberRef -> ValRef -val VRefNonLocalPreResolved: x:NonNullSlot -> xref:NonLocalValOrMemberRef -> ValRef +val VRefNonLocalPreResolved: x: NonNullSlot -> xref: NonLocalValOrMemberRef -> ValRef -val ( |VRefLocal|VRefNonLocal| ): x:ValRef -> Choice,NonLocalValOrMemberRef> +val (|VRefLocal|VRefNonLocal|): x: ValRef -> Choice, NonLocalValOrMemberRef> -val mkNonLocalValRef: mp:NonLocalEntityRef -> id:ValLinkageFullKey -> ValRef +val mkNonLocalValRef: mp: NonLocalEntityRef -> id: ValLinkageFullKey -> ValRef -val mkNonLocalValRefPreResolved: x:NonNullSlot -> mp:NonLocalEntityRef -> id:ValLinkageFullKey -> ValRef +val mkNonLocalValRefPreResolved: x: NonNullSlot -> mp: NonLocalEntityRef -> id: ValLinkageFullKey -> ValRef -val ccuOfValRef: vref:ValRef -> CcuThunk option +val ccuOfValRef: vref: ValRef -> CcuThunk option -val ccuOfTyconRef: eref:EntityRef -> CcuThunk option +val ccuOfTyconRef: eref: EntityRef -> CcuThunk option -val mkTyparTy: tp:Typar -> TType +val mkTyparTy: tp: Typar -> TType -val copyTypar: tp:Typar -> Typar +val copyTypar: tp: Typar -> Typar -val copyTypars: tps:Typar list -> Typar list +val copyTypars: tps: Typar list -> Typar list -val tryShortcutSolvedUnitPar: canShortcut:bool -> r:Typar -> Measure +val tryShortcutSolvedUnitPar: canShortcut: bool -> r: Typar -> Measure -val stripUnitEqnsAux: canShortcut:bool -> unt:Measure -> Measure +val stripUnitEqnsAux: canShortcut: bool -> unt: Measure -> Measure -val stripTyparEqnsAux: canShortcut:bool -> ty:TType -> TType +val stripTyparEqnsAux: canShortcut: bool -> ty: TType -> TType -val stripTyparEqns: ty:TType -> TType +val stripTyparEqns: ty: TType -> TType -val stripUnitEqns: unt:Measure -> Measure +val stripUnitEqns: unt: Measure -> Measure -val mkLocalValRef: v:Val -> ValRef +val mkLocalValRef: v: Val -> ValRef -val mkLocalModRef: v:ModuleOrNamespace -> EntityRef +val mkLocalModRef: v: ModuleOrNamespace -> EntityRef -val mkLocalEntityRef: v:Entity -> EntityRef +val mkLocalEntityRef: v: Entity -> EntityRef -val mkNonLocalCcuRootEntityRef: ccu:CcuThunk -> x:Entity -> EntityRef +val mkNonLocalCcuRootEntityRef: ccu: CcuThunk -> x: Entity -> EntityRef -val mkNestedValRef:cref:EntityRef -> v:Val -> ValRef +val mkNestedValRef: cref: EntityRef -> v: Val -> ValRef /// From Ref_private to Ref_nonlocal when exporting data. -val rescopePubPathToParent:viewedCcu:CcuThunk -> PublicPath -> NonLocalEntityRef +val rescopePubPathToParent: viewedCcu: CcuThunk -> PublicPath -> NonLocalEntityRef /// From Ref_private to Ref_nonlocal when exporting data. -val rescopePubPath: viewedCcu:CcuThunk -> PublicPath -> NonLocalEntityRef +val rescopePubPath: viewedCcu: CcuThunk -> PublicPath -> NonLocalEntityRef -val valRefInThisAssembly: compilingFslib:bool -> x:ValRef -> bool +val valRefInThisAssembly: compilingFslib: bool -> x: ValRef -> bool -val tyconRefUsesLocalXmlDoc: compilingFslib:bool -> x:TyconRef -> bool +val tyconRefUsesLocalXmlDoc: compilingFslib: bool -> x: TyconRef -> bool -val entityRefInThisAssembly: compilingFslib:bool -> x:EntityRef -> bool +val entityRefInThisAssembly: compilingFslib: bool -> x: EntityRef -> bool -val arrayPathEq: y1:string [] -> y2:string [] -> bool +val arrayPathEq: y1: string [] -> y2: string [] -> bool -val nonLocalRefEq:NonLocalEntityRef -> NonLocalEntityRef -> bool +val nonLocalRefEq: NonLocalEntityRef -> NonLocalEntityRef -> bool /// This predicate tests if non-local resolution paths are definitely known to resolve -/// to different entities. All references with different named paths always resolve to -/// different entities. Two references with the same named paths may resolve to the same +/// to different entities. All references with different named paths always resolve to +/// different entities. Two references with the same named paths may resolve to the same /// entities even if they reference through different CCUs, because one reference /// may be forwarded to another via a .NET TypeForwarder. val nonLocalRefDefinitelyNotEq: NonLocalEntityRef -> NonLocalEntityRef -> bool val pubPathEq: PublicPath -> PublicPath -> bool -val fslibRefEq: nlr1:NonLocalEntityRef -> PublicPath -> bool +val fslibRefEq: nlr1: NonLocalEntityRef -> PublicPath -> bool /// Compare two EntityRef's for equality when compiling fslib (FSharp.Core.dll) -val fslibEntityRefEq: fslibCcu:CcuThunk -> eref1:EntityRef -> eref2:EntityRef -> bool +val fslibEntityRefEq: fslibCcu: CcuThunk -> eref1: EntityRef -> eref2: EntityRef -> bool // Compare two ValRef's for equality when compiling fslib (FSharp.Core.dll) -val fslibValRefEq: fslibCcu:CcuThunk -> vref1:ValRef -> vref2:ValRef -> bool +val fslibValRefEq: fslibCcu: CcuThunk -> vref1: ValRef -> vref2: ValRef -> bool /// Primitive routine to compare two EntityRef's for equality /// This takes into account the possibility that they may have type forwarders -val primEntityRefEq: compilingFslib:bool -> fslibCcu:CcuThunk -> x:EntityRef -> y:EntityRef -> bool +val primEntityRefEq: compilingFslib: bool -> fslibCcu: CcuThunk -> x: EntityRef -> y: EntityRef -> bool /// Primitive routine to compare two UnionCaseRef's for equality -val primUnionCaseRefEq: compilingFslib:bool -> fslibCcu:CcuThunk -> UnionCaseRef -> UnionCaseRef -> bool +val primUnionCaseRefEq: compilingFslib: bool -> fslibCcu: CcuThunk -> UnionCaseRef -> UnionCaseRef -> bool /// Primitive routine to compare two ValRef's for equality. On the whole value identity is not particularly /// significant in F#. However it is significant for -/// (a) Active Patterns -/// (b) detecting uses of "special known values" from FSharp.Core.dll, such as 'seq' -/// and quotation splicing +/// (a) Active Patterns +/// (b) detecting uses of "special known values" from FSharp.Core.dll, such as 'seq' +/// and quotation splicing /// /// Note this routine doesn't take type forwarding into account -val primValRefEq: compilingFslib:bool -> fslibCcu:CcuThunk -> x:ValRef -> y:ValRef -> bool +val primValRefEq: compilingFslib: bool -> fslibCcu: CcuThunk -> x: ValRef -> y: ValRef -> bool -val fullCompPathOfModuleOrNamespace: m:ModuleOrNamespace -> CompilationPath +val fullCompPathOfModuleOrNamespace: m: ModuleOrNamespace -> CompilationPath val inline canAccessCompPathFrom: CompilationPath -> CompilationPath -> bool -val canAccessFromOneOf: cpaths:CompilationPath list -> cpathTest:CompilationPath -> bool +val canAccessFromOneOf: cpaths: CompilationPath list -> cpathTest: CompilationPath -> bool -val canAccessFrom: Accessibility -> cpath:CompilationPath -> bool +val canAccessFrom: Accessibility -> cpath: CompilationPath -> bool val canAccessFromEverywhere: Accessibility -> bool @@ -210,13 +215,13 @@ val canAccessFromSomewhere: Accessibility -> bool val isLessAccessible: Accessibility -> Accessibility -> bool /// Given (newPath, oldPath) replace oldPath by newPath in the TAccess. -val accessSubstPaths: newPath:CompilationPath * oldPath:CompilationPath -> Accessibility -> Accessibility +val accessSubstPaths: newPath: CompilationPath * oldPath: CompilationPath -> Accessibility -> Accessibility -val compPathOfCcu: ccu:CcuThunk -> CompilationPath +val compPathOfCcu: ccu: CcuThunk -> CompilationPath val taccessPublic: Accessibility -val taccessPrivate: accessPath:CompilationPath -> Accessibility +val taccessPrivate: accessPath: CompilationPath -> Accessibility val compPathInternal: CompilationPath @@ -227,4 +232,3 @@ val combineAccess: Accessibility -> Accessibility -> Accessibility exception Duplicate of string * string * range exception NameClash of string * string * string * range * string * string * range - diff --git a/src/fsharp/TypedTreeOps.fsi b/src/fsharp/TypedTreeOps.fsi index c505e865c83..3d95400413d 100755 --- a/src/fsharp/TypedTreeOps.fsi +++ b/src/fsharp/TypedTreeOps.fsi @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. /// Defines derived expression manipulation and construction functions. -module internal FSharp.Compiler.TypedTreeOps +module internal FSharp.Compiler.TypedTreeOps open System.Collections.Generic open System.Collections.Immutable open Internal.Utilities.Collections open Internal.Utilities.Library open Internal.Utilities.Rational -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.ErrorLogger open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.Syntax @@ -17,12 +17,15 @@ open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree open FSharp.Compiler.TcGlobals -type Erasure = EraseAll | EraseMeasures | EraseNone +type Erasure = + | EraseAll + | EraseMeasures + | EraseNone /// Check the equivalence of two types up to an erasure flag val typeEquivAux: Erasure -> TcGlobals -> TType -> TType -> bool -/// Check the equivalence of two types +/// Check the equivalence of two types val typeEquiv: TcGlobals -> TType -> TType -> bool /// Check the equivalence of two units-of-measure @@ -40,7 +43,7 @@ val mkFunTy: TcGlobals -> TType -> TType -> TType /// Build a type-forall anonymous generic type if necessary val mkForallTyIfNeeded: Typars -> TType -> TType -val ( +-> ): Typars -> TType -> TType +val (+->): Typars -> TType -> TType /// Build a curried function type val mkIteratedFunTy: TcGlobals -> TTypes -> TType -> TType @@ -48,14 +51,14 @@ val mkIteratedFunTy: TcGlobals -> TTypes -> TType -> TType /// Get the natural type of a single argument amongst a set of curried arguments val typeOfLambdaArg: range -> Val list -> TType -/// Get the type corresponding to a lambda +/// Get the type corresponding to a lambda val mkLambdaTy: TcGlobals -> Typars -> TTypes -> TType -> TType -/// Get the curried type corresponding to a lambda +/// Get the curried type corresponding to a lambda val mkMultiLambdaTy: TcGlobals -> range -> Val list -> TType -> TType /// Module publication, used while compiling fslib. -val ensureCcuHasModuleOrNamespaceAtPath: CcuThunk -> Ident list -> CompilationPath -> XmlDoc -> unit +val ensureCcuHasModuleOrNamespaceAtPath: CcuThunk -> Ident list -> CompilationPath -> XmlDoc -> unit /// Ignore 'Expr.Link' in an expression val stripExpr: Expr -> Expr @@ -64,10 +67,10 @@ val stripExpr: Expr -> Expr val stripDebugPoints: Expr -> Expr /// Match any 'Expr.Link' and 'Expr.DebugPoint' in an expression, providing the inner expression and a function to rebuild debug points -val (|DebugPoints|): Expr -> Expr * (Expr -> Expr) +val (|DebugPoints|): Expr -> Expr * (Expr -> Expr) /// Get the values for a set of bindings -val valsOfBinds: Bindings -> Vals +val valsOfBinds: Bindings -> Vals /// Look for a use of an F# value, possibly including application of a generic thing to a set of type arguments val (|ExprValWithPossibleTypeInst|_|): Expr -> (ValRef * ValUseFlag * TType list * range) option @@ -103,10 +106,10 @@ val mkCond: DebugPointAtBinding -> range -> TType -> Expr -> Expr -> Expr -> Exp val mkNonNullCond: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr /// Build an if-then statement -val mkIfThen: TcGlobals -> range -> Expr -> Expr -> Expr +val mkIfThen: TcGlobals -> range -> Expr -> Expr -> Expr /// Build an expression corresponding to the use of a value -/// Note: try to use exprForValRef or the expression returned from mkLocal instead of this. +/// Note: try to use exprForValRef or the expression returned from mkLocal instead of this. val exprForVal: range -> Val -> Expr /// Build an expression corresponding to the use of a reference to a value @@ -121,9 +124,9 @@ val mkCompGenLocal: range -> string -> TType -> Val * Expr /// Make a new mutable compiler-generated local value and build an expression to reference it val mkMutableCompGenLocal: range -> string -> TType -> Val * Expr -/// Make a new mutable compiler-generated local value, 'let' bind it to an expression +/// Make a new mutable compiler-generated local value, 'let' bind it to an expression /// 'invisibly' (no sequence point etc.), and build an expression to reference it -val mkCompGenLocalAndInvisibleBind: TcGlobals -> string -> range -> Expr -> Val * Expr * Binding +val mkCompGenLocalAndInvisibleBind: TcGlobals -> string -> range -> Expr -> Val * Expr * Binding /// Build a lambda expression taking multiple values val mkMultiLambda: range -> Val list -> Expr * TType -> Expr @@ -131,7 +134,7 @@ val mkMultiLambda: range -> Val list -> Expr * TType -> Expr /// Rebuild a lambda during an expression tree traversal val rebuildLambda: range -> Val option -> Val option -> Val list -> Expr * TType -> Expr -/// Build a lambda expression taking a single value +/// Build a lambda expression taking a single value val mkLambda: range -> Val -> Expr * TType -> Expr /// Build a generic lambda expression (type abstraction) @@ -159,10 +162,22 @@ val mkMemberLambdas: TcGlobals -> range -> Typars -> Val option -> Val option -> val mkWhile: TcGlobals -> DebugPointAtWhile * SpecialWhileLoopMarker * Expr * Expr * range -> Expr /// Build a 'for' loop expression -val mkIntegerForLoop: TcGlobals -> DebugPointAtFor * DebugPointAtInOrTo * Val * Expr * ForLoopStyle * Expr * Expr * range -> Expr +val mkIntegerForLoop: + TcGlobals -> DebugPointAtFor * DebugPointAtInOrTo * Val * Expr * ForLoopStyle * Expr * Expr * range -> Expr /// Build a 'try/with' expression -val mkTryWith: TcGlobals -> Expr * (* filter val *) Val * (* filter expr *) Expr * (* handler val *) Val * (* handler expr *) Expr * range * TType * DebugPointAtTry * DebugPointAtWith -> Expr +val mkTryWith: + TcGlobals -> + Expr (* filter val *) * + Val (* filter expr *) * + Expr (* handler val *) * + Val (* handler expr *) * + Expr * + range * + TType * + DebugPointAtTry * + DebugPointAtWith -> + Expr /// Build a 'try/finally' expression val mkTryFinally: TcGlobals -> Expr * Expr * range * TType * DebugPointAtTry * DebugPointAtFinally -> Expr @@ -183,7 +198,8 @@ val mkLetsFromBindings: range -> Bindings -> Expr -> Expr val mkLet: DebugPointAtBinding -> range -> Val -> Expr -> Expr -> Expr /// Make a binding that binds a function value to a lambda taking multiple arguments -val mkMultiLambdaBind: TcGlobals -> Val -> DebugPointAtBinding -> range -> Typars -> Val list list -> Expr * TType -> Binding +val mkMultiLambdaBind: + TcGlobals -> Val -> DebugPointAtBinding -> range -> Typars -> Val list list -> Expr * TType -> Binding // Compiler generated bindings may involve a user variable. // Compiler generated bindings may give rise to a sequence point if they are part of @@ -216,12 +232,12 @@ val mkInvisibleBinds: Vals -> Exprs -> Bindings /// Make a let-rec expression that locally binds values to expressions where self-reference back to the values is possible. val mkLetRecBinds: range -> Bindings -> Expr -> Expr - + /// TypeScheme (generalizedTypars, tauTy) /// -/// generalizedTypars -- the truly generalized type parameters +/// 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 TypeScheme = TypeScheme of Typars * TType +type TypeScheme = TypeScheme of Typars * TType /// Make the right-hand side of a generalized binding, incorporating the generalized generic parameters from the type /// scheme into the right-hand side as type generalizations. @@ -236,7 +252,7 @@ val mkLazyAnd: TcGlobals -> range -> Expr -> Expr -> Expr /// Make the expression corresponding to 'expr1 || expr2' val mkLazyOr: TcGlobals -> range -> Expr -> Expr -> Expr -/// Make a byref type +/// Make a byref type val mkByrefTy: TcGlobals -> TType -> TType /// Make a byref type with a in/out kind inference parameter @@ -265,7 +281,7 @@ val mkReraise: range -> TType -> Expr /// Make an expression that re-raises an exception via a library call val mkReraiseLibCall: TcGlobals -> TType -> range -> Expr - + /// Make an expression that gets an item from a tuple val mkTupleFieldGet: TcGlobals -> TupInfo * Expr * TypeInst * int * range -> Expr @@ -276,19 +292,19 @@ val mkAnonRecdFieldGet: TcGlobals -> AnonRecdTypeInfo * Expr * TypeInst * int * val mkAnonRecdFieldGetViaExprAddr: AnonRecdTypeInfo * Expr * TypeInst * int * range -> Expr /// Make an expression that gets an instance field from a record or class (via the address of the value if it is a struct) -val mkRecdFieldGetViaExprAddr: Expr * RecdFieldRef * TypeInst * range -> Expr +val mkRecdFieldGetViaExprAddr: Expr * RecdFieldRef * TypeInst * range -> Expr /// Make an expression that gets the address of an instance field from a record or class (via the address of the value if it is a struct) val mkRecdFieldGetAddrViaExprAddr: readonly: bool * Expr * RecdFieldRef * TypeInst * range -> Expr -/// Make an expression that gets a static field from a record or class +/// Make an expression that gets a static field from a record or class val mkStaticRecdFieldGet: RecdFieldRef * TypeInst * range -> Expr -/// Make an expression that sets a static field in a record or class +/// Make an expression that sets a static field in a record or class val mkStaticRecdFieldSet: RecdFieldRef * TypeInst * Expr * range -> Expr -/// Make an expression that gets the address of a static field in a record or class -val mkStaticRecdFieldGetAddr: readonly: bool * RecdFieldRef * TypeInst * range -> Expr +/// Make an expression that gets the address of a static field in a record or class +val mkStaticRecdFieldGetAddr: readonly: bool * RecdFieldRef * TypeInst * range -> Expr /// Make an expression that sets an instance the field of a record or class (via the address of the value if it is a struct) val mkRecdFieldSetViaExprAddr: Expr * RecdFieldRef * TypeInst * Expr * range -> Expr @@ -297,39 +313,40 @@ val mkRecdFieldSetViaExprAddr: Expr * RecdFieldRef * TypeInst * Expr * range -> val mkUnionCaseTagGetViaExprAddr: Expr * TyconRef * TypeInst * range -> Expr /// Make a 'TOp.UnionCaseProof' expression, which proves a union value is over a particular case (used only for ref-unions, not struct-unions) -val mkUnionCaseProof: Expr * UnionCaseRef * TypeInst * range -> Expr +val mkUnionCaseProof: Expr * UnionCaseRef * TypeInst * range -> Expr /// Build a 'TOp.UnionCaseFieldGet' expression for something we've already determined to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -val mkUnionCaseFieldGetProvenViaExprAddr: Expr * UnionCaseRef * TypeInst * int * range -> Expr +val mkUnionCaseFieldGetProvenViaExprAddr: Expr * UnionCaseRef * TypeInst * int * range -> Expr /// Build a 'TOp.UnionCaseFieldGetAddr' expression for a field of a union when we've already determined the value to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -val mkUnionCaseFieldGetAddrProvenViaExprAddr: readonly: bool * Expr * UnionCaseRef * TypeInst * int * range -> Expr +val mkUnionCaseFieldGetAddrProvenViaExprAddr: readonly: bool * Expr * UnionCaseRef * TypeInst * int * range -> Expr /// Build a 'TOp.UnionCaseFieldGetAddr' expression for a field of a union when we've already determined the value to be a particular union case. For ref-unions, /// the input expression has 'TType_ucase', which is an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -val mkUnionCaseFieldGetUnprovenViaExprAddr: Expr * UnionCaseRef * TypeInst * int * range -> Expr +val mkUnionCaseFieldGetUnprovenViaExprAddr: Expr * UnionCaseRef * TypeInst * int * range -> Expr -/// Build a 'TOp.UnionCaseFieldSet' expression. For ref-unions, the input expression has 'TType_ucase', which is +/// Build a 'TOp.UnionCaseFieldSet' expression. For ref-unions, the input expression has 'TType_ucase', which is /// an F# compiler internal "type" corresponding to the union case. For struct-unions, /// the input should be the address of the expression. -val mkUnionCaseFieldSet: Expr * UnionCaseRef * TypeInst * int * Expr * range -> Expr +val mkUnionCaseFieldSet: Expr * UnionCaseRef * TypeInst * int * Expr * range -> Expr /// Like mkUnionCaseFieldGetUnprovenViaExprAddr, but for struct-unions, the input should be a copy of the expression. -val mkUnionCaseFieldGetUnproven: TcGlobals -> Expr * UnionCaseRef * TypeInst * int * range -> Expr +val mkUnionCaseFieldGetUnproven: TcGlobals -> Expr * UnionCaseRef * TypeInst * int * range -> Expr -/// Make an expression that gets an instance field from an F# exception value +/// Make an expression that gets an instance field from an F# exception value val mkExnCaseFieldGet: Expr * TyconRef * int * range -> Expr -/// Make an expression that sets an instance field in an F# exception value -val mkExnCaseFieldSet: Expr * TyconRef * int * Expr * range -> Expr +/// Make an expression that sets an instance field in an F# exception value +val mkExnCaseFieldSet: Expr * TyconRef * int * Expr * range -> Expr /// Make an expression that gets the address of an element in an array -val mkArrayElemAddress: TcGlobals -> readonly: bool * ILReadonly * bool * ILArrayShape * TType * Expr list * range -> Expr +val mkArrayElemAddress: + TcGlobals -> readonly: bool * ILReadonly * bool * ILArrayShape * TType * Expr list * range -> Expr /// The largest tuple before we start encoding, i.e. 7 val maxTuple: int @@ -357,32 +374,38 @@ val mkGetTupleItemN: TcGlobals -> range -> int -> ILType -> bool -> Expr -> TTyp /// but TupInfo may later be used carry variables that infer structness. val evalTupInfoIsStruct: TupInfo -> bool -/// Evaluate the AnonRecdTypeInfo to work out if it is a struct or a ref. +/// Evaluate the AnonRecdTypeInfo to work out if it is a struct or a ref. val evalAnonInfoIsStruct: AnonRecdTypeInfo -> bool /// If it is a tuple type, ensure it's outermost type is a .NET tuple type, otherwise leave unchanged val convertToTypeWithMetadataIfPossible: TcGlobals -> TType -> TType /// An exception representing a warning for a defensive copy of an immutable struct -exception DefensiveCopyWarning of string * range +exception DefensiveCopyWarning of string * range -type Mutates = AddressOfOp | DefinitelyMutates | PossiblyMutates | NeverMutates +type Mutates = + | AddressOfOp + | DefinitelyMutates + | PossiblyMutates + | NeverMutates /// Helper to create an expression that dereferences an address. val mkDerefAddrExpr: mAddrGet: range -> expr: Expr -> mExpr: range -> exprTy: TType -> Expr /// Helper to take the address of an expression -val mkExprAddrOfExprAux: TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr * bool * bool +val mkExprAddrOfExprAux: + TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr * bool * bool /// Take the address of an expression, or force it into a mutable local. Any allocated /// mutable local may need to be kept alive over a larger expression, hence we return /// a wrapping function that wraps "let mutable loc = Expr in ..." around a larger /// expression. -val mkExprAddrOfExpr: TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr * bool * bool +val mkExprAddrOfExpr: + TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr * bool * bool /// Maps Val to T, based on stamps -[] -type ValMap<'T> = +[] +type ValMap<'T> = member Contents: StampMap<'T> @@ -432,7 +455,7 @@ type ValMultiMap<'T> = /// Maps type parameters to entries based on stamp keys [] -type TyparMap<'T> = +type TyparMap<'T> = /// Get the entry for the given type parameter member Item: Typar -> 'T with get @@ -444,10 +467,10 @@ type TyparMap<'T> = member TryFind: Typar -> 'T option /// Make a new map, containing a new entry for the given type parameter - member Add: Typar * 'T -> TyparMap<'T> + member Add: Typar * 'T -> TyparMap<'T> /// The empty map - static member Empty: TyparMap<'T> + static member Empty: TyparMap<'T> /// Maps TyconRef to T based on stamp keys [] @@ -513,7 +536,7 @@ val valRefEq: TcGlobals -> ValRef -> ValRef -> bool //------------------------------------------------------------------------- // Operations on types: substitution -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- /// Represents an instantiation where types replace type parameters type TyparInst = (Typar * TType) list @@ -548,13 +571,13 @@ val instType: TyparInst -> TType -> TType val instTypes: TyparInst -> TypeInst -> TypeInst -val instTyparConstraints: TyparInst -> TyparConstraint list -> TyparConstraint list +val instTyparConstraints: TyparInst -> TyparConstraint list -> TyparConstraint list -val instTrait: TyparInst -> TraitConstraintInfo -> TraitConstraintInfo +val instTrait: TyparInst -> TraitConstraintInfo -> TraitConstraintInfo -val generalTyconRefInst : TyconRef -> TypeInst +val generalTyconRefInst: TyconRef -> TypeInst -/// From typars to types +/// From typars to types val generalizeTypars: Typars -> TypeInst val generalizeTyconRef: TcGlobals -> TyconRef -> TTypes * TType @@ -565,7 +588,7 @@ val mkTyparToTyparRenaming: Typars -> Typars -> TyparInst * TTypes //------------------------------------------------------------------------- // See through typar equations from inference and/or type abbreviation equations. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val reduceTyconRefAbbrev: TyconRef -> TypeInst -> TType @@ -573,8 +596,8 @@ val reduceTyconRefMeasureableOrProvided: TcGlobals -> TyconRef -> TypeInst -> TT val reduceTyconRefAbbrevMeasureable: TyconRef -> Measure -/// set bool to 'true' to allow shortcutting of type parameter equation chains during stripping -val stripTyEqnsA: TcGlobals -> bool -> TType -> TType +/// set bool to 'true' to allow shortcutting of type parameter equation chains during stripping +val stripTyEqnsA: TcGlobals -> bool -> TType -> TType val stripTyEqns: TcGlobals -> TType -> TType @@ -590,9 +613,9 @@ val recdFieldsOfExnDefRef: TyconRef -> RecdField list val recdFieldTysOfExnDefRef: TyconRef -> TType list //------------------------------------------------------------------------- -// Analyze types. These all look through type abbreviations and +// Analyze types. These all look through type abbreviations and // inference equations, i.e. are "stripped" -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val destForallTy: TcGlobals -> TType -> Typars * TType @@ -694,9 +717,9 @@ val tryDestAnyTupleTy: TcGlobals -> TType -> TupInfo * TType list val tryDestRefTupleTy: TcGlobals -> TType -> TType list //------------------------------------------------------------------------- -// Compute actual types of union cases and fields given an instantiation +// Compute actual types of union cases and fields given an instantiation // of the generic type parameters of the enclosing type. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val actualResultTyOfUnionCase: TypeInst -> UnionCaseRef -> TType @@ -711,28 +734,35 @@ val actualTyOfRecdFieldRef: RecdFieldRef -> TypeInst -> TType val actualTyOfRecdFieldForTycon: Tycon -> TypeInst -> RecdField -> TType //------------------------------------------------------------------------- -// Top types: guaranteed to be compiled to .NET methods, and must be able to +// Top types: guaranteed to be compiled to .NET methods, and must be able to // have user-specified argument names (for stability w.r.t. reflection) // and user-specified argument and return attributes. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- -type UncurriedArgInfos = (TType * ArgReprInfo) list +type UncurriedArgInfos = (TType * ArgReprInfo) list type CurriedArgInfos = UncurriedArgInfos list type TraitWitnessInfos = TraitWitnessInfo list -val destTopForallTy: TcGlobals -> ValReprInfo -> TType -> Typars * TType +val destTopForallTy: TcGlobals -> ValReprInfo -> TType -> Typars * TType val GetTopTauTypeInFSharpForm: TcGlobals -> ArgReprInfo list list -> TType -> range -> CurriedArgInfos * TType -val GetTopValTypeInFSharpForm: TcGlobals -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType * ArgReprInfo +val GetTopValTypeInFSharpForm: + TcGlobals -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType * ArgReprInfo val IsCompiledAsStaticProperty: TcGlobals -> Val -> bool val IsCompiledAsStaticPropertyWithField: TcGlobals -> Val -> bool -val GetTopValTypeInCompiledForm: TcGlobals -> ValReprInfo -> int -> TType -> range -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo +val GetTopValTypeInCompiledForm: + TcGlobals -> + ValReprInfo -> + int -> + TType -> + range -> + Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo val GetFSharpViewOfReturnType: TcGlobals -> TType option -> TType @@ -740,14 +770,14 @@ val NormalizeDeclaredTyparsForEquiRecursiveInference: TcGlobals -> Typars -> Typ //------------------------------------------------------------------------- // Compute the return type after an application -//------------------------------------------------------------------------- - +//------------------------------------------------------------------------- + val applyTys: TcGlobals -> TType -> TType list * 'T list -> TType //------------------------------------------------------------------------- // Compute free variables in types -//------------------------------------------------------------------------- - +//------------------------------------------------------------------------- + val emptyFreeTypars: FreeTypars val unionFreeTypars: FreeTypars -> FreeTypars -> FreeTypars @@ -800,7 +830,7 @@ val freeInTypes: FreeVarOptions -> TType list -> FreeTyvars val freeInVal: FreeVarOptions -> Val -> FreeTyvars -// This one puts free variables in canonical left-to-right order. +// This one puts free variables in canonical left-to-right order. val freeInTypeLeftToRight: TcGlobals -> bool -> TType -> Typars val freeInTypesLeftToRight: TcGlobals -> bool -> TType list -> Typars @@ -819,10 +849,10 @@ val stripMeasuresFromTType: TcGlobals -> TType -> TType //------------------------------------------------------------------------- // Equivalence of types (up to substitution of type variables in the left-hand type) -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- [] -type TypeEquivEnv = +type TypeEquivEnv = { EquivTypars: TyparMap EquivTycons: TyconRefRemap } @@ -874,7 +904,7 @@ val getErasedTypes: TcGlobals -> TType -> TType list //------------------------------------------------------------------------- // Unit operations -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val MeasurePower: Measure -> int -> Measure @@ -892,19 +922,29 @@ val normalizeMeasure: TcGlobals -> Measure -> Measure //------------------------------------------------------------------------- -// Members -//------------------------------------------------------------------------- +// Members +//------------------------------------------------------------------------- val GetTypeOfMemberInFSharpForm: TcGlobals -> ValRef -> Typars * CurriedArgInfos * TType * ArgReprInfo -val GetTypeOfMemberInMemberForm: TcGlobals -> ValRef -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo +val GetTypeOfMemberInMemberForm: + TcGlobals -> ValRef -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo -val GetTypeOfIntrinsicMemberInCompiledForm: TcGlobals -> ValRef -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo +val GetTypeOfIntrinsicMemberInCompiledForm: + TcGlobals -> ValRef -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo -val GetMemberTypeInMemberForm: TcGlobals -> SynMemberFlags -> ValReprInfo -> int -> TType -> range -> Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo +val GetMemberTypeInMemberForm: + TcGlobals -> + SynMemberFlags -> + ValReprInfo -> + int -> + TType -> + range -> + Typars * TraitWitnessInfos * CurriedArgInfos * TType option * ArgReprInfo /// Returns (parentTypars,memberParentTypars,memberMethodTypars,memberToParentInst,tinst) -val PartitionValTyparsForApparentEnclosingType: TcGlobals -> Val -> (Typars * Typars * Typars * TyparInst * TType list) option +val PartitionValTyparsForApparentEnclosingType: + TcGlobals -> Val -> (Typars * Typars * Typars * TyparInst * TType list) option /// Returns (parentTypars,memberParentTypars,memberMethodTypars,memberToParentInst,tinst) val PartitionValTypars: TcGlobals -> Val -> (Typars * Typars * Typars * TyparInst * TType list) option @@ -917,16 +957,16 @@ val CountEnclosingTyparsOfActualParentOfVal: Val -> int val ReturnTypeOfPropertyVal: TcGlobals -> Val -> TType -val ArgInfosOfPropertyVal: TcGlobals -> Val -> UncurriedArgInfos +val ArgInfosOfPropertyVal: TcGlobals -> Val -> UncurriedArgInfos -val ArgInfosOfMember: TcGlobals -> ValRef -> CurriedArgInfos +val ArgInfosOfMember: TcGlobals -> ValRef -> CurriedArgInfos val GetMemberCallInfo: TcGlobals -> ValRef * ValUseFlag -> int * bool * bool * bool * bool * bool * bool * bool //------------------------------------------------------------------------- // Printing -//------------------------------------------------------------------------- - +//------------------------------------------------------------------------- + type TyparConstraintsWithTypars = (Typar * TyparConstraint) list module PrettyTypes = @@ -939,16 +979,18 @@ module PrettyTypes = val PrettifyType: TcGlobals -> TType -> TType * TyparConstraintsWithTypars - val PrettifyInstAndTyparsAndType: TcGlobals -> TyparInst * Typars * TType -> (TyparInst * Typars * TType) * TyparConstraintsWithTypars + val PrettifyInstAndTyparsAndType: + TcGlobals -> TyparInst * Typars * TType -> (TyparInst * Typars * TType) * TyparConstraintsWithTypars val PrettifyTypePair: TcGlobals -> TType * TType -> (TType * TType) * TyparConstraintsWithTypars val PrettifyTypes: TcGlobals -> TTypes -> TTypes * TyparConstraintsWithTypars - + /// same as PrettifyTypes, but allows passing the types along with a discriminant value /// useful to prettify many types that need to be sorted out after prettifying operation /// took place. - val PrettifyDiscriminantAndTypePairs: TcGlobals -> ('Discriminant * TType) list -> ('Discriminant * TType) list * TyparConstraintsWithTypars + val PrettifyDiscriminantAndTypePairs: + TcGlobals -> ('Discriminant * TType) list -> ('Discriminant * TType) list * TyparConstraintsWithTypars val PrettifyInst: TcGlobals -> TyparInst -> TyparInst * TyparConstraintsWithTypars @@ -956,15 +998,23 @@ module PrettyTypes = val PrettifyInstAndTypes: TcGlobals -> TyparInst * TTypes -> (TyparInst * TTypes) * TyparConstraintsWithTypars - val PrettifyInstAndSig: TcGlobals -> TyparInst * TTypes * TType -> (TyparInst * TTypes * TType) * TyparConstraintsWithTypars + val PrettifyInstAndSig: + TcGlobals -> TyparInst * TTypes * TType -> (TyparInst * TTypes * TType) * TyparConstraintsWithTypars val PrettifyCurriedTypes: TcGlobals -> TType list list -> TType list list * TyparConstraintsWithTypars - val PrettifyCurriedSigTypes: TcGlobals -> TType list list * TType -> (TType list list * TType) * TyparConstraintsWithTypars + val PrettifyCurriedSigTypes: + TcGlobals -> TType list list * TType -> (TType list list * TType) * TyparConstraintsWithTypars - val PrettifyInstAndUncurriedSig: TcGlobals -> TyparInst * UncurriedArgInfos * TType -> (TyparInst * UncurriedArgInfos * TType) * TyparConstraintsWithTypars + val PrettifyInstAndUncurriedSig: + TcGlobals -> + TyparInst * UncurriedArgInfos * TType -> + (TyparInst * UncurriedArgInfos * TType) * TyparConstraintsWithTypars - val PrettifyInstAndCurriedSig: TcGlobals -> TyparInst * TTypes * CurriedArgInfos * TType -> (TyparInst * TTypes * CurriedArgInfos * TType) * TyparConstraintsWithTypars + val PrettifyInstAndCurriedSig: + TcGlobals -> + TyparInst * TTypes * CurriedArgInfos * TType -> + (TyparInst * TTypes * CurriedArgInfos * TType) * TyparConstraintsWithTypars /// Describes how generic type parameters in a type will be formatted during printing type GenericParameterStyle = @@ -976,25 +1026,25 @@ type GenericParameterStyle = | Suffix [] -type DisplayEnv = +type DisplayEnv = { includeStaticParametersInTypeNames: bool - openTopPathsSorted: Lazy + openTopPathsSorted: Lazy openTopPathsRaw: string list list shortTypeNames: bool suppressNestedTypes: bool maxMembers: int option - showObsoleteMembers: bool + showObsoleteMembers: bool showHiddenMembers: bool showTyparBinding: bool showImperativeTyparAnnotations: bool - suppressInlineKeyword:bool - suppressMutableKeyword:bool + suppressInlineKeyword: bool + suppressMutableKeyword: bool showMemberContainers: bool - shortConstraints:bool - useColonForReturnType:bool + shortConstraints: bool + useColonForReturnType: bool showAttributes: bool - showOverrides:bool - showConstraintTyparAnnotations:bool + showOverrides: bool + showConstraintTyparAnnotations: bool abbreviateAdditionalConstraints: bool showTyparDefaultConstraints: bool /// If set, signatures will be rendered with XML documentation comments for members if they exist @@ -1059,11 +1109,11 @@ val prefixOfStaticReq: TyparStaticReq -> string val prefixOfRigidTypar: Typar -> string /// Utilities used in simplifying types for visual presentation -module SimplifyTypes = +module SimplifyTypes = type TypeSimplificationInfo = { singletons: Typar Zset - inplaceConstraints: Zmap + inplaceConstraints: Zmap postfixConstraints: TyparConstraintsWithTypars } val typeSimplificationInfo0: TypeSimplificationInfo @@ -1078,7 +1128,7 @@ val abstractSlotValsOfTycons: Tycon list -> Val list //------------------------------------------------------------------------- // Free variables in expressions etc. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val emptyFreeVars: FreeVars @@ -1108,36 +1158,37 @@ val freeTyvarsAllPublic: FreeTyvars -> bool val freeVarsAllPublic: FreeVars -> bool /// Compute the type of an expression from the expression itself -val tyOfExpr: TcGlobals -> Expr -> TType +val tyOfExpr: TcGlobals -> Expr -> TType -/// A flag to govern whether arity inference should be type-directed or syntax-directed when +/// A flag to govern whether arity inference should be type-directed or syntax-directed when /// inferring an arity from a lambda expression. [] -type AllowTypeDirectedDetupling = - | Yes +type AllowTypeDirectedDetupling = + | Yes | No /// Given a (curried) lambda expression, pull off its arguments val stripTopLambda: Expr * TType -> Typars * Val list list * Expr * TType /// Given a lambda expression, extract the ValReprInfo for its arguments and other details -val InferArityOfExpr: TcGlobals -> AllowTypeDirectedDetupling -> TType -> Attribs list list -> Attribs -> Expr -> ValReprInfo +val InferArityOfExpr: + TcGlobals -> AllowTypeDirectedDetupling -> TType -> Attribs list list -> Attribs -> Expr -> ValReprInfo /// Given a lambda binding, extract the ValReprInfo for its arguments and other details val InferArityOfExprBinding: TcGlobals -> AllowTypeDirectedDetupling -> Val -> Expr -> ValReprInfo /// Mutate a value to indicate it should be considered a local rather than a module-bound definition -// REVIEW: this mutation should not be needed +// REVIEW: this mutation should not be needed val setValHasNoArity: Val -> Val /// Indicate what should happen to value definitions when copying expressions -type ValCopyFlag = +type ValCopyFlag = | CloneAll | CloneAllAndMarkExprValsAsCompilerGenerated - /// OnlyCloneExprVals is a nasty setting to reuse the cloning logic in a mode where all + /// OnlyCloneExprVals is a nasty setting to reuse the cloning logic in a mode where all /// Tycon and "module/member" Val objects keep their identity, but the Val objects for all Expr bindings - /// are cloned. This is used to 'fixup' the TAST created by tlr.fs + /// are cloned. This is used to 'fixup' the TAST created by tlr.fs /// /// This is a fragile mode of use. It's not really clear why TLR needs to create a "bad" expression tree that /// reuses Val objects as multiple value bindings, and its been the cause of several subtle bugs. @@ -1184,20 +1235,20 @@ val instExpr: TcGlobals -> TyparInst -> 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 = +type SignatureRepackageInfo = { /// The list of corresponding values RepackagedVals: (ValRef * ValRef) list /// The list of corresponding modules, namespaces and type definitions - RepackagedEntities: (TyconRef * TyconRef) list } + RepackagedEntities: (TyconRef * TyconRef) list } /// The empty table static member Empty: SignatureRepackageInfo - + /// A set of tables summarizing the items hidden by a signature -type SignatureHidingInfo = +type SignatureHidingInfo = { HiddenTycons: Zset - HiddenTyconReprs: Zset + HiddenTyconReprs: Zset HiddenVals: Zset HiddenRecdFields: Zset HiddenUnionCases: Zset } @@ -1206,24 +1257,28 @@ type SignatureHidingInfo = static member Empty: SignatureHidingInfo /// Compute the remapping information implied by a signature being inferred for a particular implementation -val ComputeRemappingFromImplementationToSignature: TcGlobals -> ModuleOrNamespaceExpr -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo +val ComputeRemappingFromImplementationToSignature: + TcGlobals -> ModuleOrNamespaceExpr -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo /// Compute the remapping information implied by an explicit signature being given for an inferred signature -val ComputeRemappingFromInferredSignatureToExplicitSignature: TcGlobals -> ModuleOrNamespaceType -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo +val ComputeRemappingFromInferredSignatureToExplicitSignature: + TcGlobals -> ModuleOrNamespaceType -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo /// Compute the hiding information that corresponds to the hiding applied at an assembly boundary val ComputeSignatureHidingInfoAtAssemblyBoundary: ModuleOrNamespaceType -> SignatureHidingInfo -> SignatureHidingInfo /// Compute the hiding information that corresponds to the hiding applied at an assembly boundary -val ComputeImplementationHidingInfoAtAssemblyBoundary: ModuleOrNamespaceExpr -> SignatureHidingInfo -> SignatureHidingInfo +val ComputeImplementationHidingInfoAtAssemblyBoundary: + ModuleOrNamespaceExpr -> SignatureHidingInfo -> SignatureHidingInfo -val mkRepackageRemapping: SignatureRepackageInfo -> Remap +val mkRepackageRemapping: SignatureRepackageInfo -> Remap /// Wrap one module or namespace implementation in a 'namespace N' outer wrapper val wrapModuleOrNamespaceExprInNamespace: Ident -> CompilationPath -> ModuleOrNamespaceExpr -> ModuleOrNamespaceExpr /// Wrap one module or namespace definition in a 'namespace N' outer wrapper -val wrapModuleOrNamespaceTypeInNamespace: Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespaceType * ModuleOrNamespace +val wrapModuleOrNamespaceTypeInNamespace: + Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespaceType * ModuleOrNamespace /// Wrap one module or namespace definition in a 'module M = ..' outer wrapper val wrapModuleOrNamespaceType: Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespace @@ -1241,12 +1296,12 @@ val tryRescopeVal: CcuThunk -> Remap -> Val -> ValueOption /// /// Given the top-most signatures constrains the public compilation units /// of an assembly, compute a remapping that converts local references to non-local references. -/// This remapping must be applied to all pickled expressions and types +/// This remapping must be applied to all pickled expressions and types /// exported from the assembly. val MakeExportRemapping: CcuThunk -> ModuleOrNamespace -> Remap /// Make a remapping table for viewing a module or namespace 'from the outside' -val ApplyExportRemappingToEntity: TcGlobals -> Remap -> ModuleOrNamespace -> ModuleOrNamespace +val ApplyExportRemappingToEntity: TcGlobals -> Remap -> ModuleOrNamespace -> ModuleOrNamespace /// Determine if a type definition is hidden by a signature val IsHiddenTycon: (Remap * SignatureHidingInfo) list -> Tycon -> bool @@ -1263,7 +1318,7 @@ val IsHiddenRecdField: (Remap * SignatureHidingInfo) list -> RecdFieldRef -> boo /// Adjust marks in expressions, replacing all marks by the given mark. /// Used when inlining. val remarkExpr: range -> Expr -> Expr - + /// Build the application of a (possibly generic, possibly curried) function value to a set of type and expression arguments val primMkApp: Expr * TType -> TypeInst -> Exprs -> range -> Expr @@ -1276,19 +1331,19 @@ val mkApps: TcGlobals -> (Expr * TType) * TType list list * Exprs * range -> Exp val mkTyAppExpr: range -> Expr * TType -> TType list -> Expr /// Build an expression to mutate a local -/// localv <- e +/// localv <- e val mkValSet: range -> ValRef -> Expr -> Expr /// Build an expression to mutate the contents of a local pointer -/// *localv_ptr = e +/// *localv_ptr = e val mkAddrSet: range -> ValRef -> Expr -> Expr /// Build an expression to dereference a local pointer -/// *localv_ptr +/// *localv_ptr val mkAddrGet: range -> ValRef -> Expr -/// Build an expression to take the address of a local -/// &localv +/// Build an expression to take the address of a local +/// &localv val mkValAddr: range -> readonly: bool -> ValRef -> Expr /// Build an expression representing the read of an instance class or record field. @@ -1298,23 +1353,27 @@ val mkRecdFieldGet: TcGlobals -> Expr * RecdFieldRef * TypeInst * range -> Expr /// Accumulate the targets actually used in a decision graph (for reporting warnings) val accTargetsOfDecisionTree: DecisionTree -> int list -> int list -/// Make a 'match' expression applying some peep-hole optimizations along the way, e.g to +/// Make a 'match' expression applying some peep-hole optimizations along the way, e.g to /// pre-decide the branch taken at compile-time. -val mkAndSimplifyMatch: DebugPointAtBinding -> range -> range -> TType -> DecisionTree -> DecisionTreeTarget list -> Expr +val mkAndSimplifyMatch: + DebugPointAtBinding -> range -> range -> TType -> DecisionTree -> DecisionTreeTarget list -> Expr /// Make a 'match' expression without applying any peep-hole optimizations. val primMkMatch: DebugPointAtBinding * range * DecisionTree * DecisionTreeTarget array * range * TType -> Expr /// Work out what things on the right-han-side of a 'let rec' recursive binding need to be fixed up -val IterateRecursiveFixups: - TcGlobals -> Val option -> - (Val option -> Expr -> (Expr -> Expr) -> Expr -> unit) -> - Expr * (Expr -> Expr) -> Expr -> unit +val IterateRecursiveFixups: + TcGlobals -> + Val option -> + (Val option -> Expr -> (Expr -> Expr) -> Expr -> unit) -> + Expr * (Expr -> Expr) -> + Expr -> + unit /// Given a lambda expression taking multiple variables, build a corresponding lambda taking a tuple val MultiLambdaToTupledLambda: TcGlobals -> Val list -> Expr -> Val * Expr -/// Given a lambda expression, adjust it to have be one or two lambda expressions (fun a -> (fun b -> ...)) +/// Given a lambda expression, adjust it to have be one or two lambda expressions (fun a -> (fun b -> ...)) /// where the first has the given arity. val AdjustArityOfLambdaBody: TcGlobals -> int -> Val list -> Expr -> Val list * Expr @@ -1324,7 +1383,8 @@ val MakeApplicationAndBetaReduce: TcGlobals -> Expr * TType * TypeInst list * Ex /// Make a delegate invoke expression for an F# delegate type, doing beta reduction by introducing let-bindings /// if the delegate expression is a construction of a delegate. -val MakeFSharpDelegateInvokeAndTryBetaReduce: TcGlobals -> delInvokeRef: Expr * delExpr: Expr * delInvokeTy: TType * delInvokeArg: Expr * m: range -> Expr +val MakeFSharpDelegateInvokeAndTryBetaReduce: + TcGlobals -> delInvokeRef: Expr * delExpr: Expr * delInvokeTy: TType * delInvokeArg: Expr * m: range -> Expr /// Combine two static-resolution requirements on a type parameter val JoinTyparStaticReq: TyparStaticReq -> TyparStaticReq -> TyparStaticReq @@ -1406,22 +1466,26 @@ module DebugPrint = /// A set of function parameters (visitor) for folding over expressions type ExprFolder<'State> = - { exprIntercept: (* recurseF *) ('State -> Expr -> 'State) -> (* noInterceptF *) ('State -> Expr -> 'State) -> 'State -> Expr -> 'State + { exprIntercept: ('State -> Expr -> 'State) (* noInterceptF *) + -> ('State -> Expr -> 'State) + -> 'State + -> Expr + -> 'State (* recurseF *) valBindingSiteIntercept: 'State -> bool * Val -> 'State - nonRecBindingsIntercept: 'State -> Binding -> 'State - recBindingsIntercept: 'State -> Bindings -> 'State + nonRecBindingsIntercept: 'State -> Binding -> 'State + recBindingsIntercept: 'State -> Bindings -> 'State dtreeIntercept: 'State -> DecisionTree -> 'State targetIntercept: ('State -> Expr -> 'State) -> 'State -> DecisionTreeTarget -> 'State option - tmethodIntercept: ('State -> Expr -> 'State) -> 'State -> ObjExprMethod -> 'State option} + tmethodIntercept: ('State -> Expr -> 'State) -> 'State -> ObjExprMethod -> 'State option } /// The empty set of actions for folding over expressions val ExprFolder0: ExprFolder<'State> /// Fold over all the expressions in an implementation file -val FoldImplFile: ExprFolder<'State> -> ('State -> TypedImplFile -> 'State) +val FoldImplFile: ExprFolder<'State> -> ('State -> TypedImplFile -> 'State) /// Fold over all the expressions in an expression -val FoldExpr: ExprFolder<'State> -> ('State -> Expr -> 'State) +val FoldExpr: ExprFolder<'State> -> ('State -> Expr -> 'State) #if DEBUG /// Extract some statistics from an expression @@ -1474,7 +1538,7 @@ val tryDestLinqExpressionTy: TcGlobals -> TType -> TType option val isIDelegateEventType: TcGlobals -> TType -> bool /// Take apart an IDelegateEvent type -val destIDelegateEventType: TcGlobals -> TType -> TType +val destIDelegateEventType: TcGlobals -> TType -> TType /// Build an IEvent type val mkIEventType: TcGlobals -> TType -> TType -> TType @@ -1493,14 +1557,14 @@ val mkPrintfFormatTy: TcGlobals -> TType -> TType -> TType -> TType -> TType -> //------------------------------------------------------------------------- // Classify types -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- /// Represents metadata extracted from a nominal type -type TypeDefMetadata = - | ILTypeMetadata of TILObjectReprData - | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata +type TypeDefMetadata = + | ILTypeMetadata of TILObjectReprData + | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata #if !NO_TYPEPROVIDERS - | ProvidedTypeMetadata of TProvidedTypeInfo + | ProvidedTypeMetadata of TProvidedTypeInfo #endif /// Extract metadata from a type definition @@ -1533,7 +1597,7 @@ val destListTy: TcGlobals -> TType -> TType /// Build an array type of the given rank val mkArrayTy: TcGlobals -> int -> TType -> range -> TType -/// Check if a type definition is one of the artificial type definitions used for array types of different ranks +/// Check if a type definition is one of the artificial type definitions used for array types of different ranks val isArrayTyconRef: TcGlobals -> TyconRef -> bool /// Determine the rank of one of the artificial type definitions used for array types @@ -1563,7 +1627,7 @@ val isInterfaceTyconRef: TyconRef -> bool /// Determine if a type is a delegate type val isDelegateTy: TcGlobals -> TType -> bool -/// Determine if a type is a delegate type defined in F# +/// Determine if a type is a delegate type defined in F# val isFSharpDelegateTy: TcGlobals -> TType -> bool /// Determine if a type is an interface type @@ -1628,14 +1692,14 @@ val (|AppTy|_|): TcGlobals -> TType -> (TyconRef * TType list) option val (|NullableTy|_|): TcGlobals -> TType -> TType option /// An active pattern to transform System.Nullable types to their input, otherwise leave the input unchanged -val (|StripNullableTy|): TcGlobals -> TType -> TType +val (|StripNullableTy|): TcGlobals -> TType -> TType /// Matches any byref type, yielding the target type val (|ByrefTy|_|): TcGlobals -> TType -> TType option //------------------------------------------------------------------------- // Special semantic constraints -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val IsUnionTypeWithNullAsTrueValue: TcGlobals -> Tycon -> bool @@ -1671,7 +1735,7 @@ val isUnionCaseRefDefinitelyMutable: UnionCaseRef -> bool val isRecdOrUnionOrStructTyconRefDefinitelyMutable: TyconRef -> bool -val isExnDefinitelyMutable: TyconRef -> bool +val isExnDefinitelyMutable: TyconRef -> bool val isUnionCaseFieldMutable: TcGlobals -> UnionCaseRef -> int -> bool @@ -1683,13 +1747,13 @@ val isRecdOrStructTyconRefAssumedImmutable: TcGlobals -> TyconRef -> bool val isRecdOrStructTyReadOnly: TcGlobals -> range -> TType -> bool -val useGenuineField: Tycon -> RecdField -> bool +val useGenuineField: Tycon -> RecdField -> bool val ComputeFieldName: Tycon -> RecdField -> string //------------------------------------------------------------------------- // Destruct slotsigs etc. -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val slotSigHasVoidReturnTy: SlotSig -> bool @@ -1699,7 +1763,7 @@ val returnTyOfMethod: TcGlobals -> ObjExprMethod -> TType option //------------------------------------------------------------------------- // Primitives associated with initialization graphs -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val mkRefCell: TcGlobals -> range -> TType -> Expr -> Expr @@ -1713,10 +1777,10 @@ val mkLazyForce: TcGlobals -> range -> TType -> Expr -> Expr val mkRefCellContentsRef: TcGlobals -> RecdFieldRef -/// Check if a type is an FSharpRef type +/// Check if a type is an FSharpRef type val isRefCellTy: TcGlobals -> TType -> bool -/// Get the element type of an FSharpRef type +/// Get the element type of an FSharpRef type val destRefCellTy: TcGlobals -> TType -> TType /// Create the FSharpRef type for a given element type @@ -1735,7 +1799,7 @@ val mkListTy: TcGlobals -> TType -> TType val mkOptionTy: TcGlobals -> TType -> TType /// Create the voption type for a given element type -val mkValueOptionTy : TcGlobals -> TType -> TType +val mkValueOptionTy: TcGlobals -> TType -> TType /// Create the Nullable type for a given element type val mkNullableTy: TcGlobals -> TType -> TType @@ -1770,7 +1834,7 @@ val mkOptionDefaultValue: TcGlobals -> range -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- // Make a few more expressions -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val mkSequential: range -> Expr -> Expr -> Expr @@ -1784,7 +1848,7 @@ val mkCompGenSequential: range -> stmt: Expr -> expr: Expr -> Expr /// setting is used for debug points, suppressing the debug points for the statement if possible. val mkCompGenThenDoSequential: range -> expr: Expr -> stmt: Expr -> Expr -val mkSequentials: TcGlobals -> range -> Exprs -> Expr +val mkSequentials: TcGlobals -> range -> Exprs -> Expr val mkRecordExpr: TcGlobals -> RecordConstructionInfo * TyconRef * TypeInst * RecdFieldRef list * Exprs * range -> Expr @@ -1840,8 +1904,8 @@ val destInt32: Expr -> int32 option //------------------------------------------------------------------------- // Primitives associated with quotations -//------------------------------------------------------------------------- - +//------------------------------------------------------------------------- + val isQuotedExprTy: TcGlobals -> TType -> bool val destQuotedExprTy: TcGlobals -> TType -> TType @@ -1852,13 +1916,13 @@ val mkRawQuotedExprTy: TcGlobals -> TType //------------------------------------------------------------------------- // Primitives associated with IL code gen -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- -val mspec_Type_GetTypeFromHandle: TcGlobals -> ILMethodSpec +val mspec_Type_GetTypeFromHandle: TcGlobals -> ILMethodSpec -val fspec_Missing_Value: TcGlobals -> ILFieldSpec +val fspec_Missing_Value: TcGlobals -> ILFieldSpec -val mkInitializeArrayMethSpec: TcGlobals -> ILMethodSpec +val mkInitializeArrayMethSpec: TcGlobals -> ILMethodSpec val mkByteArrayTy: TcGlobals -> TType @@ -1867,7 +1931,7 @@ val mkInvalidCastExnNewobj: TcGlobals -> ILInstr //------------------------------------------------------------------------- // Construct calls to some intrinsic functions -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val mkCallNewFormat: TcGlobals -> range -> TType -> TType -> TType -> TType -> TType -> formatStringExpr: Expr -> Expr @@ -1893,7 +1957,7 @@ val canUseTypeTestFast: TcGlobals -> TType -> bool val mkCallTypeOf: TcGlobals -> range -> TType -> Expr -val mkCallTypeDefOf: TcGlobals -> range -> TType -> Expr +val mkCallTypeDefOf: TcGlobals -> range -> TType -> Expr val mkCallCreateInstance: TcGlobals -> range -> TType -> Expr @@ -1903,7 +1967,7 @@ val mkCallArrayLength: TcGlobals -> range -> TType -> Expr -> Expr val mkCallArrayGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -val mkCallArray2DGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr +val mkCallArray2DGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr val mkCallArray3DGet: TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr @@ -2035,7 +2099,7 @@ val mkCallDeserializeQuotationFSharp20Plus: TcGlobals -> range -> Expr -> Expr - val mkCallDeserializeQuotationFSharp40Plus: TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr -val mkCallCastQuotation: TcGlobals -> range -> TType -> Expr -> Expr +val mkCallCastQuotation: TcGlobals -> range -> TType -> Expr -> Expr val mkCallLiftValueWithName: TcGlobals -> range -> TType -> string -> Expr -> Expr @@ -2057,9 +2121,9 @@ val mkCallSeqGenerated: TcGlobals -> range -> TType -> Expr -> Expr -> Expr val mkCallSeqOfFunctions: TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr -> Expr -val mkCallSeqToArray: TcGlobals -> range -> TType -> Expr -> Expr +val mkCallSeqToArray: TcGlobals -> range -> TType -> Expr -> Expr -val mkCallSeqToList: TcGlobals -> range -> TType -> Expr -> Expr +val mkCallSeqToList: TcGlobals -> range -> TType -> Expr -> Expr val mkCallSeqMap: TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr @@ -2074,11 +2138,11 @@ val mkILAsmCeq: TcGlobals -> range -> Expr -> Expr -> Expr val mkILAsmClt: TcGlobals -> range -> Expr -> Expr -> Expr -val mkCallFailInit: TcGlobals -> range -> Expr +val mkCallFailInit: TcGlobals -> range -> Expr -val mkCallFailStaticInit: TcGlobals -> range -> Expr +val mkCallFailStaticInit: TcGlobals -> range -> Expr -val mkCallCheckThis: TcGlobals -> range -> TType -> Expr -> Expr +val mkCallCheckThis: TcGlobals -> range -> TType -> Expr -> Expr val mkCase: DecisionTreeTest * DecisionTree -> DecisionTreeCase @@ -2101,13 +2165,14 @@ val mkStaticCall_String_Concat_Array: TcGlobals -> range -> Expr -> Expr /// Use a witness in BuiltInWitnesses val tryMkCallBuiltInWitness: TcGlobals -> TraitConstraintInfo -> Expr list -> range -> Expr option -/// Use an operator as a witness -val tryMkCallCoreFunctionAsBuiltInWitness: TcGlobals -> IntrinsicValRef -> TType list -> Expr list -> range -> Expr option +/// Use an operator as a witness +val tryMkCallCoreFunctionAsBuiltInWitness: + TcGlobals -> IntrinsicValRef -> TType list -> Expr list -> range -> Expr option //------------------------------------------------------------------------- // operations primarily associated with the optimization to fix // up loops to generate .NET code that does not include array bound checks -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val mkDecr: TcGlobals -> range -> Expr -> Expr @@ -2118,8 +2183,8 @@ val mkLdlen: TcGlobals -> range -> Expr -> Expr val mkLdelem: TcGlobals -> range -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- -// Analyze attribute sets -//------------------------------------------------------------------------- +// Analyze attribute sets +//------------------------------------------------------------------------- val TryDecodeILAttribute: ILTypeRef -> ILAttributes -> (ILAttribElem list * ILAttributeNamedArg list) option @@ -2171,9 +2236,9 @@ val TryDecodeTypeProviderAssemblyAttr: ILAttribute -> string MaybeNull option val IsSignatureDataVersionAttr: ILAttribute -> bool -val TryFindAutoOpenAttr: ILAttribute -> string option +val TryFindAutoOpenAttr: ILAttribute -> string option -val TryFindInternalsVisibleToAttr: ILAttribute -> string option +val TryFindInternalsVisibleToAttr: ILAttribute -> string option val IsMatchingSignatureDataVersionAttr: ILVersionInfo -> ILAttribute -> bool @@ -2196,7 +2261,7 @@ val mkCompilerGeneratedAttr: TcGlobals -> int -> ILAttribute //------------------------------------------------------------------------- // More common type construction -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val isInByrefTy: TcGlobals -> TType -> bool @@ -2223,19 +2288,19 @@ val isSpanLikeTy: TcGlobals -> range -> TType -> bool val isSpanTy: TcGlobals -> range -> TType -> bool -val tryDestSpanTy: TcGlobals -> range -> TType -> struct(TyconRef * TType) voption +val tryDestSpanTy: TcGlobals -> range -> TType -> struct (TyconRef * TType) voption -val destSpanTy: TcGlobals -> range -> TType -> struct(TyconRef * TType) +val destSpanTy: TcGlobals -> range -> TType -> struct (TyconRef * TType) val isReadOnlySpanTy: TcGlobals -> range -> TType -> bool -val tryDestReadOnlySpanTy: TcGlobals -> range -> TType -> struct(TyconRef * TType) voption +val tryDestReadOnlySpanTy: TcGlobals -> range -> TType -> struct (TyconRef * TType) voption -val destReadOnlySpanTy: TcGlobals -> range -> TType -> struct(TyconRef * TType) +val destReadOnlySpanTy: TcGlobals -> range -> TType -> struct (TyconRef * TType) //------------------------------------------------------------------------- // Tuple constructors/destructors -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val isRefTupleExpr: Expr -> bool @@ -2243,23 +2308,23 @@ val tryDestRefTupleExpr: Expr -> Exprs val mkAnyTupledTy: TcGlobals -> TupInfo -> TType list -> TType -val mkAnyTupled: TcGlobals -> range -> TupInfo -> Exprs -> TType list -> Expr +val mkAnyTupled: TcGlobals -> range -> TupInfo -> Exprs -> TType list -> Expr -val mkRefTupled: TcGlobals -> range -> Exprs -> TType list -> Expr +val mkRefTupled: TcGlobals -> range -> Exprs -> TType list -> Expr -val mkRefTupledNoTypes: TcGlobals -> range -> Exprs -> Expr +val mkRefTupledNoTypes: TcGlobals -> range -> Exprs -> Expr val mkRefTupledTy: TcGlobals -> TType list -> TType val mkRefTupledVarsTy: TcGlobals -> Val list -> TType -val mkRefTupledVars: TcGlobals -> range -> Val list -> Expr +val mkRefTupledVars: TcGlobals -> range -> Val list -> Expr val mkMethodTy: TcGlobals -> TType list list -> TType -> TType val mkAnyAnonRecdTy: TcGlobals -> AnonRecdTypeInfo -> TType list -> TType -val mkAnonRecd: TcGlobals -> range -> AnonRecdTypeInfo -> Ident[] -> Exprs -> TType list -> Expr +val mkAnonRecd: TcGlobals -> range -> AnonRecdTypeInfo -> Ident [] -> Exprs -> TType list -> Expr val AdjustValForExpectedArity: TcGlobals -> range -> ValRef -> ValUseFlag -> ValReprInfo -> Expr * TType @@ -2273,13 +2338,13 @@ val NormalizeAndAdjustPossibleSubsumptionExprs: TcGlobals -> Expr -> Expr //------------------------------------------------------------------------- // XmlDoc signatures, used by both VS mode and XML-help emit -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- val buildAccessPath: CompilationPath option -> string val XmlDocArgsEnc: TcGlobals -> Typars * Typars -> TType list -> string -val XmlDocSigOfVal: TcGlobals -> full: bool -> string -> Val -> string +val XmlDocSigOfVal: TcGlobals -> full: bool -> string -> Val -> string val XmlDocSigOfUnionCase: path: string list -> string @@ -2295,9 +2360,9 @@ val XmlDocSigOfEntity: eref: EntityRef -> string //--------------------------------------------------------------------------- // Resolve static optimizations -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- -type StaticOptimizationAnswer = +type StaticOptimizationAnswer = | Yes = 1y | No = -1y | Unknown = 0y @@ -2311,18 +2376,18 @@ val mkFastForLoop: TcGlobals -> DebugPointAtFor * DebugPointAtInOrTo * range * V //--------------------------------------------------------------------------- // Active pattern helpers -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- -type ActivePatternElemRef with +type ActivePatternElemRef with member Name: string val TryGetActivePatternInfo: ValRef -> PrettyNaming.ActivePatternInfo option val mkChoiceCaseRef: g: TcGlobals -> m: range -> n: int -> i: int -> UnionCaseRef -type PrettyNaming.ActivePatternInfo with +type PrettyNaming.ActivePatternInfo with - member Names: string list + member Names: string list member ResultType: g: TcGlobals -> range -> TType list -> bool -> TType @@ -2332,10 +2397,10 @@ val doesActivePatternHaveFreeTypars: TcGlobals -> ValRef -> bool //--------------------------------------------------------------------------- // Structural rewrites -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- [] -type ExprRewritingEnv = +type ExprRewritingEnv = { PreIntercept: ((Expr -> Expr) -> Expr -> Expr option) option PostTransform: Expr -> Expr option PreInterceptBinding: ((Expr -> Expr) -> Binding -> Binding option) option @@ -2350,7 +2415,7 @@ val RewriteImplFile: ExprRewritingEnv -> TypedImplFile -> TypedImplFile val IsGenericValWithGenericConstraints: TcGlobals -> Val -> bool -type Entity with +type Entity with member HasInterface: TcGlobals -> TType -> bool @@ -2358,7 +2423,7 @@ type Entity with member HasMember: TcGlobals -> string -> TType list -> bool -type EntityRef with +type EntityRef with member HasInterface: TcGlobals -> TType -> bool @@ -2388,7 +2453,7 @@ val IsSimpleSyntacticConstantExpr: TcGlobals -> Expr -> bool val (|ConstToILFieldInit|_|): Const -> ILFieldInit option -val (|ExtractAttribNamedArg|_|): string -> AttribNamedArg list -> AttribExpr option +val (|ExtractAttribNamedArg|_|): string -> AttribNamedArg list -> AttribExpr option val (|AttribInt32Arg|_|): AttribExpr -> int32 option @@ -2408,7 +2473,9 @@ val (|SpecialEquatableHeadType|_|): TcGlobals -> TType -> TType list option val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option -type OptimizeForExpressionOptions = OptimizeIntRangesOnly | OptimizeAllForExpressions +type OptimizeForExpressionOptions = + | OptimizeIntRangesOnly + | OptimizeAllForExpressions val DetectAndOptimizeForEachExpression: TcGlobals -> OptimizeForExpressionOptions -> Expr -> Expr @@ -2420,9 +2487,11 @@ val ValIsExplicitImpl: TcGlobals -> Val -> bool val ValRefIsExplicitImpl: TcGlobals -> ValRef -> bool -val (|LinearMatchExpr|_|): Expr -> (DebugPointAtBinding * range * DecisionTree * DecisionTreeTarget * Expr * range * TType) option +val (|LinearMatchExpr|_|): + Expr -> (DebugPointAtBinding * range * DecisionTree * DecisionTreeTarget * Expr * range * TType) option -val rebuildLinearMatchExpr: DebugPointAtBinding * range * DecisionTree * DecisionTreeTarget * Expr * range * TType -> Expr +val rebuildLinearMatchExpr: + DebugPointAtBinding * range * DecisionTree * DecisionTreeTarget * Expr * range * TType -> Expr val (|LinearOpExpr|_|): Expr -> (TOp * TypeInst * Expr list * Expr * range) option @@ -2444,7 +2513,7 @@ val GenWitnessArgTys: TcGlobals -> TraitWitnessInfo -> TType list list val GenWitnessTys: TcGlobals -> TraitWitnessInfos -> TType list -val GenWitnessTy: TcGlobals -> TraitWitnessInfo -> TType +val GenWitnessTy: TcGlobals -> TraitWitnessInfo -> TType val GetTraitConstraintInfosOfTypars: TcGlobals -> Typars -> TraitConstraintInfo list @@ -2468,7 +2537,7 @@ val (|NewDelegateExpr|_|): TcGlobals -> Expr -> (Unique * Val list * Expr * rang val (|DelegateInvokeExpr|_|): TcGlobals -> Expr -> (Expr * TType * Expr * Expr * range) option /// Match 'if __useResumableCode then ... else ...' expressions -val (|IfUseResumableStateMachinesExpr|_|) : TcGlobals -> Expr -> (Expr * Expr) option +val (|IfUseResumableStateMachinesExpr|_|): TcGlobals -> Expr -> (Expr * Expr) option val CombineCcuContentFragments: range -> ModuleOrNamespaceType list -> ModuleOrNamespaceType @@ -2476,10 +2545,8 @@ val CombineCcuContentFragments: range -> ModuleOrNamespaceType list -> ModuleOrN val (|ResumableEntryMatchExpr|_|): g: TcGlobals -> Expr -> (Expr * Val * Expr * (Expr * Expr -> Expr)) option /// Recognise a '__stateMachine' expression -val (|StructStateMachineExpr|_|): - g: TcGlobals -> - expr: Expr -> - (TType * (Val * Expr) * (Val * Val * Expr) * (Val * Expr)) option +val (|StructStateMachineExpr|_|): + g: TcGlobals -> expr: Expr -> (TType * (Val * Expr) * (Val * Val * Expr) * (Val * Expr)) option /// Recognise a sequential or binding construct in a resumable code val (|SequentialResumableCode|_|): g: TcGlobals -> Expr -> (Expr * Expr * range * (Expr -> Expr -> Expr)) option @@ -2494,16 +2561,18 @@ val (|ResumeAtExpr|_|): g: TcGlobals -> Expr -> Expr option val (|WhileExpr|_|): Expr -> (DebugPointAtWhile * SpecialWhileLoopMarker * Expr * Expr * range) option /// Recognise an integer for-loop expression -val (|IntegerForLoopExpr|_|): Expr -> (DebugPointAtFor * DebugPointAtInOrTo * ForLoopStyle * Expr * Expr * Val * Expr * range) option +val (|IntegerForLoopExpr|_|): + Expr -> (DebugPointAtFor * DebugPointAtInOrTo * ForLoopStyle * Expr * Expr * Val * Expr * range) option /// Recognise a try-with expression -val (|TryWithExpr|_|): Expr -> (DebugPointAtTry * DebugPointAtWith * TType * Expr * Val * Expr * Val * Expr * range) option +val (|TryWithExpr|_|): + Expr -> (DebugPointAtTry * DebugPointAtWith * TType * Expr * Val * Expr * Val * Expr * range) option /// Recognise a try-finally expression val (|TryFinallyExpr|_|): Expr -> (DebugPointAtTry * DebugPointAtFinally * TType * Expr * Expr * range) option /// Add a label to use as the target for a goto -val mkLabelled: range -> ILCodeLabel -> Expr -> Expr +val mkLabelled: range -> ILCodeLabel -> Expr -> Expr /// Any delegate type with ResumableCode attribute, or any function returning such a delegate type val isResumableCodeTy: TcGlobals -> TType -> bool @@ -2513,34 +2582,23 @@ val isReturnsResumableCodeTy: TcGlobals -> TType -> bool /// Shared helper for binding attributes val TryBindTyconRefAttribute: - g:TcGlobals -> - m:range -> + g: TcGlobals -> + m: range -> BuiltinAttribInfo -> - tcref:TyconRef -> - f1:(ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> - f2:(Attrib -> 'a option) -> - f3:(obj option list * (string * obj option) list -> 'a option) - -> 'a option + tcref: TyconRef -> + f1: (ILAttribElem list * ILAttributeNamedArg list -> 'a option) -> + f2: (Attrib -> 'a option) -> + f3: (obj option list * (string * obj option) list -> 'a option) -> + 'a option val (|ResumableCodeInvoke|_|): - g:TcGlobals -> - expr: Expr -> - (Expr * Expr * Expr list * range * (Expr * Expr list -> Expr)) option + g: TcGlobals -> expr: Expr -> (Expr * Expr * Expr list * range * (Expr * Expr list -> Expr)) option -val (|OpPipeRight|_|): - g:TcGlobals -> - expr: Expr -> - (TType * Expr * Expr * range) option +val (|OpPipeRight|_|): g: TcGlobals -> expr: Expr -> (TType * Expr * Expr * range) option -val (|OpPipeRight2|_|): - g:TcGlobals -> - expr: Expr -> - (TType * Expr * Expr * Expr * range) option +val (|OpPipeRight2|_|): g: TcGlobals -> expr: Expr -> (TType * Expr * Expr * Expr * range) option -val (|OpPipeRight3|_|): - g:TcGlobals -> - expr: Expr -> - (TType * Expr * Expr * Expr * Expr * range) option +val (|OpPipeRight3|_|): g: TcGlobals -> expr: Expr -> (TType * Expr * Expr * Expr * Expr * range) option val mkDebugPoint: m: range -> expr: Expr -> Expr @@ -2548,4 +2606,4 @@ val mkDebugPoint: m: range -> expr: Expr -> Expr val (|IfThenElseExpr|_|): expr: Expr -> (Expr * Expr * Expr) option /// Determine if a value is a method implementing an interface dispatch slot using a private method impl -val ComputeUseMethodImpl: g: TcGlobals -> v: Val -> bool \ No newline at end of file +val ComputeUseMethodImpl: g: TcGlobals -> v: Val -> bool diff --git a/src/fsharp/TypedTreePickle.fsi b/src/fsharp/TypedTreePickle.fsi index a0b7d717ef9..2b511efa917 100644 --- a/src/fsharp/TypedTreePickle.fsi +++ b/src/fsharp/TypedTreePickle.fsi @@ -12,15 +12,13 @@ open FSharp.Compiler.TcGlobals /// Represents deserialized data with a dangling set of CCU fixup thunks indexed by name [] type PickledDataWithReferences<'RawData> = - { - /// The data that uses a collection of CcuThunks internally + { /// The data that uses a collection of CcuThunks internally RawData: 'RawData /// The assumptions that need to be fixed up - FixupThunks: CcuThunk [] - } + FixupThunks: CcuThunk [] } - member Fixup : (CcuReference -> CcuThunk) -> 'RawData + member Fixup: (CcuReference -> CcuThunk) -> 'RawData /// Like Fixup but loader may return None, in which case there is no fixup. member OptionalFixup: (CcuReference -> CcuThunk option) -> 'RawData @@ -32,58 +30,60 @@ type WriterState type pickler<'T> = 'T -> WriterState -> unit /// Serialize a byte -val internal p_byte : int -> WriterState -> unit +val internal p_byte: int -> WriterState -> unit /// Serialize a boolean value -val internal p_bool : bool -> WriterState -> unit +val internal p_bool: bool -> WriterState -> unit /// Serialize an integer -val internal p_int : int -> WriterState -> unit +val internal p_int: int -> WriterState -> unit /// Serialize a string -val internal p_string : string -> WriterState -> unit +val internal p_string: string -> WriterState -> unit /// Serialize a lazy value (eagerly) -val internal p_lazy : pickler<'T> -> Lazy<'T> pickler +val internal p_lazy: pickler<'T> -> Lazy<'T> pickler /// Serialize a tuple of data -val inline internal p_tup2 : pickler<'T1> -> pickler<'T2> -> pickler<'T1 * 'T2> +val inline internal p_tup2: pickler<'T1> -> pickler<'T2> -> pickler<'T1 * 'T2> /// Serialize a tuple of data -val inline internal p_tup3 : pickler<'T1> -> pickler<'T2> -> pickler<'T3> -> pickler<'T1 * 'T2 * 'T3> +val inline internal p_tup3: pickler<'T1> -> pickler<'T2> -> pickler<'T3> -> pickler<'T1 * 'T2 * 'T3> /// Serialize a tuple of data -val inline internal p_tup4 : pickler<'T1> -> pickler<'T2> -> pickler<'T3> -> pickler<'T4> -> pickler<'T1 * 'T2 * 'T3 * 'T4> +val inline internal p_tup4: + pickler<'T1> -> pickler<'T2> -> pickler<'T3> -> pickler<'T4> -> pickler<'T1 * 'T2 * 'T3 * 'T4> /// Serialize an array of data -val internal p_array : pickler<'T> -> pickler<'T[]> +val internal p_array: pickler<'T> -> pickler<'T []> /// Serialize a namemap of data -val internal p_namemap : pickler<'T> -> pickler> +val internal p_namemap: pickler<'T> -> pickler> /// Serialize a TAST constant -val internal p_const : pickler +val internal p_const: pickler /// Serialize a TAST value reference -val internal p_vref : string -> pickler +val internal p_vref: string -> pickler /// Serialize a TAST type or entity reference -val internal p_tcref : string -> pickler +val internal p_tcref: string -> pickler /// Serialize a TAST union case reference -val internal p_ucref : pickler +val internal p_ucref: pickler /// Serialize a TAST expression -val internal p_expr : pickler +val internal p_expr: pickler /// Serialize a TAST type -val internal p_ty : pickler +val internal p_ty: pickler /// Serialize a TAST description of a compilation unit -val internal pickleCcuInfo : pickler +val internal pickleCcuInfo: pickler /// Serialize an arbitrary object using the given pickler -val pickleObjWithDanglingCcus : inMem: bool -> file: string -> TcGlobals -> scope:CcuThunk -> pickler<'T> -> 'T -> ByteBuffer +val pickleObjWithDanglingCcus: + inMem: bool -> file: string -> TcGlobals -> scope: CcuThunk -> pickler<'T> -> 'T -> ByteBuffer /// The type of state unpicklers read from type ReaderState @@ -92,55 +92,62 @@ type ReaderState type unpickler<'T> = ReaderState -> 'T /// Deserialize a byte -val internal u_byte : ReaderState -> int +val internal u_byte: ReaderState -> int /// Deserialize a bool -val internal u_bool : ReaderState -> bool +val internal u_bool: ReaderState -> bool /// Deserialize an integer -val internal u_int : ReaderState -> int +val internal u_int: ReaderState -> int /// Deserialize a string -val internal u_string : ReaderState -> string +val internal u_string: ReaderState -> string /// Deserialize a lazy value (eagerly) -val internal u_lazy : unpickler<'T> -> unpickler> +val internal u_lazy: unpickler<'T> -> unpickler> /// Deserialize a tuple -val inline internal u_tup2 : unpickler<'T2> -> unpickler<'T3> -> unpickler<'T2 * 'T3> +val inline internal u_tup2: unpickler<'T2> -> unpickler<'T3> -> unpickler<'T2 * 'T3> /// Deserialize a tuple -val inline internal u_tup3 : unpickler<'T2> -> unpickler<'T3> -> unpickler<'T4> -> unpickler<'T2 * 'T3 * 'T4> +val inline internal u_tup3: unpickler<'T2> -> unpickler<'T3> -> unpickler<'T4> -> unpickler<'T2 * 'T3 * 'T4> /// Deserialize a tuple -val inline internal u_tup4 : unpickler<'T2> -> unpickler<'T3> -> unpickler<'T4> -> unpickler<'T5> -> unpickler<'T2 * 'T3 * 'T4 * 'T5> +val inline internal u_tup4: + unpickler<'T2> -> unpickler<'T3> -> unpickler<'T4> -> unpickler<'T5> -> unpickler<'T2 * 'T3 * 'T4 * 'T5> /// Deserialize an array of values -val internal u_array : unpickler<'T> -> unpickler<'T[]> +val internal u_array: unpickler<'T> -> unpickler<'T []> /// Deserialize a namemap -val internal u_namemap : unpickler<'T> -> unpickler> +val internal u_namemap: unpickler<'T> -> unpickler> /// Deserialize a TAST constant -val internal u_const : unpickler +val internal u_const: unpickler /// Deserialize a TAST value reference -val internal u_vref : unpickler +val internal u_vref: unpickler /// Deserialize a TAST type reference -val internal u_tcref : unpickler +val internal u_tcref: unpickler /// Deserialize a TAST union case reference -val internal u_ucref : unpickler +val internal u_ucref: unpickler /// Deserialize a TAST expression -val internal u_expr : unpickler +val internal u_expr: unpickler /// Deserialize a TAST type -val internal u_ty : unpickler +val internal u_ty: unpickler /// Deserialize a TAST description of a compilation unit -val internal unpickleCcuInfo : ReaderState -> PickledCcuInfo +val internal unpickleCcuInfo: ReaderState -> PickledCcuInfo /// Deserialize an arbitrary object which may have holes referring to other compilation units -val internal unpickleObjWithDanglingCcus : file:string -> viewedScope:ILScopeRef -> ilModule:ILModuleDef option -> 'T unpickler -> ReadOnlyByteMemory -> PickledDataWithReferences<'T> +val internal unpickleObjWithDanglingCcus: + file: string -> + viewedScope: ILScopeRef -> + ilModule: ILModuleDef option -> + 'T unpickler -> + ReadOnlyByteMemory -> + PickledDataWithReferences<'T> diff --git a/src/fsharp/UnicodeLexing.fsi b/src/fsharp/UnicodeLexing.fsi index a63cc4d6bb2..c96fce004df 100644 --- a/src/fsharp/UnicodeLexing.fsi +++ b/src/fsharp/UnicodeLexing.fsi @@ -11,7 +11,8 @@ type Lexbuf = LexBuffer val internal StringAsLexbuf: reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * string -> Lexbuf -val public FunctionAsLexbuf: reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * (char [] * int * int -> int) -> Lexbuf +val public FunctionAsLexbuf: + reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * (char [] * int * int -> int) -> Lexbuf val public SourceTextAsLexbuf: reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * ISourceText -> Lexbuf diff --git a/src/fsharp/XmlAdapters.fsi b/src/fsharp/XmlAdapters.fsi index eb45763930c..bff4a2bd549 100644 --- a/src/fsharp/XmlAdapters.fsi +++ b/src/fsharp/XmlAdapters.fsi @@ -2,8 +2,8 @@ module internal Internal.Utilities.XmlAdapters - val s_escapeChars : char [] +val s_escapeChars: char [] - val getEscapeSequence : c:char -> string +val getEscapeSequence: c: char -> string - val escape : str:string -> string +val escape: str: string -> string diff --git a/src/fsharp/XmlDoc.fsi b/src/fsharp/XmlDoc.fsi index 327b509c261..5973ccd3b75 100644 --- a/src/fsharp/XmlDoc.fsi +++ b/src/fsharp/XmlDoc.fsi @@ -9,13 +9,13 @@ open FSharp.Compiler.AbstractIL.IL [] type public XmlDoc = - new: unprocessedLines:string [] * range:range -> XmlDoc + new: unprocessedLines: string [] * range: range -> XmlDoc /// Merge two XML documentation - static member Merge: doc1:XmlDoc -> doc2:XmlDoc -> XmlDoc + static member Merge: doc1: XmlDoc -> doc2: XmlDoc -> XmlDoc /// Check the XML documentation - member internal Check: paramNamesOpt:string list option -> unit + member internal Check: paramNamesOpt: string list option -> unit /// Get the lines after insertion of implicit summary tags and encoding member GetElaboratedXmlLines: unit -> string [] @@ -33,7 +33,7 @@ type public XmlDoc = member UnprocessedLines: string [] static member Empty: XmlDoc - + /// Used to collect XML documentation during lexing and parsing. type internal XmlDocCollector = @@ -43,7 +43,7 @@ type internal XmlDocCollector = member AddGrabPointDelayed: pos: pos -> unit - member AddXmlDocLine: line:string * range:range -> unit + member AddXmlDocLine: line: string * range: range -> unit member LinesBefore: grabPointPos: pos -> (string * range) [] @@ -55,13 +55,13 @@ type internal XmlDocCollector = [] type public PreXmlDoc = - static member internal CreateFromGrabPoint: collector:XmlDocCollector * grabPointPos: pos -> PreXmlDoc + static member internal CreateFromGrabPoint: collector: XmlDocCollector * grabPointPos: pos -> PreXmlDoc + + static member Merge: a: PreXmlDoc -> b: PreXmlDoc -> PreXmlDoc - static member Merge: a:PreXmlDoc -> b:PreXmlDoc -> PreXmlDoc - - static member Create: unprocessedLines:string [] * range:range -> PreXmlDoc + static member Create: unprocessedLines: string [] * range: range -> PreXmlDoc - member ToXmlDoc: check:bool * paramNamesOpt:string list option -> XmlDoc + member ToXmlDoc: check: bool * paramNamesOpt: string list option -> XmlDoc member internal Range: Range @@ -74,10 +74,10 @@ type public PreXmlDoc = [] type internal XmlDocumentationInfo = - member TryGetXmlDocBySig : xmlDocSig: string -> XmlDoc option + member TryGetXmlDocBySig: xmlDocSig: string -> XmlDoc option - static member TryCreateFromFile : xmlFileName: string -> XmlDocumentationInfo option + static member TryCreateFromFile: xmlFileName: string -> XmlDocumentationInfo option type internal IXmlDocumentationInfoLoader = - abstract TryLoad : assemblyFileName: string * ILModuleDef -> XmlDocumentationInfo option + abstract TryLoad: assemblyFileName: string * ILModuleDef -> XmlDocumentationInfo option diff --git a/src/fsharp/XmlDocFileWriter.fsi b/src/fsharp/XmlDocFileWriter.fsi index 9a72c162e2a..019e23de751 100644 --- a/src/fsharp/XmlDocFileWriter.fsi +++ b/src/fsharp/XmlDocFileWriter.fsi @@ -7,12 +7,12 @@ open FSharp.Compiler.TcGlobals module XmlDocWriter = - /// Writes the XML document signature to the XmlDocSig property of each + /// Writes the XML document signature to the XmlDocSig property of each /// element (field, union case, etc) of the specified compilation unit. /// The XmlDocSig is the unique identifier of this XmlDoc in the generated Xml documentation file. /// The full format is described at https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments#id-string-format val ComputeXmlDocSigs: tcGlobals: TcGlobals * generatedCcu: CcuThunk -> unit - /// Writes the XmlDocSig property of each element (field, union case, etc) + /// Writes the XmlDocSig property of each element (field, union case, etc) /// of the specified compilation unit to an XML document in a new text file. val WriteXmlDocFile: g: TcGlobals * assemblyName: string * generatedCcu: CcuThunk * xmlfile: string -> unit diff --git a/src/fsharp/autobox.fsi b/src/fsharp/autobox.fsi index 00feb25f75a..1c2f32b13a6 100644 --- a/src/fsharp/autobox.fsi +++ b/src/fsharp/autobox.fsi @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.AutoBox +module internal FSharp.Compiler.AutoBox open FSharp.Compiler.Import open FSharp.Compiler.TcGlobals @@ -8,5 +8,3 @@ open FSharp.Compiler.TypedTree /// Rewrite mutable locals to reference cells across an entire implementation file val TransformImplFile: g: TcGlobals -> amap: ImportMap -> implFile: TypedImplFile -> TypedImplFile - - diff --git a/src/fsharp/block.fsi b/src/fsharp/block.fsi index ec7ef7fa5a0..13f53ee479b 100644 --- a/src/fsharp/block.fsi +++ b/src/fsharp/block.fsi @@ -12,7 +12,7 @@ type blockbuilder<'T> = ImmutableArray<'T>.Builder [] module BlockBuilder = - val create : size: int -> blockbuilder<'T> + val create: size: int -> blockbuilder<'T> [] module Block = @@ -20,44 +20,44 @@ module Block = [] val empty<'T> : block<'T> - val init : n: int -> f: (int -> 'T) -> block<'T> + val init: n: int -> f: (int -> 'T) -> block<'T> - val iter : f: ('T -> unit) -> block<'T> -> unit + val iter: f: ('T -> unit) -> block<'T> -> unit - val iteri : f: (int -> 'T -> unit) -> block<'T> -> unit + val iteri: f: (int -> 'T -> unit) -> block<'T> -> unit - val iter2 : f: ('T1 -> 'T2 -> unit) -> block<'T1> -> block<'T2> -> unit + val iter2: f: ('T1 -> 'T2 -> unit) -> block<'T1> -> block<'T2> -> unit - val iteri2 : f: (int -> 'T1 -> 'T2 -> unit) -> block<'T1> -> block<'T2> -> unit + val iteri2: f: (int -> 'T1 -> 'T2 -> unit) -> block<'T1> -> block<'T2> -> unit - val map : mapper: ('T1 -> 'T2) -> block<'T1> -> block<'T2> + val map: mapper: ('T1 -> 'T2) -> block<'T1> -> block<'T2> - val mapi : mapper: (int -> 'T1 -> 'T2) -> block<'T1> -> block<'T2> + val mapi: mapper: (int -> 'T1 -> 'T2) -> block<'T1> -> block<'T2> - val concat : block> -> block<'T> + val concat: block> -> block<'T> - val forall : predicate: ('T -> bool) -> block<'T> -> bool + val forall: predicate: ('T -> bool) -> block<'T> -> bool - val forall2 : predicate: ('T1 -> 'T2 -> bool) -> block<'T1> -> block<'T2> -> bool + val forall2: predicate: ('T1 -> 'T2 -> bool) -> block<'T1> -> block<'T2> -> bool - val tryFind : predicate: ('T -> bool) -> block<'T> -> 'T option + val tryFind: predicate: ('T -> bool) -> block<'T> -> 'T option - val tryFindIndex : predicate: ('T -> bool) -> block<'T> -> int option + val tryFindIndex: predicate: ('T -> bool) -> block<'T> -> int option - val tryPick : chooser: ('T1 -> 'T2 option) -> block<'T1> -> 'T2 option + val tryPick: chooser: ('T1 -> 'T2 option) -> block<'T1> -> 'T2 option - val ofSeq : seq<'T> -> block<'T> + val ofSeq: seq<'T> -> block<'T> - val append : block<'T> -> block<'T> -> block<'T> + val append: block<'T> -> block<'T> -> block<'T> - val createOne : 'T -> block<'T> + val createOne: 'T -> block<'T> - val filter : predicate: ('T -> bool) -> block<'T> -> block<'T> + val filter: predicate: ('T -> bool) -> block<'T> -> block<'T> - val exists : predicate: ('T -> bool) -> block<'T> -> bool + val exists: predicate: ('T -> bool) -> block<'T> -> bool - val choose : chooser: ('T -> 'U option) -> block<'T> -> block<'U> + val choose: chooser: ('T -> 'U option) -> block<'T> -> block<'U> - val isEmpty : block<'T> -> bool + val isEmpty: block<'T> -> bool - val fold : folder: ('State -> 'T -> 'State) -> 'State -> block<'T> -> 'State \ No newline at end of file + val fold: folder: ('State -> 'T -> 'State) -> 'State -> block<'T> -> 'State diff --git a/src/fsharp/fsc.fsi b/src/fsharp/fsc.fsi index 8de6f416740..51593c20689 100755 --- a/src/fsharp/fsc.fsi +++ b/src/fsharp/fsc.fsi @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.Driver +module internal FSharp.Compiler.Driver open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL @@ -15,50 +15,49 @@ open FSharp.Compiler.TcGlobals [] type ErrorLoggerProvider = - new : unit -> ErrorLoggerProvider - abstract CreateErrorLoggerUpToMaxErrors : tcConfigBuilder : TcConfigBuilder * exiter : Exiter -> ErrorLogger + new: unit -> ErrorLoggerProvider + abstract CreateErrorLoggerUpToMaxErrors: tcConfigBuilder: TcConfigBuilder * exiter: Exiter -> ErrorLogger /// The default ErrorLoggerProvider implementation, reporting messages to the Console up to the maxerrors maximum -type ConsoleLoggerProvider = - new : unit -> ConsoleLoggerProvider +type ConsoleLoggerProvider = + new: unit -> ConsoleLoggerProvider inherit ErrorLoggerProvider /// The main (non-incremental) compilation entry point used by fsc.exe -val mainCompile: +val mainCompile: ctok: CompilationThreadToken * - argv: string[] * - legacyReferenceResolver: LegacyReferenceResolver * - bannerAlreadyPrinted: bool * - reduceMemoryUsage: ReduceMemoryFlag * - defaultCopyFSharpCore: CopyFSharpCoreFlag * - exiter: Exiter * - loggerProvider: ErrorLoggerProvider * + argv: string [] * + legacyReferenceResolver: LegacyReferenceResolver * + bannerAlreadyPrinted: bool * + reduceMemoryUsage: ReduceMemoryFlag * + defaultCopyFSharpCore: CopyFSharpCoreFlag * + exiter: Exiter * + loggerProvider: ErrorLoggerProvider * tcImportsCapture: (TcImports -> unit) option * - dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option - -> unit + dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> + unit /// An additional compilation entry point used by FSharp.Compiler.Service taking syntax trees as input -val compileOfAst: +val compileOfAst: ctok: CompilationThreadToken * - legacyReferenceResolver: LegacyReferenceResolver * - reduceMemoryUsage: ReduceMemoryFlag * - assemblyName:string * - target:CompilerTarget * - targetDll:string * - targetPdb:string option * - dependencies:string list * - noframework:bool * - exiter:Exiter * - loggerProvider: ErrorLoggerProvider * - inputs:ParsedInput list * - tcImportsCapture : (TcImports -> unit) option * - dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option - -> unit + legacyReferenceResolver: LegacyReferenceResolver * + reduceMemoryUsage: ReduceMemoryFlag * + assemblyName: string * + target: CompilerTarget * + targetDll: string * + targetPdb: string option * + dependencies: string list * + noframework: bool * + exiter: Exiter * + loggerProvider: ErrorLoggerProvider * + inputs: ParsedInput list * + tcImportsCapture: (TcImports -> unit) option * + dynamicAssemblyCreator: (TcConfig * TcGlobals * string * ILModuleDef -> unit) option -> + unit /// Part of LegacyHostedCompilerForTesting -type InProcErrorLoggerProvider = - new : unit -> InProcErrorLoggerProvider - member Provider : ErrorLoggerProvider - member CapturedWarnings : Diagnostic[] - member CapturedErrors : Diagnostic[] - +type InProcErrorLoggerProvider = + new: unit -> InProcErrorLoggerProvider + member Provider: ErrorLoggerProvider + member CapturedWarnings: Diagnostic [] + member CapturedErrors: Diagnostic [] diff --git a/src/fsharp/fsiaux.fsi b/src/fsharp/fsiaux.fsi index 715a346f6d0..791d362b49e 100644 --- a/src/fsharp/fsiaux.fsi +++ b/src/fsharp/fsiaux.fsi @@ -2,91 +2,88 @@ namespace FSharp.Compiler.Interactive - /// An event loop used by the currently executing F# Interactive session to execute code - /// in the context of a GUI or another event-based system. - type IEventLoop = +/// An event loop used by the currently executing F# Interactive session to execute code +/// in the context of a GUI or another event-based system. +type IEventLoop = - /// Run the event loop. - /// - /// True if the event loop was restarted; false otherwise. - abstract Run : unit -> bool + /// Run the event loop. + /// + /// True if the event loop was restarted; false otherwise. + abstract Run: unit -> bool - /// Request that the given operation be run synchronously on the event loop. - /// - /// The result of the operation. - abstract Invoke : (unit -> 'T) -> 'T + /// Request that the given operation be run synchronously on the event loop. + /// + /// The result of the operation. + abstract Invoke: (unit -> 'T) -> 'T - /// Schedule a restart for the event loop. - abstract ScheduleRestart : unit -> unit - - /// Operations supported by the currently executing F# Interactive session. - [] - type InteractiveSession = + /// Schedule a restart for the event loop. + abstract ScheduleRestart: unit -> unit - /// Get or set the floating point format used in the output of the interactive session. - member FloatingPointFormat: string with get,set +/// Operations supported by the currently executing F# Interactive session. +[] +type InteractiveSession = - /// Get or set the format provider used in the output of the interactive session. - member FormatProvider: System.IFormatProvider with get,set + /// Get or set the floating point format used in the output of the interactive session. + member FloatingPointFormat: string with get, set - /// Get or set the print width of the interactive session. - member PrintWidth : int with get,set + /// Get or set the format provider used in the output of the interactive session. + member FormatProvider: System.IFormatProvider with get, set - /// Get or set the print depth of the interactive session. - member PrintDepth : int with get,set + /// Get or set the print width of the interactive session. + member PrintWidth: int with get, set - /// Get or set the total print length of the interactive session. - member PrintLength : int with get,set + /// Get or set the print depth of the interactive session. + member PrintDepth: int with get, set - /// Get or set the total print size of the interactive session. - member PrintSize : int with get,set + /// Get or set the total print length of the interactive session. + member PrintLength: int with get, set - /// When set to 'false', disables the display of properties of evaluated objects in the output of the interactive session. - member ShowProperties : bool with get,set + /// Get or set the total print size of the interactive session. + member PrintSize: int with get, set - /// When set to 'false', disables the display of sequences in the output of the interactive session. - member ShowIEnumerable: bool with get,set + /// When set to 'false', disables the display of properties of evaluated objects in the output of the interactive session. + member ShowProperties: bool with get, set - /// When set to 'false', disables the display of declaration values in the output of the interactive session. - member ShowDeclarationValues: bool with get,set + /// When set to 'false', disables the display of sequences in the output of the interactive session. + member ShowIEnumerable: bool with get, set - /// Register a printer that controls the output of the interactive session. - member AddPrinter: ('T -> string) -> unit + /// When set to 'false', disables the display of declaration values in the output of the interactive session. + member ShowDeclarationValues: bool with get, set - /// Register a print transformer that controls the output of the interactive session. - member AddPrintTransformer: ('T -> obj) -> unit + /// Register a printer that controls the output of the interactive session. + member AddPrinter: ('T -> string) -> unit - member internal AddedPrinters : Choice<(System.Type * (obj -> string)), - (System.Type * (obj -> obj))> list + /// Register a print transformer that controls the output of the interactive session. + member AddPrintTransformer: ('T -> obj) -> unit - /// The command line arguments after ignoring the arguments relevant to the interactive - /// environment and replacing the first argument with the name of the last script file, - /// if any. Thus 'fsi.exe test1.fs test2.fs -- hello goodbye' will give arguments - /// 'test2.fs', 'hello', 'goodbye'. This value will normally be different to those - /// returned by System.Environment.GetCommandLineArgs. - member CommandLineArgs : string [] with get,set + member internal AddedPrinters: Choice<(System.Type * (obj -> string)), (System.Type * (obj -> obj))> list - /// Gets or sets a the current event loop being used to process interactions. - member EventLoop: IEventLoop with get,set - - /// Sets the current event loop being used to process interactions. - member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit - + /// The command line arguments after ignoring the arguments relevant to the interactive + /// environment and replacing the first argument with the name of the last script file, + /// if any. Thus 'fsi.exe test1.fs test2.fs -- hello goodbye' will give arguments + /// 'test2.fs', 'hello', 'goodbye'. This value will normally be different to those + /// returned by System.Environment.GetCommandLineArgs. + member CommandLineArgs: string [] with get, set - module Settings = + /// Gets or sets a the current event loop being used to process interactions. + member EventLoop: IEventLoop with get, set - /// The settings associated with the interactive session. - val fsi : InteractiveSession + /// Sets the current event loop being used to process interactions. + member internal SetEventLoop: (unit -> bool) * ((unit -> obj) -> obj) * (unit -> unit) -> unit -// For legacy compatibility with old naming -namespace Microsoft.FSharp.Compiler.Interactive - type IEventLoop = FSharp.Compiler.Interactive.IEventLoop +module Settings = + + /// The settings associated with the interactive session. + val fsi: InteractiveSession - type InteractiveSession = FSharp.Compiler.Interactive.InteractiveSession +// For legacy compatibility with old naming +namespace Microsoft.FSharp.Compiler.Interactive - module Settings = +type IEventLoop = FSharp.Compiler.Interactive.IEventLoop - val fsi : InteractiveSession +type InteractiveSession = FSharp.Compiler.Interactive.InteractiveSession +module Settings = + val fsi: InteractiveSession diff --git a/src/fsharp/import.fsi b/src/fsharp/import.fsi index 7df2e23d79d..86225a22f79 100644 --- a/src/fsharp/import.fsi +++ b/src/fsharp/import.fsi @@ -14,72 +14,86 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.ExtensionTyping #endif -/// Represents an interface to some of the functionality of TcImports, for loading assemblies +/// Represents an interface to some of the functionality of TcImports, for loading assemblies /// and accessing information about generated provided assemblies. -type AssemblyLoader = +type AssemblyLoader = /// Resolve an Abstract IL assembly reference to a Ccu - abstract FindCcuFromAssemblyRef : CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult + abstract FindCcuFromAssemblyRef: CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult - abstract TryFindXmlDocumentationInfo : assemblyName: string -> XmlDocumentationInfo option + abstract TryFindXmlDocumentationInfo: assemblyName: string -> XmlDocumentationInfo option #if !NO_TYPEPROVIDERS /// Get a flag indicating if an assembly is a provided assembly, plus the /// table of information recording remappings from type names in the provided assembly to type /// names in the statically linked, embedded assembly. - abstract GetProvidedAssemblyInfo : CompilationThreadToken * range * Tainted -> bool * ProvidedAssemblyStaticLinkingMap option + abstract GetProvidedAssemblyInfo: + CompilationThreadToken * range * Tainted -> + bool * ProvidedAssemblyStaticLinkingMap option /// Record a root for a [] type to help guide static linking & type relocation - abstract RecordGeneratedTypeRoot : ProviderGeneratedType -> unit + abstract RecordGeneratedTypeRoot: ProviderGeneratedType -> unit #endif /// Represents a context used for converting AbstractIL .NET and provided types to F# internal compiler data structures. /// Also cache the conversion of AbstractIL ILTypeRef nodes, based on hashes of these. /// /// There is normally only one ImportMap for any assembly compilation, though additional instances can be created -/// using tcImports.GetImportMap() if needed, and it is not harmful if multiple instances are used. The object -/// serves as an interface through to the tables stored in the primary TcImports structures defined in CompileOps.fs. +/// using tcImports.GetImportMap() if needed, and it is not harmful if multiple instances are used. The object +/// serves as an interface through to the tables stored in the primary TcImports structures defined in CompileOps.fs. [] type ImportMap = - new : g:TcGlobals * assemblyLoader:AssemblyLoader -> ImportMap - + new: g: TcGlobals * assemblyLoader: AssemblyLoader -> ImportMap + /// The AssemblyLoader for the import context - member assemblyLoader : AssemblyLoader + member assemblyLoader: AssemblyLoader /// The TcGlobals for the import context - member g : TcGlobals + member g: TcGlobals /// Import a reference to a type definition, given an AbstractIL ILTypeRef, with caching -val internal ImportILTypeRef : ImportMap -> range -> ILTypeRef -> TyconRef +val internal ImportILTypeRef: ImportMap -> range -> ILTypeRef -> TyconRef /// Pre-check for ability to import a reference to a type definition, given an AbstractIL ILTypeRef, with caching -val internal CanImportILTypeRef : ImportMap -> range -> ILTypeRef -> bool +val internal CanImportILTypeRef: ImportMap -> range -> ILTypeRef -> bool /// Import an IL type as an F# type. -val internal ImportILType : ImportMap -> range -> TType list -> ILType -> TType +val internal ImportILType: ImportMap -> range -> TType list -> ILType -> TType /// Pre-check for ability to import an IL type as an F# type. -val internal CanImportILType : ImportMap -> range -> ILType -> bool +val internal CanImportILType: ImportMap -> range -> ILType -> bool #if !NO_TYPEPROVIDERS /// Import a provided type as an F# type. -val internal ImportProvidedType : ImportMap -> range -> (* TType list -> *) Tainted -> TType +val internal ImportProvidedType: ImportMap -> range (* TType list -> *) -> Tainted -> TType /// Import a provided type reference as an F# type TyconRef -val internal ImportProvidedNamedType : ImportMap -> range -> (* TType list -> *) Tainted -> TyconRef +val internal ImportProvidedNamedType: ImportMap -> range (* TType list -> *) -> Tainted -> TyconRef /// Import a provided type as an AbstractIL type -val internal ImportProvidedTypeAsILType : ImportMap -> range -> Tainted -> ILType +val internal ImportProvidedTypeAsILType: ImportMap -> range -> Tainted -> ILType /// Import a provided method reference as an Abstract IL method reference -val internal ImportProvidedMethodBaseAsILMethodRef : ImportMap -> range -> Tainted -> ILMethodRef +val internal ImportProvidedMethodBaseAsILMethodRef: ImportMap -> range -> Tainted -> ILMethodRef #endif -/// Import a set of Abstract IL generic parameter specifications as a list of new F# generic parameters. -val internal ImportILGenericParameters : (unit -> ImportMap) -> range -> ILScopeRef -> TType list -> ILGenericParameterDef list -> Typar list +/// Import a set of Abstract IL generic parameter specifications as a list of new F# generic parameters. +val internal ImportILGenericParameters: + (unit -> ImportMap) -> range -> ILScopeRef -> TType list -> ILGenericParameterDef list -> Typar list /// Import an IL assembly as a new TAST CCU -val internal ImportILAssembly : (unit -> ImportMap) * range * (ILScopeRef -> ILModuleDef) * IXmlDocumentationInfoLoader option * ILScopeRef * sourceDir:string * filename: string option * ILModuleDef * IEvent -> CcuThunk +val internal ImportILAssembly: + (unit -> ImportMap) * + range * + (ILScopeRef -> ILModuleDef) * + IXmlDocumentationInfoLoader option * + ILScopeRef * + sourceDir: string * + filename: string option * + ILModuleDef * + IEvent -> + CcuThunk /// Import the type forwarder table for an IL assembly -val internal ImportILAssemblyTypeForwarders : (unit -> ImportMap) * range * ILExportedTypesAndForwarders -> Map> +val internal ImportILAssemblyTypeForwarders: + (unit -> ImportMap) * range * ILExportedTypesAndForwarders -> Map> diff --git a/src/fsharp/infos.fsi b/src/fsharp/infos.fsi index 59a16503c6c..fb4cbd925ef 100644 --- a/src/fsharp/infos.fsi +++ b/src/fsharp/infos.fsi @@ -17,16 +17,16 @@ open FSharp.Compiler.ExtensionTyping #endif /// Import an IL type as an F# type. importInst gives the context for interpreting type variables. -val ImportILType: scoref:ILScopeRef -> amap:ImportMap -> m:range -> importInst:TType list -> ilty:ILType -> TType +val ImportILType: scoref: ILScopeRef -> amap: ImportMap -> m: range -> importInst: TType list -> ilty: ILType -> TType -val CanImportILType: scoref:ILScopeRef -> amap:ImportMap -> m:range -> ilty:ILType -> bool +val CanImportILType: scoref: ILScopeRef -> amap: ImportMap -> m: range -> ilty: ILType -> bool /// Indicates if an F# type is the type associated with an F# exception declaration -val isExnDeclTy: g:TcGlobals -> ty:TType -> bool +val isExnDeclTy: g: TcGlobals -> ty: TType -> bool /// Get the base type of a type, taking into account type instantiations. Return None if the /// type has no base type. -val GetSuperTypeOfType: g:TcGlobals -> amap:ImportMap -> m:range -> ty:TType -> TType option +val GetSuperTypeOfType: g: TcGlobals -> amap: ImportMap -> m: range -> ty: TType -> TType option /// Indicates whether we can skip interface types that lie outside the reference set [] @@ -36,7 +36,8 @@ type SkipUnrefInterfaces = /// Collect the set of immediate declared interface types for an F# type, but do not /// traverse the type hierarchy to collect further interfaces. -val GetImmediateInterfacesOfType: skipUnref:SkipUnrefInterfaces -> g:TcGlobals -> amap:ImportMap -> m:range -> ty:TType -> TType list +val GetImmediateInterfacesOfType: + skipUnref: SkipUnrefInterfaces -> g: TcGlobals -> amap: ImportMap -> m: range -> ty: TType -> TType list /// Indicates whether we should visit multiple instantiations of the same generic interface or not [] @@ -45,50 +46,120 @@ type AllowMultiIntfInstantiations = | No /// Fold, do not follow interfaces (unless the type is itself an interface) -val FoldPrimaryHierarchyOfType: f:(TType -> 'a -> 'a) -> g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> acc:'a -> 'a +val FoldPrimaryHierarchyOfType: + f: (TType -> 'a -> 'a) -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + acc: 'a -> + 'a /// Fold, following interfaces. Skipping interfaces that lie outside the referenced assembly set is allowed. -val FoldEntireHierarchyOfType: f:(TType -> 'a -> 'a) -> g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> acc:'a -> 'a +val FoldEntireHierarchyOfType: + f: (TType -> 'a -> 'a) -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + acc: 'a -> + 'a /// Iterate, following interfaces. Skipping interfaces that lie outside the referenced assembly set is allowed. -val IterateEntireHierarchyOfType: f:(TType -> unit) -> g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> unit +val IterateEntireHierarchyOfType: + f: (TType -> unit) -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + unit /// Search for one element satisfying a predicate, following interfaces -val ExistsInEntireHierarchyOfType: f:(TType -> bool) -> g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> bool +val ExistsInEntireHierarchyOfType: + f: (TType -> bool) -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + bool /// Search for one element where a function returns a 'Some' result, following interfaces -val SearchEntireHierarchyOfType: f:(TType -> bool) -> g:TcGlobals -> amap:ImportMap -> m:range -> ty:TType -> TType option +val SearchEntireHierarchyOfType: + f: (TType -> bool) -> g: TcGlobals -> amap: ImportMap -> m: range -> ty: TType -> TType option /// Get all super types of the type, including the type itself -val AllSuperTypesOfType: g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> TType list +val AllSuperTypesOfType: + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + TType list /// Get all interfaces of a type, including the type itself if it is an interface -val AllInterfacesOfType: g:TcGlobals -> amap:ImportMap -> m:range -> allowMultiIntfInst:AllowMultiIntfInstantiations -> ty:TType -> TType list +val AllInterfacesOfType: + g: TcGlobals -> + amap: ImportMap -> + m: range -> + allowMultiIntfInst: AllowMultiIntfInstantiations -> + ty: TType -> + TType list /// Check if two types have the same nominal head type -val HaveSameHeadType: g:TcGlobals -> ty1:TType -> ty2:TType -> bool +val HaveSameHeadType: g: TcGlobals -> ty1: TType -> ty2: TType -> bool /// Check if a type has a particular head type -val HasHeadType: g:TcGlobals -> tcref:TyconRef -> ty2:TType -> bool +val HasHeadType: g: TcGlobals -> tcref: TyconRef -> ty2: TType -> bool /// Check if a type exists somewhere in the hierarchy which has the same head type as the given type (note, the given type need not have a head type at all) -val ExistsSameHeadTypeInHierarchy: g:TcGlobals -> amap:ImportMap -> m:range -> typeToSearchFrom:TType -> typeToLookFor:TType -> bool +val ExistsSameHeadTypeInHierarchy: + g: TcGlobals -> amap: ImportMap -> m: range -> typeToSearchFrom: TType -> typeToLookFor: TType -> bool /// Check if a type exists somewhere in the hierarchy which has the given head type. -val ExistsHeadTypeInEntireHierarchy: g:TcGlobals -> amap:ImportMap -> m:range -> typeToSearchFrom:TType -> tcrefToLookFor:TyconRef -> bool +val ExistsHeadTypeInEntireHierarchy: + g: TcGlobals -> amap: ImportMap -> m: range -> typeToSearchFrom: TType -> tcrefToLookFor: TyconRef -> bool /// Read an Abstract IL type from metadata and convert to an F# type. -val ImportILTypeFromMetadata: amap:ImportMap -> m:range -> scoref:ILScopeRef -> tinst:TType list -> minst:TType list -> ilty:ILType -> TType +val ImportILTypeFromMetadata: + amap: ImportMap -> m: range -> scoref: ILScopeRef -> tinst: TType list -> minst: TType list -> ilty: ILType -> TType /// Read an Abstract IL type from metadata, including any attributes that may affect the type itself, and convert to an F# type. -val ImportILTypeFromMetadataWithAttributes: amap:ImportMap -> m:range -> scoref:ILScopeRef -> tinst:TType list -> minst:TType list -> ilty:ILType -> getCattrs: (unit -> ILAttributes) -> TType +val ImportILTypeFromMetadataWithAttributes: + amap: ImportMap -> + m: range -> + scoref: ILScopeRef -> + tinst: TType list -> + minst: TType list -> + ilty: ILType -> + getCattrs: (unit -> ILAttributes) -> + TType /// Get the parameter type of an IL method. -val ImportParameterTypeFromMetadata: amap:ImportMap -> m:range -> ilty:ILType -> getCattrs: (unit -> ILAttributes) -> scoref:ILScopeRef -> tinst:TType list -> mist:TType list -> TType +val ImportParameterTypeFromMetadata: + amap: ImportMap -> + m: range -> + ilty: ILType -> + getCattrs: (unit -> ILAttributes) -> + scoref: ILScopeRef -> + tinst: TType list -> + mist: TType list -> + TType /// Get the return type of an IL method, taking into account instantiations for type, return attributes and method generic parameters, and /// translating 'void' to 'None'. -val ImportReturnTypeFromMetadata: amap:ImportMap -> m:range -> ilty:ILType -> getCattrs: (unit -> ILAttributes) -> scoref:ILScopeRef -> tinst:TType list -> minst:TType list -> TType option +val ImportReturnTypeFromMetadata: + amap: ImportMap -> + m: range -> + ilty: ILType -> + getCattrs: (unit -> ILAttributes) -> + scoref: ILScopeRef -> + tinst: TType list -> + minst: TType list -> + TType option /// Copy constraints. If the constraint comes from a type parameter associated /// with a type constructor then we are simply renaming type variables. If it comes @@ -98,15 +169,21 @@ val ImportReturnTypeFromMetadata: amap:ImportMap -> m:range -> ilty:ILType -> ge /// /// Note: this now looks identical to constraint instantiation. -val CopyTyparConstraints: m:range -> tprefInst:TyparInst -> tporig:Typar -> TyparConstraint list +val CopyTyparConstraints: m: range -> tprefInst: TyparInst -> tporig: Typar -> TyparConstraint list /// The constraints for each typar copied from another typar can only be fixed up once /// we have generated all the new constraints, e.g. f List, B :> List> ... -val FixupNewTypars: m:range -> formalEnclosingTypars:Typars -> tinst:TType list -> tpsorig:Typars -> tps:Typars -> TyparInst * TTypes +val FixupNewTypars: + m: range -> + formalEnclosingTypars: Typars -> + tinst: TType list -> + tpsorig: Typars -> + tps: Typars -> + TyparInst * TTypes type ValRef with /// Indicates if an F#-declared function or member value is a CLIEvent property compiled as a .NET event - member IsFSharpEventProperty: g:TcGlobals -> bool + member IsFSharpEventProperty: g: TcGlobals -> bool /// Check if an F#-declared member value is a virtual method member IsVirtualMember: bool @@ -118,24 +195,26 @@ type ValRef with member IsDefiniteFSharpOverrideMember: bool /// Check if an F#-declared member value is an explicit interface member implementation - member IsFSharpExplicitInterfaceImplementation: g:TcGlobals -> bool + member IsFSharpExplicitInterfaceImplementation: g: TcGlobals -> bool member ImplementedSlotSignatures: SlotSig list #if !NO_TYPEPROVIDERS /// Get the return type of a provided method, where 'void' is returned as 'None' -val GetCompiledReturnTyOfProvidedMethodInfo: amap:ImportMap ->m:range -> mi:Tainted -> TType option +val GetCompiledReturnTyOfProvidedMethodInfo: + amap: ImportMap -> m: range -> mi: Tainted -> TType option #endif /// The slotsig returned by methInfo.GetSlotSig is in terms of the type parameters on the parent type of the overriding method. /// Reverse-map the slotsig so it is in terms of the type parameters for the overriding method -val ReparentSlotSigToUseMethodTypars: g:TcGlobals -> m:range -> ovByMethValRef:ValRef -> slotsig:SlotSig -> SlotSig +val ReparentSlotSigToUseMethodTypars: g: TcGlobals -> m: range -> ovByMethValRef: ValRef -> slotsig: SlotSig -> SlotSig /// Construct the data representing a parameter in the signature of an abstract method slot -val MakeSlotParam: ty:TType * argInfo:ArgReprInfo -> SlotParam +val MakeSlotParam: ty: TType * argInfo: ArgReprInfo -> SlotParam /// Construct the data representing the signature of an abstract method slot -val MakeSlotSig: nm:string * ty:TType * ctps:Typars * mtps:Typars * paraml:SlotParam list list * retTy:TType option -> SlotSig +val MakeSlotSig: + nm: string * ty: TType * ctps: Typars * mtps: Typars * paraml: SlotParam list list * retTy: TType option -> SlotSig /// Describes the sequence order of the introduction of an extension method. Extension methods that are introduced /// later through 'open' get priority in overload resolution. @@ -163,63 +242,71 @@ type OptionalArgInfo = /// in fact the default value is read from the metadata and passed explicitly to the callee on the caller side. | CallerSide of OptionalArgCallerSideValue - static member FieldInitForDefaultParameterValueAttrib: attrib:Attrib -> ILFieldInit option + static member FieldInitForDefaultParameterValueAttrib: attrib: Attrib -> ILFieldInit option /// Compute the OptionalArgInfo for an IL parameter /// /// This includes the Visual Basic rules for IDispatchConstant and IUnknownConstant and optional arguments. - static member FromILParameter: g:TcGlobals -> amap:ImportMap -> m:range -> ilScope:ILScopeRef -> ilTypeInst:TType list -> ilParam:ILParameter -> OptionalArgInfo + static member FromILParameter: + g: TcGlobals -> + amap: ImportMap -> + m: range -> + ilScope: ILScopeRef -> + ilTypeInst: TType list -> + ilParam: ILParameter -> + OptionalArgInfo static member ValueOfDefaultParameterValueAttrib: Attrib -> Expr option member IsOptional: bool - + type CallerInfo = | NoCallerInfo | CallerLineNumber | CallerMemberName | CallerFilePath - + [] type ReflectedArgInfo = | None | Quote of bool member AutoQuote: bool - + /// Partial information about a parameter returned for use by the Language Service [] type ParamNameAndType = | ParamNameAndType of Ident option * TType - static member FromArgInfo: ty:TType * argInfo:ArgReprInfo -> ParamNameAndType + static member FromArgInfo: ty: TType * argInfo: ArgReprInfo -> ParamNameAndType - static member FromMember: isCSharpExtMem:bool -> g:TcGlobals -> vref:ValRef -> ParamNameAndType list list + static member FromMember: isCSharpExtMem: bool -> g: TcGlobals -> vref: ValRef -> ParamNameAndType list list - static member Instantiate: inst:TyparInst -> p:ParamNameAndType -> ParamNameAndType + static member Instantiate: inst: TyparInst -> p: ParamNameAndType -> ParamNameAndType + + static member InstantiateCurried: + inst: TyparInst -> paramTypes: ParamNameAndType list list -> ParamNameAndType list list - static member InstantiateCurried: inst:TyparInst -> paramTypes:ParamNameAndType list list -> ParamNameAndType list list - /// Full information about a parameter returned for use by the type checker and language service. [] type ParamData = | ParamData of - isParamArray: bool * - isInArg: bool * - isOut: bool * - optArgInfo: OptionalArgInfo * - callerInfo: CallerInfo * - nameOpt: Ident option * - reflArgInfo: ReflectedArgInfo * - ttype: TType + isParamArray: bool * + isInArg: bool * + isOut: bool * + optArgInfo: OptionalArgInfo * + callerInfo: CallerInfo * + nameOpt: Ident option * + reflArgInfo: ReflectedArgInfo * + ttype: TType /// Describes an F# use of an IL type, including the type instantiation associated with the type at a particular usage point. [] type ILTypeInfo = | ILTypeInfo of TcGlobals * TType * ILTypeRef * ILTypeDef - static member FromType: g:TcGlobals -> ty:TType -> ILTypeInfo + static member FromType: g: TcGlobals -> ty: TType -> ILTypeInfo - member Instantiate: inst:TyparInst -> ILTypeInfo + member Instantiate: inst: TyparInst -> ILTypeInfo member ILScopeRef: ILScopeRef @@ -241,11 +328,16 @@ type ILTypeInfo = member TyconRefOfRawMetadata: TyconRef member TypeInstOfRawMetadata: TypeInst - + /// Describes an F# use of an IL method. [] type ILMethInfo = - | ILMethInfo of g: TcGlobals * ilApparentType: TType * ilDeclaringTyconRefOpt: TyconRef option * ilMethodDef: ILMethodDef * ilGenericMethodTyArgs: Typars + | ILMethInfo of + g: TcGlobals * + ilApparentType: TType * + ilDeclaringTyconRefOpt: TyconRef option * + ilMethodDef: ILMethodDef * + ilGenericMethodTyArgs: Typars /// Like ApparentEnclosingType but use the compiled nominal type if this is a method on a tuple type member ApparentEnclosingAppType: TType @@ -320,45 +412,49 @@ type ILMethInfo = member RawMetadata: ILMethodDef member TcGlobals: TcGlobals - + /// Get the compiled return type of the method, where 'void' is None. - member GetCompiledReturnTy: amap:ImportMap * m:range * minst:TType list -> TType option + member GetCompiledReturnTy: amap: ImportMap * m: range * minst: TType list -> TType option /// Get the F# view of the return type of the method, where 'void' is 'unit'. - member GetFSharpReturnTy: amap:ImportMap * m:range * minst:TType list -> TType + member GetFSharpReturnTy: amap: ImportMap * m: range * minst: TType list -> TType /// Get the (zero or one) 'self'/'this'/'object' arguments associated with an IL method. /// An instance extension method returns one object argument. - member GetObjArgTypes: amap:ImportMap * m:range * minst:TType list -> TType list + member GetObjArgTypes: amap: ImportMap * m: range * minst: TType list -> TType list /// Get info about the arguments of the IL method. If this is an C#-style extension method then /// drop the object argument. /// /// Any type parameters of the enclosing type are instantiated in the type returned. - member GetParamNamesAndTypes: amap:ImportMap * m:range * minst:TType list -> ParamNameAndType list + member GetParamNamesAndTypes: amap: ImportMap * m: range * minst: TType list -> ParamNameAndType list /// Get the argument types of the the IL method. If this is an C#-style extension method /// then drop the object argument. - member GetParamTypes: amap:ImportMap * m:range * minst:TType list -> TType list + member GetParamTypes: amap: ImportMap * m: range * minst: TType list -> TType list /// Get all the argument types of the IL method. Include the object argument even if this is /// an C#-style extension method. - member GetRawArgTypes: amap:ImportMap * m:range * minst:TType list -> TType list + member GetRawArgTypes: amap: ImportMap * m: range * minst: TType list -> TType list /// Indicates if the method is marked as a DllImport (a PInvoke). This is done by looking at the IL custom attributes on /// the method. - member IsDllImport: g:TcGlobals -> bool + member IsDllImport: g: TcGlobals -> bool /// Indicates if the method is marked with the [] attribute. This is done by looking at the IL custom attributes on /// the method. - member IsReadOnly: g:TcGlobals -> bool + member IsReadOnly: g: TcGlobals -> bool /// Describes an F# use of a method [] type MethInfo = /// Describes a use of a method declared in F# code and backed by F# metadata. - | FSMeth of tcGlobals: TcGlobals * enclosingType: TType * valRef: ValRef * extensionMethodPriority: ExtensionMethodPriority option + | FSMeth of + tcGlobals: TcGlobals * + enclosingType: TType * + valRef: ValRef * + extensionMethodPriority: ExtensionMethodPriority option /// Describes a use of a method backed by Abstract IL # metadata | ILMeth of tcGlobals: TcGlobals * ilMethInfo: ILMethInfo * extensionMethodPriority: ExtensionMethodPriority option @@ -368,7 +464,11 @@ type MethInfo = #if !NO_TYPEPROVIDERS /// Describes a use of a method backed by provided metadata - | ProvidedMeth of amap: ImportMap * methodBase: Tainted * extensionMethodPriority: ExtensionMethodPriority option * m: range + | ProvidedMeth of + amap: ImportMap * + methodBase: Tainted * + extensionMethodPriority: ExtensionMethodPriority option * + m: range #endif /// Get the enclosing type of the method info, using a nominal type for tuple types @@ -385,7 +485,7 @@ type MethInfo = /// Try to get an arbitrary F# ValRef associated with the member. This is to determine if the member is virtual, amongst other things. member ArbitraryValRef: ValRef option - /// Get the method name in DebuggerDisplayForm + /// Get the method name in DebuggerDisplayForm member DebuggerDisplayName: string /// Get the declaring type or module holding the method. If this is an C#-style extension method then this is the type @@ -501,7 +601,7 @@ type MethInfo = /// For an extension member, drop the 'this' argument. member NumArgs: int list -/// Get the information about provided static parameters, if any + /// Get the information about provided static parameters, if any #if NO_TYPEPROVIDERS member ProvidedStaticParameterInfo: obj option #else @@ -513,78 +613,86 @@ type MethInfo = /// Get the XML documentation associated with the method member XmlDoc: XmlDoc - + /// Build IL method infos. - static member CreateILMeth: amap:ImportMap * m:range * ty:TType * md:ILMethodDef -> MethInfo + static member CreateILMeth: amap: ImportMap * m: range * ty: TType * md: ILMethodDef -> MethInfo /// Build IL method infos for a C#-style extension method - static member CreateILExtensionMeth: amap:ImportMap * m:range * apparentTy:TType * declaringTyconRef:TyconRef * extMethPri:ExtensionMethodPriority option * md:ILMethodDef -> MethInfo + static member CreateILExtensionMeth: + amap: ImportMap * + m: range * + apparentTy: TType * + declaringTyconRef: TyconRef * + extMethPri: ExtensionMethodPriority option * + md: ILMethodDef -> + MethInfo /// Tests whether two method infos have the same underlying definition. /// Used to merge operator overloads collected from left and right of an operator constraint. /// /// Compatible with ItemsAreEffectivelyEqual relation. - static member MethInfosUseIdenticalDefinitions: x1:MethInfo -> x2:MethInfo -> bool + static member MethInfosUseIdenticalDefinitions: x1: MethInfo -> x2: MethInfo -> bool /// Add the actual type instantiation of the apparent type of an F# extension method. - member AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers: tyargs:TType list -> TType list + member AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers: tyargs: TType list -> TType list /// Calculates a hash code of method info. Compatible with ItemsAreEffectivelyEqual relation. member ComputeHashCode: unit -> int /// Get the return type of a method info, where 'void' is returned as 'None' - member GetCompiledReturnTy: amap:ImportMap * m:range * minst:TType list -> TType option + member GetCompiledReturnTy: amap: ImportMap * m: range * minst: TType list -> TType option /// Get the return type of a method info, where 'void' is returned as 'unit' - member GetFSharpReturnTy: amap:ImportMap * m:range * minst:TType list -> TType + member GetFSharpReturnTy: amap: ImportMap * m: range * minst: TType list -> TType /// Select all the type parameters of the declaring type of a method. /// /// For extension methods, no type parameters are returned, because all the /// type parameters are part of the apparent type, rather the /// declaring type, even for extension methods extending generic types. - member GetFormalTyparsOfDeclaringType: m:range -> Typar list + member GetFormalTyparsOfDeclaringType: m: range -> Typar list /// Get the (zero or one) 'self'/'this'/'object' arguments associated with a method. /// An instance method returns one object argument. - member GetObjArgTypes: amap:ImportMap * m:range * minst:TypeInst -> TType list + member GetObjArgTypes: amap: ImportMap * m: range * minst: TypeInst -> TType list /// Get the parameter attributes of a method info, which get combined with the parameter names and types - member GetParamAttribs: amap:ImportMap * m:range -> (bool * bool * bool * OptionalArgInfo * CallerInfo * ReflectedArgInfo) list list + member GetParamAttribs: + amap: ImportMap * m: range -> (bool * bool * bool * OptionalArgInfo * CallerInfo * ReflectedArgInfo) list list /// Get the ParamData objects for the parameters of a MethInfo - member GetParamDatas: amap:ImportMap * m:range * minst:TType list -> ParamData list list + member GetParamDatas: amap: ImportMap * m: range * minst: TType list -> ParamData list list /// Get the parameter types of a method info - member GetParamTypes: amap:ImportMap * m:range * minst:TType list -> TType list list + member GetParamTypes: amap: ImportMap * m: range * minst: TType list -> TType list list /// Get the signature of an abstract method slot. - member GetSlotSig: amap:ImportMap * m:range -> SlotSig + member GetSlotSig: amap: ImportMap * m: range -> SlotSig /// Get the ParamData objects for the parameters of a MethInfo - member HasParamArrayArg: amap:ImportMap * m:range * minst:TType list -> bool + member HasParamArrayArg: amap: ImportMap * m: range * minst: TType list -> bool /// Apply a type instantiation to a method info, i.e. apply the instantiation to the enclosing type. - member Instantiate: amap:ImportMap * m:range * inst:TyparInst -> MethInfo + member Instantiate: amap: ImportMap * m: range * inst: TyparInst -> MethInfo /// Indicates if this method is an extension member that is read-only. /// An extension member is considered read-only if the first argument is a read-only byref (inref) type. - member IsReadOnlyExtensionMember: amap:ImportMap * m:range -> bool + member IsReadOnlyExtensionMember: amap: ImportMap * m: range -> bool /// Indicates if this is an extension member (e.g. on a struct) that takes a byref arg - member ObjArgNeedsAddress: amap:ImportMap * m:range -> bool + member ObjArgNeedsAddress: amap: ImportMap * m: range -> bool /// Tries to get the object arg type if it's a byref type. - member TryObjArgByrefType: amap:ImportMap * m:range * minst:TypeInst -> TType option + member TryObjArgByrefType: amap: ImportMap * m: range * minst: TypeInst -> TType option /// Represents a single use of a IL or provided field from one point in an F# program [] type ILFieldInfo = - /// Represents a single use of a field backed by Abstract IL metadata + /// Represents a single use of a field backed by Abstract IL metadata | ILFieldInfo of ilTypeInfo: ILTypeInfo * ilFieldDef: ILFieldDef #if !NO_TYPEPROVIDERS - /// Represents a single use of a field backed by provided metadata + /// Represents a single use of a field backed by provided metadata | ProvidedField of amap: ImportMap * providedField: Tainted * range: range #endif @@ -598,34 +706,34 @@ type ILFieldInfo = member DeclaringTyconRef: TyconRef - /// Get the name of the field + /// Get the name of the field member FieldName: string - /// Get an (uninstantiated) reference to the field as an Abstract IL ILFieldRef + /// Get an (uninstantiated) reference to the field as an Abstract IL ILFieldRef member ILFieldRef: ILFieldRef - /// Get the type of the field as an IL type + /// Get the type of the field as an IL type member ILFieldType: ILType - /// Get a reference to the declaring type of the field as an ILTypeRef + /// Get a reference to the declaring type of the field as an ILTypeRef member ILTypeRef: ILTypeRef - /// Indicates if the field is readonly (in the .NET/C# sense of readonly) + /// Indicates if the field is readonly (in the .NET/C# sense of readonly) member IsInitOnly: bool - /// Indicates if the field has the 'specialname' property in the .NET IL + /// Indicates if the field has the 'specialname' property in the .NET IL member IsSpecialName: bool - /// Indicates if the field is static + /// Indicates if the field is static member IsStatic: bool /// Indicates if the field is a member of a struct or enum type member IsValueType: bool - /// Indicates if the field is a literal field with an associated literal value + /// Indicates if the field is a literal field with an associated literal value member LiteralValue: ILFieldInit option - /// Get the scope used to interpret IL metadata + /// Get the scope used to interpret IL metadata member ScopeRef: ILScopeRef member TcGlobals: TcGlobals @@ -635,13 +743,13 @@ type ILFieldInfo = /// Tests whether two infos have the same underlying definition. /// Compatible with ItemsAreEffectivelyEqual relation. - static member ILFieldInfosUseIdenticalDefinitions: x1:ILFieldInfo -> x2:ILFieldInfo -> bool + static member ILFieldInfosUseIdenticalDefinitions: x1: ILFieldInfo -> x2: ILFieldInfo -> bool /// Calculates a hash code of field info. Must be compatible with ItemsAreEffectivelyEqual relation. member ComputeHashCode: unit -> int - /// Get the type of the field as an F# type - member FieldType: amap:ImportMap * m:range -> TType + /// Get the type of the field as an F# type + member FieldType: amap: ImportMap * m: range -> TType /// Describes an F# use of a field in an F#-declared record, class or struct type [] @@ -723,7 +831,7 @@ type UnionCaseInfo = member UnionCaseRef: UnionCaseRef /// Get the instantiation of the type parameters of the declaring type of the union case - member GetTyparInst: m:range -> TyparInst + member GetTyparInst: m: range -> TyparInst /// Describes an F# use of a property backed by Abstract IL metadata [] @@ -770,21 +878,21 @@ type ILPropInfo = /// Get the TcGlobals governing this value member TcGlobals: TcGlobals - + /// Get the names and types of the indexer arguments associated with the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. - member GetParamNamesAndTypes: amap:ImportMap * m:range -> ParamNameAndType list + member GetParamNamesAndTypes: amap: ImportMap * m: range -> ParamNameAndType list /// Get the types of the indexer arguments associated with the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. - member GetParamTypes: amap:ImportMap * m:range -> TType list + member GetParamTypes: amap: ImportMap * m: range -> TType list /// Get the return type of the IL property. /// /// Any type parameters of the enclosing type are instantiated in the type returned. - member GetPropertyType: amap:ImportMap * m:range -> TType + member GetPropertyType: amap: ImportMap * m: range -> TType /// Describes an F# use of a property [] @@ -890,24 +998,24 @@ type PropInfo = /// Test whether two property infos have the same underlying definition. /// Uses the same techniques as 'MethInfosUseIdenticalDefinitions'. /// Compatible with ItemsAreEffectivelyEqual relation. - static member PropInfosUseIdenticalDefinitions: x1:PropInfo -> x2:PropInfo -> bool + static member PropInfosUseIdenticalDefinitions: x1: PropInfo -> x2: PropInfo -> bool /// Calculates a hash code of property info. Must be compatible with ItemsAreEffectivelyEqual relation. member ComputeHashCode: unit -> int /// Get the details of the indexer parameters associated with the property - member GetParamDatas: amap:ImportMap * m:range -> ParamData list + member GetParamDatas: amap: ImportMap * m: range -> ParamData list /// Get the names and types of the indexer parameters associated with the property /// /// If the property is in a generic type, then the type parameters are instantiated in the types returned. - member GetParamNamesAndTypes: amap:ImportMap * m:range -> ParamNameAndType list + member GetParamNamesAndTypes: amap: ImportMap * m: range -> ParamNameAndType list /// Get the types of the indexer parameters associated with the property - member GetParamTypes: amap:ImportMap * m:range -> TType list + member GetParamTypes: amap: ImportMap * m: range -> TType list /// Get the result type of the property - member GetPropertyType: amap:ImportMap * m:range -> TType + member GetPropertyType: amap: ImportMap * m: range -> TType /// Describes an F# use of an event backed by Abstract IL metadata [] @@ -945,7 +1053,7 @@ type ILEventInfo = /// Get the declaring type of the event as an ILTypeRef member TypeRef: ILTypeRef - + /// Describes an F# use of an event [] type EventInfo = @@ -1007,17 +1115,17 @@ type EventInfo = /// Get the intra-assembly XML documentation for the property. member XmlDoc: XmlDoc - + /// Test whether two event infos have the same underlying definition. /// Compatible with ItemsAreEffectivelyEqual relation. - static member EventInfosUseIdenticalDefinitions: x1:EventInfo -> x2:EventInfo -> bool + static member EventInfosUseIdenticalDefinitions: x1: EventInfo -> x2: EventInfo -> bool /// Calculates a hash code of event info (similar as previous) /// Compatible with ItemsAreEffectivelyEqual relation. member ComputeHashCode: unit -> int /// Get the delegate type associated with the event. - member GetDelegateType: amap:ImportMap * m:range -> TType + member GetDelegateType: amap: ImportMap * m: range -> TType /// An exception type used to raise an error using the old error system. /// @@ -1025,40 +1133,71 @@ type EventInfo = exception BadEventTransformation of range /// Create an error object to raise should an event not have the shape expected by the .NET idiom described further below -val nonStandardEventError: nm:System.String -> m:range -> exn +val nonStandardEventError: nm: System.String -> m: range -> exn /// Find the delegate type that an F# event property implements by looking through the type hierarchy of the type of the property /// for the first instantiation of IDelegateEvent. -val FindDelegateTypeOfPropertyEvent: g:TcGlobals -> amap:ImportMap -> nm:System.String -> m:range -> ty:TType -> TType +val FindDelegateTypeOfPropertyEvent: + g: TcGlobals -> amap: ImportMap -> nm: System.String -> m: range -> ty: TType -> TType /// Strips inref and outref to be a byref. -val stripByrefTy: g:TcGlobals -> ty:TType -> TType +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 * returnTy: TType option * formalMethTypars: Typars * formalMethTyparInst: TyparInst +type CompiledSig = + | CompiledSig of + argTys: TType list list * + returnTy: TType option * + formalMethTypars: Typars * + formalMethTyparInst: TyparInst /// Get the information about the compiled form of a method signature. Used when analyzing implementation /// relations between members and abstract slots. -val CompiledSigOfMeth: g:TcGlobals -> amap:ImportMap -> m:range -> minfo:MethInfo -> CompiledSig +val CompiledSigOfMeth: g: TcGlobals -> amap: ImportMap -> m: range -> minfo: MethInfo -> CompiledSig /// Inref and outref parameter types will be treated as a byref type for equivalency. -val MethInfosEquivByPartialSig: erasureFlag:Erasure -> ignoreFinal:bool -> g:TcGlobals -> amap:ImportMap -> m:range -> minfo:MethInfo -> minfo2:MethInfo -> bool +val MethInfosEquivByPartialSig: + erasureFlag: Erasure -> + ignoreFinal: bool -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + minfo: MethInfo -> + minfo2: MethInfo -> + bool /// Used to hide/filter members from super classes based on signature /// Inref and outref parameter types will be treated as a byref type for equivalency. -val MethInfosEquivByNameAndPartialSig: erasureFlag:Erasure -> ignoreFinal:bool -> g:TcGlobals -> amap:ImportMap -> m:range -> minfo:MethInfo -> minfo2:MethInfo -> bool +val MethInfosEquivByNameAndPartialSig: + erasureFlag: Erasure -> + ignoreFinal: bool -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + minfo: MethInfo -> + minfo2: MethInfo -> + bool /// Used to hide/filter members from super classes based on signature -val PropInfosEquivByNameAndPartialSig: erasureFlag:Erasure -> g:TcGlobals -> amap:ImportMap -> m:range -> pinfo:PropInfo -> pinfo2:PropInfo -> bool +val PropInfosEquivByNameAndPartialSig: + erasureFlag: Erasure -> g: TcGlobals -> amap: ImportMap -> m: range -> pinfo: PropInfo -> pinfo2: PropInfo -> bool /// Used to hide/filter members from base classes based on signature -val MethInfosEquivByNameAndSig: erasureFlag:Erasure -> ignoreFinal:bool -> g:TcGlobals -> amap:ImportMap -> m:range -> minfo:MethInfo -> minfo2:MethInfo -> bool +val MethInfosEquivByNameAndSig: + erasureFlag: Erasure -> + ignoreFinal: bool -> + g: TcGlobals -> + amap: ImportMap -> + m: range -> + minfo: MethInfo -> + minfo2: MethInfo -> + bool /// Used to hide/filter members from super classes based on signature -val PropInfosEquivByNameAndSig: erasureFlag:Erasure -> g:TcGlobals -> amap:ImportMap -> m:range -> pinfo:PropInfo -> pinfo2:PropInfo -> bool - -val SettersOfPropInfos: pinfos:PropInfo list -> (MethInfo * PropInfo option) list +val PropInfosEquivByNameAndSig: + erasureFlag: Erasure -> g: TcGlobals -> amap: ImportMap -> m: range -> pinfo: PropInfo -> pinfo2: PropInfo -> bool -val GettersOfPropInfos: pinfos:PropInfo list -> (MethInfo * PropInfo option) list +val SettersOfPropInfos: pinfos: PropInfo list -> (MethInfo * PropInfo option) list +val GettersOfPropInfos: pinfos: PropInfo list -> (MethInfo * PropInfo option) list diff --git a/src/fsharp/lexhelp.fsi b/src/fsharp/lexhelp.fsi index 06e43cf9e95..9231f6468a5 100644 --- a/src/fsharp/lexhelp.fsi +++ b/src/fsharp/lexhelp.fsi @@ -18,7 +18,7 @@ val stdinMockFilename: string /// directive is processed. This alters the behaviour of the lexfilter. [] type LightSyntaxStatus = - new: initial:bool * warn: bool -> LightSyntaxStatus + new: initial: bool * warn: bool -> LightSyntaxStatus member ExplicitlySet: bool member Status: bool member Status: bool with set @@ -30,16 +30,14 @@ type LexResourceManager = /// The context applicable to all lexing functions (tokens, strings etc.) type LexArgs = - { - conditionalDefines: string list + { conditionalDefines: string list resourceManager: LexResourceManager errorLogger: ErrorLogger applyLineDirectives: bool pathMap: PathMap mutable ifdefStack: LexerIfdefStack mutable lightStatus: LightSyntaxStatus - mutable stringNest: LexerInterpolatedStringNesting - } + mutable stringNest: LexerInterpolatedStringNesting } type LongUnicodeLexResult = | SurrogatePair of uint16 * uint16 @@ -54,8 +52,8 @@ val mkLexargs: resourceManager: LexResourceManager * ifdefStack: LexerIfdefStack * errorLogger: ErrorLogger * - pathMap: PathMap - -> LexArgs + pathMap: PathMap -> + LexArgs val reusingLexbufForParsing: Lexbuf -> (unit -> 'a) -> 'a @@ -69,7 +67,12 @@ type LexerStringFinisherContext = type LexerStringFinisher = | LexerStringFinisher of (ByteBuffer -> LexerStringKind -> LexerStringFinisherContext -> LexerContinuation -> token) - member Finish: buf: ByteBuffer -> kind: LexerStringKind -> context: LexerStringFinisherContext -> cont: LexerContinuation -> token + member Finish: + buf: ByteBuffer -> + kind: LexerStringKind -> + context: LexerStringFinisherContext -> + cont: LexerContinuation -> + token static member Default: LexerStringFinisher @@ -81,7 +84,7 @@ val addByteChar: ByteBuffer -> char -> unit val stringBufferAsString: ByteBuffer -> string -val stringBufferAsBytes: ByteBuffer -> byte[] +val stringBufferAsBytes: ByteBuffer -> byte [] val stringBufferIsBytes: ByteBuffer -> bool @@ -112,4 +115,3 @@ module Keywords = val IdentifierToken: LexArgs -> Lexbuf -> string -> token val keywordNames: string list - diff --git a/src/fsharp/lib.fsi b/src/fsharp/lib.fsi index 28d9f10b380..8c80ec94e82 100644 --- a/src/fsharp/lib.fsi +++ b/src/fsharp/lib.fsi @@ -15,32 +15,32 @@ val mutable progress: bool val mutable tracking: bool -val condition: s:string -> bool +val condition: s: string -> bool -val GetEnvInteger: e:string -> dflt:int -> int +val GetEnvInteger: e: string -> dflt: int -> int -val dispose: x:System.IDisposable -> unit +val dispose: x: System.IDisposable -> unit module Bits = /// Get the least significant byte of a 32-bit integer - val b0: n:int -> int + val b0: n: int -> int /// Get the 2nd least significant byte of a 32-bit integer - val b1: n:int -> int + val b1: n: int -> int /// Get the 3rd least significant byte of a 32-bit integer - val b2: n:int -> int + val b2: n: int -> int /// Get the most significant byte of a 32-bit integer - val b3: n:int -> int + val b3: n: int -> int - val pown32: n:int -> int + val pown32: n: int -> int - val pown64: n:int -> int64 + val pown64: n: int -> int64 - val mask32: m:int32 -> n:int -> int + val mask32: m: int32 -> n: int -> int - val mask64: m:int32 -> n:int -> int64 + val mask64: m: int32 -> n: int -> int64 module Bool = val order: IComparer @@ -52,185 +52,191 @@ module Int64 = val order: IComparer module Pair = - val order : - compare1:IComparer<'T1> * - compare2:IComparer<'T2> -> - IComparer<'T1 * 'T2> + val order: compare1: IComparer<'T1> * compare2: IComparer<'T2> -> IComparer<'T1 * 'T2> type NameSet = Zset module NameSet = - val ofList: l:string list -> NameSet + val ofList: l: string list -> NameSet module NameMap = - val domain: m:Map -> Zset + val domain: m: Map -> Zset - val domainL: m:Map -> string list + val domainL: m: Map -> string list module Check = /// Throw System.InvalidOperationException if argument is None. /// If there is a value (e.g. Some(value)) then value is returned. - val NotNone: argName:string -> arg:'T option -> 'T + val NotNone: argName: string -> arg: 'T option -> 'T /// Throw System.ArgumentNullException if argument is null. - val ArgumentNotNull: arg:'a -> argName:string -> unit + val ArgumentNotNull: arg: 'a -> argName: string -> unit /// Throw System.ArgumentNullException if array argument is null. /// Throw System.ArgumentOutOfRangeException is array argument is empty. - val ArrayArgumentNotNullOrEmpty: arr:'T [] -> argName:string -> unit + val ArrayArgumentNotNullOrEmpty: arr: 'T [] -> argName: string -> unit /// Throw System.ArgumentNullException if string argument is null. /// Throw System.ArgumentOutOfRangeException is string argument is empty. - val StringArgumentNotNullOrEmpty: s:string -> argName:string -> unit + val StringArgumentNotNullOrEmpty: s: string -> argName: string -> unit -type IntMap<'T> = Zmap +type IntMap<'T> = Zmap module IntMap = - val empty: unit -> Zmap + val empty: unit -> Zmap - val add : k:int -> v:'T -> t:IntMap<'T> -> Zmap + val add: k: int -> v: 'T -> t: IntMap<'T> -> Zmap - val find: k:int -> t:IntMap<'T> -> 'T + val find: k: int -> t: IntMap<'T> -> 'T - val tryFind: k:int -> t:IntMap<'T> -> 'T option + val tryFind: k: int -> t: IntMap<'T> -> 'T option - val remove: k:int -> t:IntMap<'T> -> Zmap + val remove: k: int -> t: IntMap<'T> -> Zmap - val mem: k:int -> t:IntMap<'T> -> bool + val mem: k: int -> t: IntMap<'T> -> bool - val iter: f:(int -> 'T -> unit) -> t:IntMap<'T> -> unit + val iter: f: (int -> 'T -> unit) -> t: IntMap<'T> -> unit - val map: f:('T -> 'a) -> t:IntMap<'T> -> Zmap + val map: f: ('T -> 'a) -> t: IntMap<'T> -> Zmap - val fold: f:(int -> 'T -> 'a -> 'a) -> t:IntMap<'T> -> z:'a -> 'a + val fold: f: (int -> 'T -> 'a -> 'a) -> t: IntMap<'T> -> z: 'a -> 'a module ListAssoc = /// Treat a list of key-value pairs as a lookup collection. /// This function looks up a value based on a match from the supplied predicate function. - val find: f:('a -> 'b -> bool) -> x:'a -> l:('b * 'c) list -> 'c + val find: f: ('a -> 'b -> bool) -> x: 'a -> l: ('b * 'c) list -> 'c /// Treat a list of key-value pairs as a lookup collection. /// This function looks up a value based on a match from the supplied /// predicate function and returns None if value does not exist. - val tryFind : f:('key -> 'key -> bool) -> x:'key -> l:('key * 'value) list -> 'value option + val tryFind: f: ('key -> 'key -> bool) -> x: 'key -> l: ('key * 'value) list -> 'value option module ListSet = - val inline contains: f:('a -> 'b -> bool) -> x:'a -> l:'b list -> bool + val inline contains: f: ('a -> 'b -> bool) -> x: 'a -> l: 'b list -> bool /// NOTE: O(n)! - val insert: f:('a -> 'a -> bool) -> x:'a -> l:'a list -> 'a list + val insert: f: ('a -> 'a -> bool) -> x: 'a -> l: 'a list -> 'a list - val unionFavourRight : f:('a -> 'a -> bool) -> l1:'a list -> l2:'a list -> 'a list + val unionFavourRight: f: ('a -> 'a -> bool) -> l1: 'a list -> l2: 'a list -> 'a list /// NOTE: O(n)! - val findIndex: eq:('a -> 'b -> bool) -> x:'b -> l:'a list -> int + val findIndex: eq: ('a -> 'b -> bool) -> x: 'b -> l: 'a list -> int - val remove: f:('a -> 'b -> bool) -> x:'a -> l:'b list -> 'b list + val remove: f: ('a -> 'b -> bool) -> x: 'a -> l: 'b list -> 'b list /// NOTE: quadratic! - val subtract: f:('a -> 'b -> bool) -> l1:'a list -> l2:'b list -> 'a list + val subtract: f: ('a -> 'b -> bool) -> l1: 'a list -> l2: 'b list -> 'a list - val isSubsetOf: f:('a -> 'b -> bool) -> l1:'a list -> l2:'b list -> bool + val isSubsetOf: f: ('a -> 'b -> bool) -> l1: 'a list -> l2: 'b list -> bool - val isSupersetOf : f:('a -> 'b -> bool) -> l1:'a list -> l2:'b list -> bool + val isSupersetOf: f: ('a -> 'b -> bool) -> l1: 'a list -> l2: 'b list -> bool - val equals: f:('a -> 'b -> bool) -> l1:'a list -> l2:'b list -> bool + val equals: f: ('a -> 'b -> bool) -> l1: 'a list -> l2: 'b list -> bool - val unionFavourLeft : f:('a -> 'a -> bool) -> l1:'a list -> l2:'a list -> 'a list + val unionFavourLeft: f: ('a -> 'a -> bool) -> l1: 'a list -> l2: 'a list -> 'a list /// NOTE: not tail recursive! - val intersect : f:('a -> 'b -> bool) -> l1:'b list -> l2:'a list -> 'a list + val intersect: f: ('a -> 'b -> bool) -> l1: 'b list -> l2: 'a list -> 'a list /// Note: if duplicates appear, keep the ones toward the _front_ of the list - val setify: f:('a -> 'a -> bool) -> l:'a list -> 'a list + val setify: f: ('a -> 'a -> bool) -> l: 'a list -> 'a list - val hasDuplicates: f:('a -> 'a -> bool) -> l:'a list -> bool + val hasDuplicates: f: ('a -> 'a -> bool) -> l: 'a list -> bool -val mapFoldFst : f:('a -> 'b -> 'c * 'd) -> s:'a -> x:'b * y:'e -> ('c * 'e) * 'd +val mapFoldFst: f: ('a -> 'b -> 'c * 'd) -> s: 'a -> x: 'b * y: 'e -> ('c * 'e) * 'd -val mapFoldSnd : f:('a -> 'b -> 'c * 'd) -> s:'a -> x:'e * y:'b -> ('e * 'c) * 'd +val mapFoldSnd: f: ('a -> 'b -> 'c * 'd) -> s: 'a -> x: 'e * y: 'b -> ('e * 'c) * 'd -val pair: a:'a -> b:'b -> 'a * 'b +val pair: a: 'a -> b: 'b -> 'a * 'b -val p13: x:'a * _y:'b * _z:'c -> 'a +val p13: x: 'a * _y: 'b * _z: 'c -> 'a -val p23: _x:'a * y:'b * _z:'c -> 'b +val p23: _x: 'a * y: 'b * _z: 'c -> 'b -val p33: _x:'a * _y:'b * z:'c -> 'c +val p33: _x: 'a * _y: 'b * z: 'c -> 'c -val p14: x1:'a * _x2:'b * _x3:'c * _x4:'d -> 'a +val p14: x1: 'a * _x2: 'b * _x3: 'c * _x4: 'd -> 'a -val p24: _x1:'a * x2:'b * _x3:'c * _x4:'d -> 'b +val p24: _x1: 'a * x2: 'b * _x3: 'c * _x4: 'd -> 'b -val p34: _x1:'a * _x2:'b * x3:'c * _x4:'d -> 'c +val p34: _x1: 'a * _x2: 'b * x3: 'c * _x4: 'd -> 'c -val p44: _x1:'a * _x2:'b * _x3:'c * x4:'d -> 'd +val p44: _x1: 'a * _x2: 'b * _x3: 'c * x4: 'd -> 'd -val p15: x1:'a * _x2:'b * _x3:'c * _x4:'d * _x5:'e -> 'a +val p15: x1: 'a * _x2: 'b * _x3: 'c * _x4: 'd * _x5: 'e -> 'a -val p25: _x1:'a * x2:'b * _x3:'c * _x4:'d * _x5:'e -> 'b +val p25: _x1: 'a * x2: 'b * _x3: 'c * _x4: 'd * _x5: 'e -> 'b -val p35: _x1:'a * _x2:'b * x3:'c * _x4:'d * _x5:'e -> 'c +val p35: _x1: 'a * _x2: 'b * x3: 'c * _x4: 'd * _x5: 'e -> 'c -val p45: _x1:'a * _x2:'b * _x3:'c * x4:'d * _x5:'e -> 'd +val p45: _x1: 'a * _x2: 'b * _x3: 'c * x4: 'd * _x5: 'e -> 'd -val p55: _x1:'a * _x2:'b * _x3:'c * _x4:'d * x5:'e -> 'e +val p55: _x1: 'a * _x2: 'b * _x3: 'c * _x4: 'd * x5: 'e -> 'e -val map1Of2: f:('a -> 'b) -> a1:'a * a2:'c -> 'b * 'c +val map1Of2: f: ('a -> 'b) -> a1: 'a * a2: 'c -> 'b * 'c -val map2Of2: f:('a -> 'b) -> a1:'c * a2:'a -> 'c * 'b +val map2Of2: f: ('a -> 'b) -> a1: 'c * a2: 'a -> 'c * 'b -val map1Of3: f:('a -> 'b) -> a1:'a * a2:'c * a3:'d -> 'b * 'c * 'd +val map1Of3: f: ('a -> 'b) -> a1: 'a * a2: 'c * a3: 'd -> 'b * 'c * 'd -val map2Of3: f:('a -> 'b) -> a1:'c * a2:'a * a3:'d -> 'c * 'b * 'd +val map2Of3: f: ('a -> 'b) -> a1: 'c * a2: 'a * a3: 'd -> 'c * 'b * 'd -val map3Of3: f:('a -> 'b) -> a1:'c * a2:'d * a3:'a -> 'c * 'd * 'b +val map3Of3: f: ('a -> 'b) -> a1: 'c * a2: 'd * a3: 'a -> 'c * 'd * 'b -val map3Of4 : f:('a -> 'b) -> a1:'c * a2:'d * a3:'a * a4:'e -> 'c * 'd * 'b * 'e +val map3Of4: f: ('a -> 'b) -> a1: 'c * a2: 'd * a3: 'a * a4: 'e -> 'c * 'd * 'b * 'e -val map4Of4 : f:('a -> 'b) -> a1:'c * a2:'d * a3:'e * a4:'a -> 'c * 'd * 'e * 'b +val map4Of4: f: ('a -> 'b) -> a1: 'c * a2: 'd * a3: 'e * a4: 'a -> 'c * 'd * 'e * 'b -val map5Of5 : f:('a -> 'b) -> a1:'c * a2:'d * a3:'e * a4:'f * a5:'a -> 'c * 'd * 'e * 'f * 'b +val map5Of5: f: ('a -> 'b) -> a1: 'c * a2: 'd * a3: 'e * a4: 'f * a5: 'a -> 'c * 'd * 'e * 'f * 'b -val map6Of6 : f:('a -> 'b) -> a1:'c * a2:'d * a3:'e * a4:'f * a5:'g * a6:'a -> 'c * 'd * 'e * 'f * 'g * 'b +val map6Of6: f: ('a -> 'b) -> a1: 'c * a2: 'd * a3: 'e * a4: 'f * a5: 'g * a6: 'a -> 'c * 'd * 'e * 'f * 'g * 'b -val foldPair : f1:('a -> 'b -> 'c) * f2:('c -> 'd -> 'e) -> acc:'a -> a1:'b * a2:'d -> 'e +val foldPair: f1: ('a -> 'b -> 'c) * f2: ('c -> 'd -> 'e) -> acc: 'a -> a1: 'b * a2: 'd -> 'e -val fold1Of2: f1:('a -> 'b -> 'c) -> acc:'a -> a1:'b * _a2:'d -> 'c +val fold1Of2: f1: ('a -> 'b -> 'c) -> acc: 'a -> a1: 'b * _a2: 'd -> 'c -val foldTriple : f1:('a -> 'b -> 'c) * f2:('c -> 'd -> 'e) * f3:('e -> 'f -> 'g) -> acc:'a -> a1:'b * a2:'d * a3:'f -> 'g +val foldTriple: + f1: ('a -> 'b -> 'c) * f2: ('c -> 'd -> 'e) * f3: ('e -> 'f -> 'g) -> acc: 'a -> a1: 'b * a2: 'd * a3: 'f -> 'g -val foldQuadruple : f1:('a -> 'b -> 'c) * f2:('c -> 'd -> 'e) * f3:('e -> 'f -> 'g) * f4:('g -> 'h -> 'i) -> acc:'a -> a1:'b * a2:'d * a3:'f * a4:'h -> 'i val mapPair: f1:('a -> 'b) * f2:('c -> 'd) -> a1:'a * a2:'c -> 'b * 'd +val foldQuadruple: + f1: ('a -> 'b -> 'c) * f2: ('c -> 'd -> 'e) * f3: ('e -> 'f -> 'g) * f4: ('g -> 'h -> 'i) -> + acc: 'a -> + a1: 'b * a2: 'd * a3: 'f * a4: 'h -> + 'i -val mapTriple : f1:('a -> 'b) * f2:('c -> 'd) * f3:('e -> 'f) -> a1:'a * a2:'c * a3:'e -> 'b * 'd * 'f +val mapPair: f1: ('a -> 'b) * f2: ('c -> 'd) -> a1: 'a * a2: 'c -> 'b * 'd -val mapQuadruple : f1:('a -> 'b) * f2:('c -> 'd) * f3:('e -> 'f) * f4:('g -> 'h) -> a1:'a * a2:'c * a3:'e * a4:'g -> 'b * 'd * 'f * 'h +val mapTriple: f1: ('a -> 'b) * f2: ('c -> 'd) * f3: ('e -> 'f) -> a1: 'a * a2: 'c * a3: 'e -> 'b * 'd * 'f -val fmap2Of2 : f:('a -> 'b -> 'c * 'd) -> z:'a -> a1:'e * a2:'b -> 'c * ('e * 'd) +val mapQuadruple: + f1: ('a -> 'b) * f2: ('c -> 'd) * f3: ('e -> 'f) * f4: ('g -> 'h) -> + a1: 'a * a2: 'c * a3: 'e * a4: 'g -> + 'b * 'd * 'f * 'h + +val fmap2Of2: f: ('a -> 'b -> 'c * 'd) -> z: 'a -> a1: 'e * a2: 'b -> 'c * ('e * 'd) module Zmap = - val force: k:'a -> mp:Zmap<'a,'b> -> 'b - val mapKey :key:'a -> f:('b option -> 'b option) -> mp:Zmap<'a,'b> -> Zmap<'a,'b> + val force: k: 'a -> mp: Zmap<'a, 'b> -> 'b + val mapKey: key: 'a -> f: ('b option -> 'b option) -> mp: Zmap<'a, 'b> -> Zmap<'a, 'b> module Zset = - val ofList : order:IComparer<'a> -> xs:'a list -> Zset<'a> - val fixpoint : f:(Zset<'a> -> Zset<'a>) -> Zset<'a> -> Zset<'a> + val ofList: order: IComparer<'a> -> xs: 'a list -> Zset<'a> + val fixpoint: f: (Zset<'a> -> Zset<'a>) -> Zset<'a> -> Zset<'a> -val equalOn: f:('a -> 'b) -> x:'a -> y:'a -> bool when 'b: equality +val equalOn: f: ('a -> 'b) -> x: 'a -> y: 'a -> bool when 'b: equality /// Buffer printing utility -val bufs: f:(StringBuilder -> unit) -> string +val bufs: f: (StringBuilder -> unit) -> string /// Writing to output stream via a string buffer. -val writeViaBuffer : os:TextWriter -> f:(StringBuilder -> 'a -> unit) -> x:'a -> unit +val writeViaBuffer: os: TextWriter -> f: (StringBuilder -> 'a -> unit) -> x: 'a -> unit -type Graph<'Data,'Id when 'Id: comparison> = +type Graph<'Data, 'Id when 'Id: comparison> = - new: nodeIdentity:('Data -> 'Id) * nodes:'Data list * - edges:('Data * 'Data) list -> Graph<'Data,'Id> - member GetNodeData: nodeId:'Id -> 'Data - member IterateCycles: f:('Data list -> unit) -> unit + new: nodeIdentity: ('Data -> 'Id) * nodes: 'Data list * edges: ('Data * 'Data) list -> Graph<'Data, 'Id> + member GetNodeData: nodeId: 'Id -> 'Data + member IterateCycles: f: ('Data list -> unit) -> unit /// In some cases we play games where we use 'null' as a more efficient representation /// in F#. The functions below are used to give initial values to mutable fields. @@ -241,20 +247,20 @@ type NonNullSlot<'T> = 'T val nullableSlotEmpty: unit -> 'T -val nullableSlotFull: x:'a -> 'a +val nullableSlotFull: x: 'a -> 'a /// Caches, mainly for free variables type cache<'T> = { mutable cacheVal: NonNullSlot<'T> } val newCache: unit -> cache<'a> -val inline cached: cache:cache<'a> -> resF:(unit -> 'a) -> 'a +val inline cached: cache: cache<'a> -> resF: (unit -> 'a) -> 'a -val inline cacheOptByref: cache:byref<'T option> -> f:(unit -> 'T) -> 'T +val inline cacheOptByref: cache: byref<'T option> -> f: (unit -> 'T) -> 'T -val inline cacheOptRef: cache:'a option ref -> f:(unit -> 'a) -> 'a +val inline cacheOptRef: cache: 'a option ref -> f: (unit -> 'a) -> 'a -val inline tryGetCacheValue: cache:cache<'a> -> NonNullSlot<'a> voption +val inline tryGetCacheValue: cache: cache<'a> -> NonNullSlot<'a> voption module AsyncUtil = @@ -264,14 +270,14 @@ module AsyncUtil = | AsyncOk of 'T | AsyncException of exn | AsyncCanceled of System.OperationCanceledException - static member Commit: res:AsyncResult<'T> -> Async<'T> + static member Commit: res: AsyncResult<'T> -> Async<'T> /// When using .NET 4.0 you can replace this type by [] type AsyncResultCell<'T> = new: unit -> AsyncResultCell<'T> - member RegisterResult: res:AsyncResult<'T> -> unit + member RegisterResult: res: AsyncResult<'T> -> unit member AsyncResult: Async<'T> module UnmanagedProcessExecutionOptions = @@ -292,7 +298,7 @@ type DisposablesTracker = new: unit -> DisposablesTracker /// Register some items to dispose - member Register: i:System.IDisposable -> unit + member Register: i: System.IDisposable -> unit interface System.IDisposable @@ -302,6 +308,6 @@ type DisposablesTracker = [] module ArrayParallel = - val inline map : ('T -> 'U) -> 'T [] -> 'U [] + val inline map: ('T -> 'U) -> 'T [] -> 'U [] - val inline mapi : (int -> 'T -> 'U) -> 'T [] -> 'U [] + val inline mapi: (int -> 'T -> 'U) -> 'T [] -> 'U [] diff --git a/src/fsharp/rational.fsi b/src/fsharp/rational.fsi index 0bcfc6dd99e..9cb93d39f87 100644 --- a/src/fsharp/rational.fsi +++ b/src/fsharp/rational.fsi @@ -5,23 +5,22 @@ module internal Internal.Utilities.Rational type Rational -val intToRational : int -> Rational -val AbsRational : Rational -> Rational -val AddRational : Rational -> Rational -> Rational -val MulRational : Rational -> Rational -> Rational -val DivRational : Rational -> Rational -> Rational -val NegRational : Rational -> Rational -val SignRational : Rational -> int -val ZeroRational : Rational -val OneRational : Rational +val intToRational: int -> Rational +val AbsRational: Rational -> Rational +val AddRational: Rational -> Rational -> Rational +val MulRational: Rational -> Rational -> Rational +val DivRational: Rational -> Rational -> Rational +val NegRational: Rational -> Rational +val SignRational: Rational -> int +val ZeroRational: Rational +val OneRational: Rational // Can be negative -val GetNumerator : Rational -> int +val GetNumerator: Rational -> int // Always positive -val GetDenominator : Rational -> int +val GetDenominator: Rational -> int // Greatest rational that divides both exactly -val GcdRational : Rational -> Rational -> Rational -val RationalToString : Rational -> string - +val GcdRational: Rational -> Rational -> Rational +val RationalToString: Rational -> string diff --git a/src/fsharp/sr.fsi b/src/fsharp/sr.fsi index 72ead23feb4..1239069df86 100644 --- a/src/fsharp/sr.fsi +++ b/src/fsharp/sr.fsi @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace FSharp.Compiler - - module internal SR = - val GetString : string -> string +namespace FSharp.Compiler - module internal DiagnosticMessage = - type ResourceString<'T> = - new : string * Printf.StringFormat<'T> -> ResourceString<'T> - member Format : 'T +module internal SR = + val GetString: string -> string - val DeclareResourceString : string * Printf.StringFormat<'T> -> ResourceString<'T> \ No newline at end of file +module internal DiagnosticMessage = + type ResourceString<'T> = + new: string * Printf.StringFormat<'T> -> ResourceString<'T> + member Format: 'T + + val DeclareResourceString: string * Printf.StringFormat<'T> -> ResourceString<'T> diff --git a/src/fsharp/tainted.fsi b/src/fsharp/tainted.fsi index 1853be9faa1..00f056cb995 100644 --- a/src/fsharp/tainted.fsi +++ b/src/fsharp/tainted.fsi @@ -10,37 +10,37 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Text [] -type internal TypeProviderToken = +type internal TypeProviderToken = interface LockToken -[] +[] type internal TypeProviderLock = inherit Lock /// Stores and transports aggregated list of errors reported by the type provider type internal TypeProviderError = inherit System.Exception - + /// creates new instance of TypeProviderError that represents one error - new : (int * string) * string * range -> TypeProviderError + new: (int * string) * string * range -> TypeProviderError /// creates new instance of TypeProviderError that represents collection of errors - new : int * string * range * seq -> TypeProviderError + new: int * string * range * seq -> TypeProviderError - member Number : int + member Number: int - member Range : range + member Range: range - member ContextualErrorMessage : string + member ContextualErrorMessage: string /// creates new instance of TypeProviderError with specified type\method names - member WithContext : string * string -> TypeProviderError + member WithContext: string * string -> TypeProviderError /// creates new instance of TypeProviderError based on current instance information(message) - member MapText : (string -> int * string) * string * range -> TypeProviderError + member MapText: (string -> int * string) * string * range -> TypeProviderError /// provides uniform way to process aggregated errors - member Iter : (TypeProviderError -> unit) -> unit + member Iter: (TypeProviderError -> unit) -> unit /// This struct wraps a value produced by a type provider to properly attribute any failures. @@ -48,70 +48,71 @@ type internal TypeProviderError = type internal Tainted<'T> = /// Create an initial tainted value - static member CreateAll : (ITypeProvider * ILScopeRef) list -> Tainted list + static member CreateAll: (ITypeProvider * ILScopeRef) list -> Tainted list /// A type provider that produced the value - member TypeProvider : Tainted + member TypeProvider: Tainted /// Test to report for the name of the type provider that produced the value - member TypeProviderDesignation : string + member TypeProviderDesignation: string /// The ILScopeRef of the runtime assembly reference for type provider that produced the value - member TypeProviderAssemblyRef : ILScopeRef + member TypeProviderAssemblyRef: ILScopeRef /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range - member PApply : ('T -> 'U) * range:range -> Tainted<'U> + member PApply: ('T -> 'U) * range: range -> Tainted<'U> /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range - member PApply2 : ('T -> 'U1 * 'U2) * range:range -> Tainted<'U1> * Tainted<'U2> + member PApply2: ('T -> 'U1 * 'U2) * range: range -> Tainted<'U1> * Tainted<'U2> /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range - member PApply3 : ('T -> 'U1 * 'U2 * 'U3) * range:range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3> + member PApply3: ('T -> 'U1 * 'U2 * 'U3) * range: range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3> /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range - member PApply4 : ('T -> 'U1 * 'U2 * 'U3 * 'U4) * range:range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3> * Tainted<'U4> + member PApply4: + ('T -> 'U1 * 'U2 * 'U3 * 'U4) * range: range -> Tainted<'U1> * Tainted<'U2> * Tainted<'U3> * Tainted<'U4> /// Apply an operation. No exception may be raised by 'f' - member PApplyNoFailure : f: ('T -> 'U) -> Tainted<'U> + member PApplyNoFailure: f: ('T -> 'U) -> Tainted<'U> /// Apply an operation. Any exception will be attributed to the type provider with an error located at the given range - member PApplyWithProvider : ('T * ITypeProvider -> 'U) * range:range -> Tainted<'U> + member PApplyWithProvider: ('T * ITypeProvider -> 'U) * range: range -> Tainted<'U> /// Apply an operation that returns an array. Unwrap array. Any exception will be attributed to the type provider with an error located at the given range. String is method name of thing-returning-array, to diagnostically attribute if it is null - member PApplyArray : ('T -> 'U[] MaybeNull) * string * range:range -> Tainted<'U>[] + member PApplyArray: ('T -> 'U [] MaybeNull) * string * range: range -> Tainted<'U> [] /// Apply an operation that returns an option. Unwrap option. Any exception will be attributed to the type provider with an error located at the given range - member PApplyOption : ('T -> 'U option) * range:range -> Tainted<'U> option + member PApplyOption: ('T -> 'U option) * range: range -> Tainted<'U> option /// Apply an operation and 'untaint' the result. The result must be marshallable. Any exception will be attributed to the type provider with an error located at the given range - member PUntaint : ('T -> 'U) * range:range -> 'U + member PUntaint: ('T -> 'U) * range: range -> 'U - /// Apply an operation and 'untaint' the result. This can be used if the return type + /// Apply an operation and 'untaint' the result. This can be used if the return type /// is guaranteed not to be implemented by a type provider - member PUntaintNoFailure : ('T -> 'U) -> 'U + member PUntaintNoFailure: ('T -> 'U) -> 'U /// Conditionally coerce the value member OfType<'U> : unit -> Tainted<'U> option /// Assert that the value is of 'U and coerce the value. /// If coercion fails, the failure will be blamed on a type provider - member Coerce<'U> : range:range -> Tainted<'U> + member Coerce<'U> : range: range -> Tainted<'U> [] module internal Tainted = /// Test whether the tainted value is null - val (|Null|NonNull|) : Tainted<'T MaybeNull> -> Choice> when 'T : null and 'T : not struct + val (|Null|NonNull|): Tainted<'T MaybeNull> -> Choice> when 'T: null and 'T: not struct - /// Test whether the tainted value equals given value. + /// Test whether the tainted value equals given value. /// Failure in call to equality operation will be blamed on type provider of first operand - val Eq : Tainted<'T> -> 'T -> bool when 'T : equality + val Eq: Tainted<'T> -> 'T -> bool when 'T: equality /// Test whether the tainted value equals given value. Type providers are ignored (equal tainted values produced by different type providers are equal) /// Failure in call to equality operation will be blamed on type provider of first operand - val EqTainted : Tainted<'T> -> Tainted<'T> -> bool when 'T : equality and 'T : not struct + val EqTainted: Tainted<'T> -> Tainted<'T> -> bool when 'T: equality and 'T: not struct /// Compute the hash value for the tainted value - val GetHashCodeTainted : Tainted<'T> -> int when 'T : equality + val GetHashCodeTainted: Tainted<'T> -> int when 'T: equality #endif