Skip to content

Commit 03283e0

Browse files
authored
Merge pull request #10172 from dotnet/merges/main-to-release/dev16.8
2 parents 53e58f4 + 520722c commit 03283e0

File tree

80 files changed

+772
-418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+772
-418
lines changed

FSharp.Compiler.Service.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30503.244
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{A59DB8AE-8044-41A5-848A-800A7FF31C93}"
77
EndProject
8+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service.Tests", "tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj", "{8D9C9683-5041-48AB-8FA9-0939D2D27D33}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

INTERNAL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ navigating through an existing PR.
1717

1818
[VS 15.0 to 15.5](https://dev.azure.com/devdiv/DevDiv/_build?definitionId=5037)
1919

20+
## Branch auto-merge definitions
21+
22+
Branch auto-merge definitions are specified [here](https://github.com/dotnet/roslyn-tools/blob/master/src/GitHubCreateMergePRs/config.xml).
23+
2024
## VS Insertion Generators
2125

2226
VS 16.4 to current - part of the build definition. [See below](#vs-insertions-as-part-of-the-build-definition).

src/fsharp/CompileOps.fs

Lines changed: 150 additions & 97 deletions
Large diffs are not rendered by default.

src/fsharp/CompileOps.fsi

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ type TcConfigBuilder =
413413
mutable pathMap : PathMap
414414

415415
mutable langVersion : LanguageVersion
416-
417-
mutable dependencyProvider: DependencyProvider
418416
}
419417

420418
static member Initial: TcConfigBuilder
@@ -443,6 +441,9 @@ type TcConfigBuilder =
443441

444442
static member SplitCommandLineResourceInfo: string -> string * string * ILResourceAccess
445443

444+
// Directories to start probing in for native DLLs for FSI dynamic loading
445+
member GetNativeProbingRoots: unit -> seq<string>
446+
446447
[<Sealed>]
447448
// Immutable TcConfig
448449
type TcConfig =
@@ -559,8 +560,8 @@ type TcConfig =
559560
member isInteractive: bool
560561
member isInvalidationSupported: bool
561562

562-
563563
member ComputeLightSyntaxInitialStatus: string -> bool
564+
564565
member GetTargetFrameworkDirectories: unit -> string list
565566
566567
/// Get the loaded sources that exist and issue a warning for the ones that don't
@@ -575,8 +576,11 @@ type TcConfig =
575576
member MakePathAbsolute: string -> string
576577

577578
member copyFSharpCore: CopyFSharpCoreFlag
579+
578580
member shadowCopyReferences: bool
581+
579582
member useSdkRefs: bool
583+
580584
member langVersion: LanguageVersion
581585

582586
static member Create: TcConfigBuilder * validate: bool -> TcConfig
@@ -640,18 +644,28 @@ type TcImports =
640644
interface System.IDisposable
641645
//new: TcImports option -> TcImports
642646
member DllTable: NameMap<ImportedBinary> with get
647+
643648
member GetImportedAssemblies: unit -> ImportedAssembly list
649+
644650
member GetCcusInDeclOrder: unit -> CcuThunk list
651+
645652
/// This excludes any framework imports (which may be shared between multiple builds)
646653
member GetCcusExcludingBase: unit -> CcuThunk list
654+
647655
member FindDllInfo: CompilationThreadToken * range * string -> ImportedBinary
656+
648657
member TryFindDllInfo: CompilationThreadToken * range * string * lookupOnly: bool -> option<ImportedBinary>
658+
649659
member FindCcuFromAssemblyRef: CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult
660+
650661
#if !NO_EXTENSIONTYPING
651662
member ProviderGeneratedTypeRoots: ProviderGeneratedType list
652663
#endif
664+
653665
member GetImportMap: unit -> Import.ImportMap
654666

667+
member DependencyProvider: DependencyProvider
668+
655669
/// Try to resolve a referenced assembly based on TcConfig settings.
656670
member TryResolveAssemblyReference: CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> OperationResult<AssemblyResolution list>
657671

@@ -671,13 +685,33 @@ type TcImports =
671685
#endif
672686
/// Report unresolved references that also weren't consumed by any type providers.
673687
member ReportUnresolvedAssemblyReferences: UnresolvedAssemblyReference list -> unit
688+
674689
member SystemRuntimeContainsType: string -> bool
675690

676691
member internal Base: TcImports option
677692

678-
static member BuildFrameworkTcImports : CompilationThreadToken * TcConfigProvider * AssemblyResolution list * AssemblyResolution list -> Cancellable<TcGlobals * TcImports>
679-
static member BuildNonFrameworkTcImports : CompilationThreadToken * TcConfigProvider * TcGlobals * TcImports * AssemblyResolution list * UnresolvedAssemblyReference list -> Cancellable<TcImports>
680-
static member BuildTcImports : CompilationThreadToken * TcConfigProvider -> Cancellable<TcGlobals * TcImports>
693+
static member BuildFrameworkTcImports:
694+
CompilationThreadToken *
695+
TcConfigProvider *
696+
AssemblyResolution list *
697+
AssemblyResolution list
698+
-> Cancellable<TcGlobals * TcImports>
699+
700+
static member BuildNonFrameworkTcImports:
701+
CompilationThreadToken *
702+
TcConfigProvider *
703+
TcGlobals *
704+
TcImports *
705+
AssemblyResolution list *
706+
UnresolvedAssemblyReference list *
707+
DependencyProvider
708+
-> Cancellable<TcImports>
709+
710+
static member BuildTcImports:
711+
CompilationThreadToken *
712+
TcConfigProvider *
713+
DependencyProvider
714+
-> Cancellable<TcGlobals * TcImports>
681715

682716
//----------------------------------------------------------------------------
683717
// Special resources in DLLs
@@ -703,24 +737,22 @@ val WriteOptimizationData: TcGlobals * filename: string * inMem: bool * CcuThunk
703737
// #r and other directives
704738
//--------------------------------------------------------------------------
705739

706-
//----------------------------------------------------------------------------
707-
// #r and other directives
708-
//--------------------------------------------------------------------------
709-
710740
/// Process #r in F# Interactive.
711741
/// Adds the reference to the tcImports and add the ccu to the type checking environment.
712742
val RequireDLL: CompilationThreadToken * TcImports * TcEnv * thisAssemblyName: string * referenceRange: range * file: string -> TcEnv * (ImportedBinary list * ImportedAssembly list)
713743

714-
/// Processing # commands
744+
/// A general routine to process hash directives
715745
val ProcessMetaCommandsFromInput :
716-
(('T -> range * string -> 'T) * ('T -> range * string -> 'T) * ('T -> IDependencyManagerProvider * Directive * range * string -> 'T) * ('T -> range * string -> unit))
717-
-> TcConfigBuilder * ParsedInput * string * 'T
718-
-> 'T
746+
(('T -> range * string -> 'T) *
747+
('T -> range * string * Directive -> 'T) *
748+
('T -> range * string -> unit))
749+
-> TcConfigBuilder * ParsedInput * string * 'T
750+
-> 'T
719751

720-
/// Process all the #r, #I etc. in an input
721-
val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string -> TcConfig
752+
/// Process all the #r, #I etc. in an input. For non-scripts report warnings about ignored directives.
753+
val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * DependencyProvider -> TcConfig
722754

723-
/// Process the #nowarn in an input
755+
/// Process the #nowarn in an input and integrate them into the TcConfig
724756
val ApplyNoWarnsToTcConfig: TcConfig * ParsedInput * string -> TcConfig
725757

726758
//----------------------------------------------------------------------------
@@ -827,6 +859,9 @@ type LoadClosure =
827859
/// The resolved references along with the ranges of the #r positions in each file.
828860
References: (string * AssemblyResolution list) list
829861

862+
/// The resolved pacakge references along with the ranges of the #r positions in each file.
863+
PackageReferences: (range * string list)[]
864+
830865
/// The list of references that were not resolved during load closure.
831866
UnresolvedReferences: UnresolvedAssemblyReference list
832867

@@ -853,8 +888,31 @@ type LoadClosure =
853888
//
854889
/// 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
855890
/// same arguments as the rest of the application.
856-
static member ComputeClosureOfScriptText: CompilationThreadToken * legacyReferenceResolver: ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * filename: string * sourceText: ISourceText * implicitDefines:CodeContext * useSimpleResolution: bool * useFsiAuxLib: bool * useSdkRefs: bool * lexResourceManager: Lexhelp.LexResourceManager * applyCompilerOptions: (TcConfigBuilder -> unit) * assumeDotNetFramework: bool * tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot * reduceMemoryUsage: ReduceMemoryFlag -> LoadClosure
891+
static member ComputeClosureOfScriptText:
892+
CompilationThreadToken *
893+
legacyReferenceResolver: ReferenceResolver.Resolver *
894+
defaultFSharpBinariesDir: string *
895+
filename: string *
896+
sourceText: ISourceText *
897+
implicitDefines:CodeContext *
898+
useSimpleResolution: bool *
899+
useFsiAuxLib: bool *
900+
useSdkRefs: bool *
901+
lexResourceManager: Lexhelp.LexResourceManager *
902+
applyCompilerOptions: (TcConfigBuilder -> unit) *
903+
assumeDotNetFramework: bool *
904+
tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot *
905+
reduceMemoryUsage: ReduceMemoryFlag *
906+
dependencyProvider: DependencyProvider
907+
-> LoadClosure
857908

858909
/// Analyze a set of script files and find the closure of their references. The resulting references are then added to the given TcConfig.
859910
/// Used from fsi.fs and fsc.fs, for #load and command line.
860-
static member ComputeClosureOfScriptFiles: CompilationThreadToken * tcConfig:TcConfig * (string * range) list * implicitDefines:CodeContext * lexResourceManager: Lexhelp.LexResourceManager -> LoadClosure
911+
static member ComputeClosureOfScriptFiles:
912+
CompilationThreadToken *
913+
tcConfig:TcConfig *
914+
(string * range) list *
915+
implicitDefines:CodeContext *
916+
lexResourceManager: Lexhelp.LexResourceManager *
917+
dependencyProvider: DependencyProvider
918+
-> LoadClosure

src/fsharp/FSComp.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ keywordDescriptionAssert,"Used to verify code during debugging."
13781378
keywordDescriptionBase,"Used as the name of the base class object."
13791379
keywordDescriptionBegin,"In verbose syntax, indicates the start of a code block."
13801380
keywordDescriptionClass,"In verbose syntax, indicates the start of a class definition."
1381+
keywordDescriptionConst,"Keyword to specify a constant literal as a type parameter argument in Type Providers."
13811382
keywordDescriptionDefault,"Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method."
13821383
keywordDescriptionDelegate,"Used to declare a delegate."
13831384
keywordDescriptionDo,"Used in looping constructs or to execute imperative code."

src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<EmbeddedResource Include="..\FSStrings.resx">
5959
<Link>FSStrings.resx</Link>
6060
</EmbeddedResource>
61-
<Compile Include="..\Logger.fsi">
62-
<Link>Logger.fsi</Link>
63-
</Compile>
64-
<Compile Include="..\Logger.fs">
65-
<Link>Logger.fs</Link>
66-
</Compile>
6761
<Compile Include="..\..\utils\sformat.fsi">
6862
<Link>ErrorText\sformat.fsi</Link>
6963
</Compile>
@@ -76,11 +70,17 @@
7670
<Compile Include="..\sr.fs">
7771
<Link>ErrorText\sr.fs</Link>
7872
</Compile>
73+
<Compile Include="..\Logger.fsi">
74+
<Link>Facilities\Logger.fsi</Link>
75+
</Compile>
76+
<Compile Include="..\Logger.fs">
77+
<Link>Facilities\Logger.fs</Link>
78+
</Compile>
7979
<Compile Include="..\LanguageFeatures.fsi">
80-
<Link>Driver\LanguageFeatures.fsi</Link>
80+
<Link>Facilities\LanguageFeatures.fsi</Link>
8181
</Compile>
8282
<Compile Include="..\LanguageFeatures.fs">
83-
<Link>Driver\LanguageFeatures.fs</Link>
83+
<Link>Facilities\LanguageFeatures.fs</Link>
8484
</Compile>
8585
<Compile Include="..\..\utils\prim-lexing.fsi">
8686
<Link>LexYaccRuntime\prim-lexing.fsi</Link>

src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<Link>FSStrings.resx</Link>
5959
<LogicalName>FSStrings.resources</LogicalName>
6060
</EmbeddedResource>
61-
<Compile Include="..\Logger.fsi">
62-
<Link>Logger.fsi</Link>
63-
</Compile>
64-
<Compile Include="..\Logger.fs">
65-
<Link>Logger.fs</Link>
66-
</Compile>
6761
<Compile Include="..\..\utils\sformat.fsi">
6862
<Link>ErrorText\sformat.fsi</Link>
6963
</Compile>
@@ -76,11 +70,17 @@
7670
<Compile Include="..\sr.fs">
7771
<Link>ErrorText\sr.fs</Link>
7872
</Compile>
73+
<Compile Include="..\Logger.fsi">
74+
<Link>Facilities\Logger.fsi</Link>
75+
</Compile>
76+
<Compile Include="..\Logger.fs">
77+
<Link>Facilities\Logger.fs</Link>
78+
</Compile>
7979
<Compile Include="..\LanguageFeatures.fsi">
80-
<Link>Driver\LanguageFeatures.fsi</Link>
80+
<Link>Facilities\LanguageFeatures.fsi</Link>
8181
</Compile>
8282
<Compile Include="..\LanguageFeatures.fs">
83-
<Link>Driver\LanguageFeatures.fs</Link>
83+
<Link>Facilities\LanguageFeatures.fs</Link>
8484
</Compile>
8585
<Compile Include="..\..\utils\prim-lexing.fsi">
8686
<Link>LexYaccRuntime\prim-lexing.fsi</Link>

src/fsharp/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ module internal Utilities =
183183

184184
p.WaitForExit()
185185

186-
if p.ExitCode <> 0 then
187-
//Write StandardError.txt to err stream
188-
for line in stdOut do Console.Out.WriteLine(line)
189-
for line in stdErr do Console.Error.WriteLine(line)
190-
191186
p.ExitCode = 0, stdOut, stdErr
192187

193188
| None -> false, Array.empty, Array.empty
@@ -203,7 +198,7 @@ module internal Utilities =
203198
| None -> ""
204199

205200
let arguments prefix =
206-
sprintf "%s -restore %s %c%s%c /t:InteractivePackageManagement" prefix binLoggingArguments '\"' projectPath '\"'
201+
sprintf "%s -restore %s %c%s%c /nologo /t:InteractivePackageManagement" prefix binLoggingArguments '\"' projectPath '\"'
207202

208203
let workingDir = Path.GetDirectoryName projectPath
209204

src/fsharp/MethodCalls.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ type ArgumentAnalysis =
619619
let InferLambdaArgsForLambdaPropagation origRhsExpr =
620620
let rec loop e =
621621
match e with
622-
| SynExpr.Lambda (_, _, _, rest, _) -> 1 + loop rest
622+
| SynExpr.Lambda (_, _, _, rest, _, _) -> 1 + loop rest
623623
| SynExpr.MatchLambda _ -> 1
624624
| _ -> 0
625625
loop origRhsExpr

0 commit comments

Comments
 (0)