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

Merge feature/auto-widen to feature/erased-unions #11786

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a31dc23
prevent exception from race condition in tryGetReflectedDefinition
pezipink Apr 21, 2021
f66c3f1
Partial fix for FSharp scripts in VS
TIHan Jun 7, 2021
277357d
Merge remote-tracking branch 'remote/main' into vs-script-fixes
TIHan Jun 24, 2021
4697480
Fixing build
TIHan Jun 24, 2021
682c4c0
Added DocumentInfo/ProjectInfo CreateFSharp extension
TIHan Jun 24, 2021
ed34c05
Uncomment
TIHan Jun 24, 2021
45c7887
minor cleanup
TIHan Jun 24, 2021
06d35a6
Reverting ProjectInfo/DocumentInfo additions
TIHan Jun 24, 2021
fa5d334
Minor change
TIHan Jun 24, 2021
c88dcb0
Minor revert
TIHan Jun 24, 2021
c24e14a
Added IFSharpWorkspaceProjectContext and IFSharpWorkspaceProjectConte…
TIHan Jun 24, 2021
634b7d9
Added basic misc file workspace test
TIHan Jun 24, 2021
3148886
First workspace script test done
TIHan Jun 24, 2021
bc96ed8
Added tests for scripts referencing scripts
TIHan Jun 24, 2021
10002a3
Minor fix
TIHan Jun 25, 2021
494a2d2
Minor fix
TIHan Jun 25, 2021
7df1647
Minor fix
TIHan Jun 25, 2021
a891d06
Merge pull request #11643 from TIHan/vs-script-fixes
dsyme Jun 25, 2021
8984266
Localized file check-in by OneLocBuild Task (#11728)
dotnet-bot Jun 26, 2021
ec83cf9
Localized file check-in by OneLocBuild Task (#11727)
dotnet-bot Jun 26, 2021
f84927a
Include range of attributes in extern declaration. (#11736)
nojaf Jun 28, 2021
52130f8
Define ParsedHashDirective arguments as ParsedHashDirectiveArgument i…
nojaf Jun 28, 2021
095deb3
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 28, 2021
23004bc
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 28, 2021
784c7ad
use path separator instead of hardcoded semicolon (#11730)
baronfel Jun 28, 2021
ec3323b
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 28, 2021
0039756
Merge pull request #11465 from pezipink/quotation_race
dsyme Jun 29, 2021
4378143
Optimize interpolated string with no holes (#11632)
kerams Jun 29, 2021
8339418
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 29, 2021
2f3c057
[main] Update dependencies from dotnet/arcade (#11720)
dotnet-maestro[bot] Jun 29, 2021
bd862b8
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 29, 2021
4157807
Add FSC option for retrieving raw lexer tokens (#10578)
laenas Jun 29, 2021
07382fb
Allow attributes after the 'module' keyword (#11722)
Happypig375 Jun 29, 2021
698f1c1
Localized file check-in by OneLocBuild Task (#11747)
dotnet-bot Jun 29, 2021
76911eb
Added script reference test and clearing check file caches on re-crea…
TIHan Jun 29, 2021
6deea74
minor fix of duplicate definition in ServiceLexing.fsi (#11756)
goswinr Jun 30, 2021
f938c0c
Localized file check-in by OneLocBuild Task: Build definition ID 499:…
dotnet-bot Jun 30, 2021
692eaa4
fix 11620 (#11755)
dsyme Jul 1, 2021
494c5a4
Localized file check-in by OneLocBuild Task (#11766)
dotnet-bot Jul 1, 2021
9cbbf4c
Improve debugging of retail and inline code by not erasing locals and…
dsyme Jul 2, 2021
a85aac5
Add internal `block` type for use in the compiler. `IncrementalBuilde…
TIHan Jul 2, 2021
1ed872e
Localized file check-in by OneLocBuild Task (#11774)
dotnet-bot Jul 2, 2021
6cb608f
Localized file check-in by OneLocBuild Task (#11773)
dotnet-bot Jul 2, 2021
5cfd7ff
Localized file check-in by OneLocBuild Task (#11768)
dotnet-bot Jul 2, 2021
dfeb8a9
apply source-build patches (#11762)
brettfo Jul 3, 2021
f2b0357
integrate main
Jul 5, 2021
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
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21321.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21328.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>28a6403ee97077256fcdc60f599f0ad9e38e3cfa</Sha>
<Sha>685c1a4fa207d81e881a402a32ffa1c0fb191b42</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
</ToolsetDependencies>
Expand Down
11 changes: 10 additions & 1 deletion eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
}

$msbuildVersionDir = if ([int]$vsMajorVersion -lt 16) { "$vsMajorVersion.0" } else { "Current" }
return $global:_MSBuildExe = Join-Path $vsInstallDir "MSBuild\$msbuildVersionDir\Bin\msbuild.exe"

$local:BinFolder = Join-Path $vsInstallDir "MSBuild\$msbuildVersionDir\Bin"
$local:Prefer64bit = if (Get-Member -InputObject $vsRequirements -Name 'Prefer64bit') { $vsRequirements.Prefer64bit } else { $false }
if ($local:Prefer64bit -and (Test-Path(Join-Path $local:BinFolder "amd64"))) {
$global:_MSBuildExe = Join-Path $local:BinFolder "amd64\msbuild.exe"
} else {
$global:_MSBuildExe = Join-Path $local:BinFolder "msbuild.exe"
}

return $global:_MSBuildExe
}

function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [string] $vsMajorVersion) {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21321.2",
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21328.2",
"Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2"
}
}
44 changes: 27 additions & 17 deletions src/fsharp/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6906,28 +6906,38 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
UnifyTypes cenv env m printerTupleTy printerTupleTyRequired

// Type check the expressions filling the holes
let flexes = argTys |> List.map (fun _ -> false)
let fillExprs, tpenv = TcExprsWithFlexes cenv env m tpenv flexes argTys synFillExprs

let fillExprsBoxed = (argTys, fillExprs) ||> List.map2 (mkCallBox g m)
if List.isEmpty synFillExprs then
let str = mkString g m printfFormatString

let argsExpr = mkArray (g.obj_ty, fillExprsBoxed, m)
let percentATysExpr =
if percentATys.Length = 0 then
mkNull m (mkArrayType g g.system_Type_ty)
if isString then
str, tpenv
else
let tyExprs = percentATys |> Array.map (mkCallTypeOf g m) |> Array.toList
mkArray (g.system_Type_ty, tyExprs, m)
mkCallNewFormat cenv.g m printerTy printerArgTy printerResidueTy printerResultTy printerTupleTy str, tpenv
else
// Type check the expressions filling the holes
let flexes = argTys |> List.map (fun _ -> false)
let fillExprs, tpenv = TcExprsWithFlexes cenv env m tpenv flexes argTys synFillExprs

let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr]
let fillExprsBoxed = (argTys, fillExprs) ||> List.map2 (mkCallBox g m)

if isString then
TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () ->
// Make the call to sprintf
mkCall_sprintf g m printerTy fmtExpr [], tpenv
)
else
fmtExpr, tpenv
let argsExpr = mkArray (g.obj_ty, fillExprsBoxed, m)
let percentATysExpr =
if percentATys.Length = 0 then
mkNull m (mkArrayType g g.system_Type_ty)
else
let tyExprs = percentATys |> Array.map (mkCallTypeOf g m) |> Array.toList
mkArray (g.system_Type_ty, tyExprs, m)

let fmtExpr = MakeMethInfoCall cenv.amap m newFormatMethod [] [mkString g m printfFormatString; argsExpr; percentATysExpr]

if isString then
TcPropagatingExprLeafThenConvert cenv overallTy g.string_ty env (* true *) m (fun () ->
// Make the call to sprintf
mkCall_sprintf g m printerTy fmtExpr [], tpenv
)
else
fmtExpr, tpenv

// The case for $"..." used as type FormattableString or IFormattable
| Choice2Of2 createFormattableStringMethod ->
Expand Down
11 changes: 8 additions & 3 deletions src/fsharp/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ type LStatus =
| Unprocessed
| Processed

type TokenizeOption =
| AndCompile
| Only
| Unfiltered

type PackageManagerLine =
{ Directive: Directive
LineStatus: LStatus
Expand Down Expand Up @@ -367,7 +372,7 @@ type TcConfigBuilder =
mutable importAllReferencesOnly: bool
mutable simulateException: string option
mutable printAst: bool
mutable tokenizeOnly: bool
mutable tokenize: TokenizeOption
mutable testInteractionParser: bool
mutable reportNumDecls: bool
mutable printSignature: bool
Expand Down Expand Up @@ -573,7 +578,7 @@ type TcConfigBuilder =
importAllReferencesOnly = false
simulateException = None
printAst = false
tokenizeOnly = false
tokenize = TokenizeOption.AndCompile
testInteractionParser = false
reportNumDecls = false
printSignature = false
Expand Down Expand Up @@ -960,7 +965,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
member x.simulateException = data.simulateException
member x.printAst = data.printAst
member x.targetFrameworkVersion = targetFrameworkVersionValue
member x.tokenizeOnly = data.tokenizeOnly
member x.tokenize = data.tokenize
member x.testInteractionParser = data.testInteractionParser
member x.reportNumDecls = data.reportNumDecls
member x.printSignature = data.printSignature
Expand Down
9 changes: 7 additions & 2 deletions src/fsharp/CompilerConfig.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ type LStatus =
| Unprocessed
| Processed

type TokenizeOption =
| AndCompile
| Only
| Unfiltered

type PackageManagerLine =
{ Directive: Directive
LineStatus: LStatus
Expand Down Expand Up @@ -182,7 +187,7 @@ type TcConfigBuilder =
mutable importAllReferencesOnly: bool
mutable simulateException: string option
mutable printAst: bool
mutable tokenizeOnly: bool
mutable tokenize: TokenizeOption
mutable testInteractionParser: bool
mutable reportNumDecls: bool
mutable printSignature: bool
Expand Down Expand Up @@ -374,7 +379,7 @@ type TcConfig =
member importAllReferencesOnly: bool
member simulateException: string option
member printAst: bool
member tokenizeOnly: bool
member tokenize: TokenizeOption
member testInteractionParser: bool
member reportNumDecls: bool
member printSignature: bool
Expand Down
7 changes: 6 additions & 1 deletion src/fsharp/CompilerOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,14 @@ let internalFlags (tcConfigB:TcConfigBuilder) =

CompilerOption
("tokenize", tagNone,
OptionUnit (fun () -> tcConfigB.tokenizeOnly <- true),
OptionUnit (fun () -> tcConfigB.tokenize <- TokenizeOption.Only),
Some(InternalCommandLineOption("--tokenize", rangeCmdArgs)), None)

CompilerOption
("tokenize-unfiltered", tagNone,
OptionUnit (fun () -> tcConfigB.tokenize <- TokenizeOption.Unfiltered),
Some(InternalCommandLineOption("--tokenize-unfiltered", rangeCmdArgs)), None)

CompilerOption
("testInteractionParser", tagNone,
OptionUnit (fun () -> tcConfigB.testInteractionParser <- true),
Expand Down
15 changes: 8 additions & 7 deletions src/fsharp/DependencyManager/NativeDllResolveHandler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,26 @@ type NativeDllResolveHandler (nativeProbingRoots: NativeResolutionProbe) =
else
None

let appendSemiColon (p: string) =
if not(p.EndsWith(";", StringComparison.OrdinalIgnoreCase)) then
p + ";"
let appendPathSeparator (p: string) =
let separator = string System.IO.Path.PathSeparator
if not(p.EndsWith(separator, StringComparison.OrdinalIgnoreCase)) then
p + separator
else
p

let addedPaths = ConcurrentBag<string>()

let addProbeToProcessPath probePath =
let probe = appendSemiColon probePath
let path = appendSemiColon (Environment.GetEnvironmentVariable("PATH"))
let probe = appendPathSeparator probePath
let path = appendPathSeparator (Environment.GetEnvironmentVariable("PATH"))
if not (path.Contains(probe)) then
Environment.SetEnvironmentVariable("PATH", path + probe)
addedPaths.Add probe

let removeProbeFromProcessPath probePath =
if not(String.IsNullOrWhiteSpace(probePath)) then
let probe = appendSemiColon probePath
let path = appendSemiColon (Environment.GetEnvironmentVariable("PATH"))
let probe = appendPathSeparator probePath
let path = appendPathSeparator (Environment.GetEnvironmentVariable("PATH"))
if path.Contains(probe) then Environment.SetEnvironmentVariable("PATH", path.Replace(probe, ""))

member internal _.RefreshPathsInEnvironment(roots: string seq) =
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/DetupleArgs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,15 @@ let fixupApp (penv: penv) (fx, fty, tys, args, m) =

// Is it a val app, where the val has a transform?
match fx with
| Expr.Val (vref, _, m) ->
| Expr.Val (vref, _, vm) ->
let f = vref.Deref
match hasTransfrom penv f with
| Some trans ->
// fix it
let callPattern = trans.transformCallPattern
let transformedVal = trans.transformedVal
let fCty = transformedVal.Type
let fCx = exprForVal m transformedVal
let fCx = exprForVal vm transformedVal
(* [[f tps args ]] -> transformedVal tps [[COLLAPSED: args]] *)
let env = {prefix = "arg";m = m;eg=penv.g}
let bindings = []
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ featureExpandedMeasurables,"more types support units of measure"
featurePrintfBinaryFormat,"binary formatting for integers"
featureDiscardUseValue,"discard pattern in use binding"
featureNonVariablePatternsToRightOfAsPatterns,"non-variable patterns to the right of 'as' patterns"
featureAttributesToRightOfModuleKeyword,"attributes to the right of the 'module' keyword"
3090,tcIfThenElseMayNotBeUsedWithinQueries,"An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead."
3091,ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen,"Invalid argument to 'methodhandleof' during codegen"
3092,etProvidedTypeReferenceMissingArgument,"A reference to a provided type was missing a value for the static parameter '%s'. You may need to recompile one or more referenced assemblies."
Expand Down
30 changes: 18 additions & 12 deletions src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,6 @@
<Compile Include="..\LanguageFeatures.fs">
<Link>Facilities\LanguageFeatures.fs</Link>
</Compile>
<Compile Include="..\utils\prim-lexing.fsi">
<Link>LexYaccRuntime\prim-lexing.fsi</Link>
</Compile>
<Compile Include="..\utils\prim-lexing.fs">
<Link>LexYaccRuntime\prim-lexing.fs</Link>
</Compile>
<Compile Include="..\utils\prim-parsing.fsi">
<Link>LexYaccRuntime\prim-parsing.fsi</Link>
</Compile>
<Compile Include="..\utils\prim-parsing.fs">
<Link>LexYaccRuntime\prim-parsing.fs</Link>
</Compile>
<Compile Include="..\utils\ResizeArray.fsi">
<Link>Utilities\ResizeArray.fsi</Link>
</Compile>
Expand Down Expand Up @@ -202,6 +190,12 @@
<Compile Include="..\lib.fs">
<Link>Utilities\lib.fs</Link>
</Compile>
<Compile Include="..\block.fsi">
<Link>Utilities\block.fsi</Link>
</Compile>
<Compile Include="..\block.fs">
<Link>Utilities\block.fs</Link>
</Compile>
<Compile Include="..\rational.fsi">
<Link>Utilities\rational.fsi</Link>
</Compile>
Expand Down Expand Up @@ -247,6 +241,18 @@
<Compile Include="..\ErrorResolutionHints.fs">
<Link>ErrorLogging\ErrorResolutionHints.fs</Link>
</Compile>
<Compile Include="..\utils\prim-lexing.fsi">
<Link>LexYaccRuntime\prim-lexing.fsi</Link>
</Compile>
<Compile Include="..\utils\prim-lexing.fs">
<Link>LexYaccRuntime\prim-lexing.fs</Link>
</Compile>
<Compile Include="..\utils\prim-parsing.fsi">
<Link>LexYaccRuntime\prim-parsing.fsi</Link>
</Compile>
<Compile Include="..\utils\prim-parsing.fs">
<Link>LexYaccRuntime\prim-parsing.fs</Link>
</Compile>
<FsLex Include="..\absil\illex.fsl">
<OtherFlags>--unicode --lexlib Internal.Utilities.Text.Lexing</OtherFlags>
<Link>AbsIL\illex.fsl</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core/quotations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ module Patterns =
|> List.iter (fun (resourceName, defns) ->
defns |> List.iter (fun (methodBase, exprBuilder) ->
reflectedDefinitionTable.[ReflectedDefinitionTableKey.GetKey methodBase] <- Entry exprBuilder)
decodedTopResources.Add((assem, resourceName), 0))
decodedTopResources.[(assem, resourceName)] <- 0)
// we know it's in the table now, if it's ever going to be there
reflectedDefinitionTable.TryGetValue key
)
Expand Down
Loading