Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merges/main to release/dev16.8 #10172

Merged
merged 14 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions FSharp.Compiler.Service.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{A59DB8AE-8044-41A5-848A-800A7FF31C93}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A59DB8AE-8044-41A5-848A-800A7FF31C93}.Release|Any CPU.Build.0 = Release|Any CPU
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D9C9683-5041-48AB-8FA9-0939D2D27D33}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions INTERNAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ navigating through an existing PR.

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

## Branch auto-merge definitions

Branch auto-merge definitions are specified [here](https://github.com/dotnet/roslyn-tools/blob/master/src/GitHubCreateMergePRs/config.xml).

## VS Insertion Generators

VS 16.4 to current - part of the build definition. [See below](#vs-insertions-as-part-of-the-build-definition).
Expand Down
247 changes: 150 additions & 97 deletions src/fsharp/CompileOps.fs

Large diffs are not rendered by default.

96 changes: 77 additions & 19 deletions src/fsharp/CompileOps.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,6 @@ type TcConfigBuilder =
mutable pathMap : PathMap

mutable langVersion : LanguageVersion

mutable dependencyProvider: DependencyProvider
}

static member Initial: TcConfigBuilder
Expand Down Expand Up @@ -443,6 +441,9 @@ type TcConfigBuilder =

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

// Directories to start probing in for native DLLs for FSI dynamic loading
member GetNativeProbingRoots: unit -> seq<string>

[<Sealed>]
// Immutable TcConfig
type TcConfig =
Expand Down Expand Up @@ -559,8 +560,8 @@ type TcConfig =
member isInteractive: bool
member isInvalidationSupported: bool


member ComputeLightSyntaxInitialStatus: string -> bool

member GetTargetFrameworkDirectories: unit -> string list

/// Get the loaded sources that exist and issue a warning for the ones that don't
Expand All @@ -575,8 +576,11 @@ type TcConfig =
member MakePathAbsolute: string -> string

member copyFSharpCore: CopyFSharpCoreFlag

member shadowCopyReferences: bool

member useSdkRefs: bool

member langVersion: LanguageVersion

static member Create: TcConfigBuilder * validate: bool -> TcConfig
Expand Down Expand Up @@ -640,18 +644,28 @@ type TcImports =
interface System.IDisposable
//new: TcImports option -> TcImports
member DllTable: NameMap<ImportedBinary> with get

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 FindDllInfo: CompilationThreadToken * range * string -> ImportedBinary

member TryFindDllInfo: CompilationThreadToken * range * string * lookupOnly: bool -> option<ImportedBinary>

member FindCcuFromAssemblyRef: CompilationThreadToken * range * ILAssemblyRef -> CcuResolutionResult

#if !NO_EXTENSIONTYPING
member ProviderGeneratedTypeRoots: ProviderGeneratedType list
#endif

member GetImportMap: unit -> Import.ImportMap

member DependencyProvider: DependencyProvider

/// Try to resolve a referenced assembly based on TcConfig settings.
member TryResolveAssemblyReference: CompilationThreadToken * AssemblyReference * ResolveAssemblyReferenceMode -> OperationResult<AssemblyResolution list>

Expand All @@ -671,13 +685,33 @@ type TcImports =
#endif
/// Report unresolved references that also weren't consumed by any type providers.
member ReportUnresolvedAssemblyReferences: UnresolvedAssemblyReference list -> unit

member SystemRuntimeContainsType: string -> bool

member internal Base: TcImports option

static member BuildFrameworkTcImports : CompilationThreadToken * TcConfigProvider * AssemblyResolution list * AssemblyResolution list -> Cancellable<TcGlobals * TcImports>
static member BuildNonFrameworkTcImports : CompilationThreadToken * TcConfigProvider * TcGlobals * TcImports * AssemblyResolution list * UnresolvedAssemblyReference list -> Cancellable<TcImports>
static member BuildTcImports : CompilationThreadToken * TcConfigProvider -> Cancellable<TcGlobals * TcImports>
static member BuildFrameworkTcImports:
CompilationThreadToken *
TcConfigProvider *
AssemblyResolution list *
AssemblyResolution list
-> Cancellable<TcGlobals * TcImports>

static member BuildNonFrameworkTcImports:
CompilationThreadToken *
TcConfigProvider *
TcGlobals *
TcImports *
AssemblyResolution list *
UnresolvedAssemblyReference list *
DependencyProvider
-> Cancellable<TcImports>

static member BuildTcImports:
CompilationThreadToken *
TcConfigProvider *
DependencyProvider
-> Cancellable<TcGlobals * TcImports>

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

//----------------------------------------------------------------------------
// #r and other directives
//--------------------------------------------------------------------------

/// Process #r in F# Interactive.
/// Adds the reference to the tcImports and add the ccu to the type checking environment.
val RequireDLL: CompilationThreadToken * TcImports * TcEnv * thisAssemblyName: string * referenceRange: range * file: string -> TcEnv * (ImportedBinary list * ImportedAssembly list)

/// Processing # commands
/// A general routine to process hash directives
val ProcessMetaCommandsFromInput :
(('T -> range * string -> 'T) * ('T -> range * string -> 'T) * ('T -> IDependencyManagerProvider * Directive * range * string -> 'T) * ('T -> range * string -> unit))
-> TcConfigBuilder * ParsedInput * string * 'T
-> 'T
(('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
val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string -> TcConfig
/// Process all the #r, #I etc. in an input. For non-scripts report warnings about ignored directives.
val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * DependencyProvider -> TcConfig

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

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

/// The resolved pacakge references along with the ranges of the #r positions in each file.
PackageReferences: (range * string list)[]

/// The list of references that were not resolved during load closure.
UnresolvedReferences: UnresolvedAssemblyReference list

Expand All @@ -853,8 +888,31 @@ type LoadClosure =
//
/// 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: 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
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 *
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: CompilationThreadToken * tcConfig:TcConfig * (string * range) list * implicitDefines:CodeContext * lexResourceManager: Lexhelp.LexResourceManager -> LoadClosure
static member ComputeClosureOfScriptFiles:
CompilationThreadToken *
tcConfig:TcConfig *
(string * range) list *
implicitDefines:CodeContext *
lexResourceManager: Lexhelp.LexResourceManager *
dependencyProvider: DependencyProvider
-> LoadClosure
1 change: 1 addition & 0 deletions src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ keywordDescriptionAssert,"Used to verify code during debugging."
keywordDescriptionBase,"Used as the name of the base class object."
keywordDescriptionBegin,"In verbose syntax, indicates the start of a code block."
keywordDescriptionClass,"In verbose syntax, indicates the start of a class definition."
keywordDescriptionConst,"Keyword to specify a constant literal as a type parameter argument in Type Providers."
keywordDescriptionDefault,"Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method."
keywordDescriptionDelegate,"Used to declare a delegate."
keywordDescriptionDo,"Used in looping constructs or to execute imperative code."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
<EmbeddedResource Include="..\FSStrings.resx">
<Link>FSStrings.resx</Link>
</EmbeddedResource>
<Compile Include="..\Logger.fsi">
<Link>Logger.fsi</Link>
</Compile>
<Compile Include="..\Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="..\..\utils\sformat.fsi">
<Link>ErrorText\sformat.fsi</Link>
</Compile>
Expand All @@ -76,11 +70,17 @@
<Compile Include="..\sr.fs">
<Link>ErrorText\sr.fs</Link>
</Compile>
<Compile Include="..\Logger.fsi">
<Link>Facilities\Logger.fsi</Link>
</Compile>
<Compile Include="..\Logger.fs">
<Link>Facilities\Logger.fs</Link>
</Compile>
<Compile Include="..\LanguageFeatures.fsi">
<Link>Driver\LanguageFeatures.fsi</Link>
<Link>Facilities\LanguageFeatures.fsi</Link>
</Compile>
<Compile Include="..\LanguageFeatures.fs">
<Link>Driver\LanguageFeatures.fs</Link>
<Link>Facilities\LanguageFeatures.fs</Link>
</Compile>
<Compile Include="..\..\utils\prim-lexing.fsi">
<Link>LexYaccRuntime\prim-lexing.fsi</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
<Link>FSStrings.resx</Link>
<LogicalName>FSStrings.resources</LogicalName>
</EmbeddedResource>
<Compile Include="..\Logger.fsi">
<Link>Logger.fsi</Link>
</Compile>
<Compile Include="..\Logger.fs">
<Link>Logger.fs</Link>
</Compile>
<Compile Include="..\..\utils\sformat.fsi">
<Link>ErrorText\sformat.fsi</Link>
</Compile>
Expand All @@ -76,11 +70,17 @@
<Compile Include="..\sr.fs">
<Link>ErrorText\sr.fs</Link>
</Compile>
<Compile Include="..\Logger.fsi">
<Link>Facilities\Logger.fsi</Link>
</Compile>
<Compile Include="..\Logger.fs">
<Link>Facilities\Logger.fs</Link>
</Compile>
<Compile Include="..\LanguageFeatures.fsi">
<Link>Driver\LanguageFeatures.fsi</Link>
<Link>Facilities\LanguageFeatures.fsi</Link>
</Compile>
<Compile Include="..\LanguageFeatures.fs">
<Link>Driver\LanguageFeatures.fs</Link>
<Link>Facilities\LanguageFeatures.fs</Link>
</Compile>
<Compile Include="..\..\utils\prim-lexing.fsi">
<Link>LexYaccRuntime\prim-lexing.fsi</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ module internal Utilities =

p.WaitForExit()

if p.ExitCode <> 0 then
//Write StandardError.txt to err stream
for line in stdOut do Console.Out.WriteLine(line)
for line in stdErr do Console.Error.WriteLine(line)

p.ExitCode = 0, stdOut, stdErr

| None -> false, Array.empty, Array.empty
Expand All @@ -203,7 +198,7 @@ module internal Utilities =
| None -> ""

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

let workingDir = Path.GetDirectoryName projectPath

Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/MethodCalls.fs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ type ArgumentAnalysis =
let InferLambdaArgsForLambdaPropagation origRhsExpr =
let rec loop e =
match e with
| SynExpr.Lambda (_, _, _, rest, _) -> 1 + loop rest
| SynExpr.Lambda (_, _, _, rest, _, _) -> 1 + loop rest
| SynExpr.MatchLambda _ -> 1
| _ -> 0
loop origRhsExpr
Expand Down
Loading