Skip to content

Commit

Permalink
[fsharp] Sync f2a6810 → 02bb351
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-maestro[bot] committed Feb 23, 2024
1 parent ba26665 commit d7aa4e7
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Components.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To enable full offline source-building of the VMR, we have no other choice than
- `src/format`
*[dotnet/format@642934d](https://github.com/dotnet/format/tree/642934d511abb9916d7da0d118a7357d35d4f2cb)*
- `src/fsharp`
*[dotnet/fsharp@f2a6810](https://github.com/dotnet/fsharp/tree/f2a6810476e1b589bcf56eb5f377c5214c509bc6)*
*[dotnet/fsharp@02bb351](https://github.com/dotnet/fsharp/tree/02bb351b606468bce98688fccda9d0c8adcd964d)*
- `src/installer`
*[dotnet/installer@39605ca](https://github.com/dotnet/installer/tree/39605ca72003cbb09022a2acfd2ac38351bebb57)*
- `src/msbuild`
Expand Down
4 changes: 2 additions & 2 deletions prereqs/git-info/AllRepoVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<emsdkOutputPackageVersion>9.0.0-preview.2.24114.5</emsdkOutputPackageVersion>
<formatGitCommitHash>642934d511abb9916d7da0d118a7357d35d4f2cb</formatGitCommitHash>
<formatOutputPackageVersion>9.0.511902</formatOutputPackageVersion>
<fsharpGitCommitHash>f2a6810476e1b589bcf56eb5f377c5214c509bc6</fsharpGitCommitHash>
<fsharpOutputPackageVersion>8.0.300-beta.24120.1</fsharpOutputPackageVersion>
<fsharpGitCommitHash>02bb351b606468bce98688fccda9d0c8adcd964d</fsharpGitCommitHash>
<fsharpOutputPackageVersion>8.0.300-beta.24122.3</fsharpOutputPackageVersion>
<installerGitCommitHash>39605ca72003cbb09022a2acfd2ac38351bebb57</installerGitCommitHash>
<installerOutputPackageVersion>9.0.100</installerOutputPackageVersion>
<msbuildGitCommitHash>aa5b55280b9e4ba92aaf39a650b94227a44bf834</msbuildGitCommitHash>
Expand Down
6 changes: 3 additions & 3 deletions prereqs/git-info/fsharp.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<GitCommitHash>f2a6810476e1b589bcf56eb5f377c5214c509bc6</GitCommitHash>
<OfficialBuildId>20240220.1</OfficialBuildId>
<OutputPackageVersion>8.0.300-beta.24120.1</OutputPackageVersion>
<GitCommitHash>02bb351b606468bce98688fccda9d0c8adcd964d</GitCommitHash>
<OfficialBuildId>20240222.3</OfficialBuildId>
<OutputPackageVersion>8.0.300-beta.24122.3</OutputPackageVersion>
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
<IsStable>false</IsStable>
</PropertyGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/fsharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition = "Exists('$(RepoRoot)/Directory.Build.props.user')" />

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<BUILDING_WITH_LKG>true</BUILDING_WITH_LKG>
<BUILD_FROM_SOURCE>true</BUILD_FROM_SOURCE>
<DisableAutoSetFscCompilerPath>false</DisableAutoSetFscCompilerPath>
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">true</FSHARPCORE_USE_PACKAGE>
<DISABLE_ARCADE Condition="'$(DISABLE_ARCADE)' == ''">true</DISABLE_ARCADE>
Expand All @@ -38,6 +36,7 @@
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/net8.0/fslex.dll</FsLexPath>
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll</FsYaccPath>
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'"/>
Expand Down
28 changes: 0 additions & 28 deletions src/fsharp/FSharp.Compiler.Service.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks",
tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark.Runner", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.Runner\HistoricalBenchmark.Runner.fsproj", "{07CD957A-3C31-4F75-A735-16CE72E1BD71}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD4D4A7E-D519-4409-89DA-16DCA3EF80AA}"
ProjectSection(SolutionItems) = preProject
src\Compiler\FSComp.txt = src\Compiler\FSComp.txt
Expand All @@ -61,8 +55,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Interactive
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Benchmarks.Common", "tests\benchmarks\FSharp.Benchmarks.Common\FSharp.Benchmarks.Common.fsproj", "{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -97,18 +89,6 @@ Global
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.Build.0 = Release|Any CPU
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.Build.0 = Release|Any CPU
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.Build.0 = Release|Any CPU
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.Build.0 = Release|Any CPU
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.Build.0 = Release|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -145,10 +125,6 @@ Global
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.Build.0 = Release|Any CPU
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -157,10 +133,6 @@ Global
{BFE6E6F1-1B73-404F-A3A5-30B57E5E0731} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
{2EF674B9-8B56-4796-9933-42B2629E52C3} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
{38A23D53-E2BF-4B76-907F-49F41D60C88E} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
{07CD957A-3C31-4F75-A735-16CE72E1BD71} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F9A60F3B-D894-4C8E-BA0F-C51115B25A5A}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16570](https://github.com/dotnet/fsharp/pull/16570))
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

* Fix missing warning for recursive calls in list comprehensions. ([PR #16652](https://github.com/dotnet/fsharp/pull/16652))
* Code generated files with > 64K methods and generated symbols crash when loaded. Use infered sequence points for debugging. ([Issue #16399](https://github.com/dotnet/fsharp/issues/16399), [#PR 16514](https://github.com/dotnet/fsharp/pull/16514))
* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550))
* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550), [PR #16743](https://github.com/dotnet/fsharp/pull/16743))
* Graph Based Checking doesn't throw on invalid parsed input so it can be used for IDE scenarios ([PR #16575](https://github.com/dotnet/fsharp/pull/16575), [PR #16588](https://github.com/dotnet/fsharp/pull/16588), [PR #16643](https://github.com/dotnet/fsharp/pull/16643))
* Various parenthesization API fixes. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666))
* Keep parens for problematic exprs (`if`, `match`, etc.) in `$"{(…):N0}"`, `$"{(…),-3}"`, etc. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578))
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24113.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24119.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>2f79f97b7a6a0cf2ca3297a8fa526e6f4ea98ce2</Sha>
<Sha>539af5d8ae183d4fe61e8b2f8f4a8505c8a765a7</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
41 changes: 35 additions & 6 deletions src/fsharp/src/Compiler/Driver/GraphChecking/FileContentMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,27 @@ let visitSynTypeConstraint (tc: SynTypeConstraint) : FileContentEntry list =
let inline (|NameofIdent|_|) (ident: Ident) =
if ident.idText = "nameof" then ValueSome() else ValueNone

/// nameof X.Y.Z can be used in expressions and patterns
[<RequireQualifiedAccess; NoComparison>]
type NameofResult =
/// Example: nameof X
/// Where X is a module name
| SingleIdent of potentialModuleName: Ident
/// Example: nameof X.Y.Z
/// Where Z is either a module name or something from inside module or namespace Y.
/// Both options need to be explored.
| LongIdent of longIdent: LongIdent

let visitNameofResult (nameofResult: NameofResult) : FileContentEntry =
match nameofResult with
| NameofResult.SingleIdent moduleName -> visitIdentAsPotentialModuleName moduleName
| NameofResult.LongIdent longIdent ->
// In this case the last part of the LongIdent could be a module name.
// So we should not cut off the last part.
FileContentEntry.PrefixedIdentifier(longIdentToPath false longIdent)

/// Special case of `nameof Module` type of expression
let (|NameofExpr|_|) (e: SynExpr) =
let (|NameofExpr|_|) (e: SynExpr) : NameofResult option =
let rec stripParen (e: SynExpr) =
match e with
| SynExpr.Paren(expr = expr) -> stripParen expr
Expand All @@ -320,14 +339,20 @@ let (|NameofExpr|_|) (e: SynExpr) =
match e with
| SynExpr.App(flag = ExprAtomicFlag.NonAtomic; isInfix = false; funcExpr = SynExpr.Ident NameofIdent; argExpr = moduleNameExpr) ->
match stripParen moduleNameExpr with
| SynExpr.Ident moduleNameIdent -> Some moduleNameIdent
| SynExpr.Ident moduleNameIdent -> Some(NameofResult.SingleIdent moduleNameIdent)
| SynExpr.LongIdent(longDotId = longIdent) ->
match longIdent.LongIdent with
| [] -> None
// This is highly unlikely to be produced by the parser
| [ moduleNameIdent ] -> Some(NameofResult.SingleIdent moduleNameIdent)
| lid -> Some(NameofResult.LongIdent(lid))
| _ -> None
| _ -> None

let visitSynExpr (e: SynExpr) : FileContentEntry list =
let rec visit (e: SynExpr) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list =
match e with
| NameofExpr moduleNameIdent -> continuation [ visitIdentAsPotentialModuleName moduleNameIdent ]
| NameofExpr nameofResult -> continuation [ visitNameofResult nameofResult ]
| SynExpr.Const _ -> continuation []
| SynExpr.Paren(expr = expr) -> visit expr continuation
| SynExpr.Quote(operator = operator; quotedExpr = quotedExpr) ->
Expand Down Expand Up @@ -551,18 +576,22 @@ let (|NameofPat|_|) (pat: SynPat) =
| SynPat.LongIdent(longDotId = SynLongIdent(id = [ NameofIdent ]); typarDecls = None; argPats = SynArgPats.Pats [ moduleNamePat ]) ->
match stripPats moduleNamePat with
| SynPat.LongIdent(
longDotId = SynLongIdent.SynLongIdent(id = [ moduleNameIdent ]; dotRanges = []; trivia = [ None ])
longDotId = SynLongIdent.SynLongIdent(id = longIdent)
extraId = None
typarDecls = None
argPats = SynArgPats.Pats []
accessibility = None) -> Some moduleNameIdent
accessibility = None) ->
match longIdent with
| [] -> None
| [ moduleNameIdent ] -> Some(NameofResult.SingleIdent moduleNameIdent)
| lid -> Some(NameofResult.LongIdent lid)
| _ -> None
| _ -> None

let visitPat (p: SynPat) : FileContentEntry list =
let rec visit (p: SynPat) (continuation: FileContentEntry list -> FileContentEntry list) : FileContentEntry list =
match p with
| NameofPat moduleNameIdent -> continuation [ visitIdentAsPotentialModuleName moduleNameIdent ]
| NameofPat moduleNameIdent -> continuation [ visitNameofResult moduleNameIdent ]
| SynPat.Paren(pat = pat) -> visit pat continuation
| SynPat.Typed(pat = pat; targetType = t) -> visit pat (fun nodes -> nodes @ visitSynType t)
| SynPat.Const _ -> continuation []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ type Foo = class end
sourceFile
"Program"
"""
module Program
printfn "Hello"
"""
Set.empty
Expand Down Expand Up @@ -907,6 +909,35 @@ do
module Bar
let _ = nameof ((Foo))
"""
(set [| 0 |])
]
scenario
"prefixed module name in nameof expression"
[
sourceFile "A.fs" "module X.Y.Z" Set.empty
sourceFile
"B.fs"
"""
module B
open System.ComponentModel
[<Description(nameof X.Y.Z)>]
let v = 2
"""
(set [| 0 |])
]
scenario
"prefixed module name in nameof pattern"
[
sourceFile "A.fs" "module X.Y.Z" Set.empty
sourceFile
"B.fs"
"""
module B
do ignore (match "" with | nameof X.Y.Z -> () | _ -> ())
"""
(set [| 0 |])
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ type CompilerServiceBenchmarks() =
| Some _ -> configOpt
| None ->
let checker = FSharpChecker.Create(projectCacheSize = 200)
let source = FSharpSourceText.From(File.OpenRead("""..\..\..\..\..\..\..\..\..\src\Compiler\Checking\CheckExpressions.fs"""), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true)
let path = __SOURCE_DIRECTORY__ ++ ".." ++ ".." ++ ".." ++ ".." ++ "src" ++ "Compiler" ++ "Checking" ++ "CheckExpressions.fs"
let source = FSharpSourceText.From(File.OpenRead(path), Encoding.Default, FSharpSourceHashAlgorithm.Sha1, true)
let assemblies =
AppDomain.CurrentDomain.GetAssemblies()
|> Array.map (fun x -> x.Location)
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/tests/benchmarks/SmokeTestBenchmarks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Run {

dotnet run `
--project $path `
-c release `
-c Release `
--no-build `
--job Dry `
--allCategories short `
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/tests/benchmarks/SmokeTestBenchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run() {
local path=$1
dotnet run \
--project $path \
-c release \
-c Release \
--no-build \
--job Dry \
--allCategories short \
Expand Down
4 changes: 2 additions & 2 deletions src/source-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"commitSha": "642934d511abb9916d7da0d118a7357d35d4f2cb"
},
{
"packageVersion": "8.0.300-beta.24120.1",
"packageVersion": "8.0.300-beta.24122.3",
"path": "fsharp",
"remoteUri": "https://github.com/dotnet/fsharp",
"commitSha": "f2a6810476e1b589bcf56eb5f377c5214c509bc6"
"commitSha": "02bb351b606468bce98688fccda9d0c8adcd964d"
},
{
"packageVersion": "9.0.100",
Expand Down

0 comments on commit d7aa4e7

Please sign in to comment.