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 main to release/dev17.11 #17038

Merged
merged 10 commits into from
Apr 12, 2024
12 changes: 5 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
{
"name": "F#",
"image": "mcr.microsoft.com/dotnet/sdk:8.0",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-preview.2",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "2"
},
"ghcr.io/devcontainers/features/dotnet:2": {}
"ghcr.io/devcontainers/features/common-utils:2.4.2": {},
"ghcr.io/devcontainers/features/git:1.2.0": {},
"ghcr.io/devcontainers/features/github-cli:1.0.11": {},
"ghcr.io/devcontainers/features/dotnet:2.0.5": {}
},
"hostRequirements": {
"cpus": 2,
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project>

<PropertyGroup>
<PackageProjectUrl>https://github.com/dotnet/fsharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotnet/fsharp</RepositoryUrl>
<LangVersion Condition="'$(FSharpLangVersion)' != ''">$(FSharpLangVersion)</LangVersion>
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
Expand Down
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ variables:
# Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9
# Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice.
- name: FSharpReleaseBranchName
value: release/dev17.10
value: release/dev17.11
# VS Insertion branch name (NOT the same as F# branch)
# Should be previous release branch in 'main' and 'main' in release branch
# Should be previous release branch or 'main' in 'main' and 'main' in release branch
# (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release),
# i.e. 'rel/d17.9' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10
# i.e. 'rel/d17.9' *or* 'main' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10 (latest release branch)
- name: VSInsertionTargetBranchName
value: rel/d17.10
value: main
- name: _TeamName
value: FSharp
- name: TeamName
Expand Down Expand Up @@ -85,7 +85,7 @@ extends:
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
# Localization: we only run it for specific release branches
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.10') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.11') }}:
- template: /eng/common/templates-official/job/onelocbuild.yml@self
parameters:
MirrorRepo: fsharp
Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/.FSharp.Compiler.Service/8.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 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), [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), [PR #16901](https://github.com/dotnet/fsharp/pull/16901), [PR #16973](https://github.com/dotnet/fsharp/pull/16973))
* Various parenthesization API fixes. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666), [PR #16901](https://github.com/dotnet/fsharp/pull/16901), [PR #16973](https://github.com/dotnet/fsharp/pull/16973), [PR #17012](https://github.com/dotnet/fsharp/pull/17012))
* Keep parens for problematic exprs (`if`, `match`, etc.) in `$"{(…):N0}"`, `$"{(…),-3}"`, etc. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578))
* Fix crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode [#PR 16471](https://github.com/dotnet/fsharp/pull/16471))
* Fix16572 - Fixed the preview feature enabling Is properties for union case did not work correctly with let .rec and .fsi files ([PR #16657](https://github.com/dotnet/fsharp/pull/16657))
Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/.VisualStudio/17.10.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Fixed

* Show signature help mid-pipeline in more scenarios. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462))
* Various unneeded parentheses code fix improvements. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666), [PR #16789](https://github.com/dotnet/fsharp/pull/16789), [PR #16901](https://github.com/dotnet/fsharp/pull/16901))
* Various unneeded parentheses code fix improvements. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666), [PR #16789](https://github.com/dotnet/fsharp/pull/16789), [PR #16901](https://github.com/dotnet/fsharp/pull/16901), [PR #17012](https://github.com/dotnet/fsharp/pull/17012))

### Changed

Expand Down
6 changes: 3 additions & 3 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
These will go away when repo updates targeting to net8.0
Tracked with https://github.com/dotnet/fsharp/issues/14765
-->
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/7.0.11" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.linux-x64/7.0.11" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Ref/7.0.11" />
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.linux-x64/8.0.1" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Ref/8.0.1" />
<UsagePattern IdentityGlob="System.Configuration.ConfigurationManager/7.0.0" />
<UsagePattern IdentityGlob="System.Diagnostics.EventLog/7.0.0" />
<UsagePattern IdentityGlob="System.Security.Cryptography.ProtectedData/7.0.0" />
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- F# Version components -->
<FSMajorVersion>8</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>300</FSBuildVersion>
<FSBuildVersion>400</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
Expand All @@ -39,7 +39,7 @@
<FSharpCompilerServiceReleaseNotesVersion>$(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion)</FSharpCompilerServiceReleaseNotesVersion>
<!-- -->
<!-- The current published nuget package -->
<FSharpCoreShippedPackageVersionValue>8.0.100</FSharpCoreShippedPackageVersionValue>
<FSharpCoreShippedPackageVersionValue>8.0.200</FSharpCoreShippedPackageVersionValue>
<!-- -->
<!-- The pattern for specifying the preview package -->
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>
Expand All @@ -56,7 +56,7 @@
<PropertyGroup>
<!-- These have to be in sync with latest release branch -->
<VSMajorVersion>17</VSMajorVersion>
<VSMinorVersion>10</VSMinorVersion>
<VSMinorVersion>11</VSMinorVersion>
<VSGeneralVersion>$(VSMajorVersion).0</VSGeneralVersion>
<VSAssemblyVersionPrefix>$(VSMajorVersion).$(VSMinorVersion).0</VSAssemblyVersionPrefix>
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>
Expand Down
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"sdk": {
"version": "8.0.101",
"version": "9.0.100-preview.2.24157.14",
"allowPrerelease": true
},
"tools": {
"dotnet": "8.0.101",
"dotnet": "9.0.100-preview.2.24157.14",
"vs": {
"version": "17.8",
"components": [
"Microsoft.VisualStudio.Component.FSharp"
]
},
"xcopy-msbuild": "17.8.1-2"
"xcopy-msbuild": "17.8.5"
},
"native-tools": {
"perl": "5.38.0.1"
Expand Down
152 changes: 81 additions & 71 deletions src/Compiler/Checking/CheckComputationExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2596,83 +2596,93 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol
trans CompExprTranslationPass.Initial CustomOperationsMode.Denied emptyVarSpace comp id

and trans firstTry q varSpace comp translatedCtxt =
match tryTrans firstTry q varSpace comp translatedCtxt with
| Some e -> e
| None ->
// This only occurs in final position in a sequence
match comp with
// "do! expr;" in final position is treated as { let! () = expr in return () } when Return is provided (and no Zero with Default attribute is available) or as { let! () = expr in zero } otherwise
| SynExpr.DoBang(rhsExpr, m) ->
let mUnit = rhsExpr.Range
let rhsExpr = mkSourceExpr rhsExpr
cenv.stackGuard.Guard
<| fun () ->
match tryTrans firstTry q varSpace comp translatedCtxt with
| Some e -> e
| None ->
// This only occurs in final position in a sequence
match comp with
// "do! expr;" in final position is treated as { let! () = expr in return () } when Return is provided (and no Zero with Default attribute is available) or as { let! () = expr in zero } otherwise
| SynExpr.DoBang(rhsExpr, m) ->
let mUnit = rhsExpr.Range
let rhsExpr = mkSourceExpr rhsExpr

if isQuery then
error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), m))
if isQuery then
error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), m))

let bodyExpr =
if
isNil (
TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AtMostOneResult cenv env m ad "Return" builderTy
let bodyExpr =
if
isNil (
TryFindIntrinsicOrExtensionMethInfo
ResultCollectionSettings.AtMostOneResult
cenv
env
m
ad
"Return"
builderTy
)
then
SynExpr.ImplicitZero m
else
match
TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AtMostOneResult cenv env m ad "Zero" builderTy
with
| minfo :: _ when MethInfoHasAttribute cenv.g m cenv.g.attrib_DefaultValueAttribute minfo ->
SynExpr.ImplicitZero m
| _ -> SynExpr.YieldOrReturn((false, true), SynExpr.Const(SynConst.Unit, m), m)

let letBangBind =
SynExpr.LetOrUseBang(
DebugPointAtBinding.NoneAtDo,
false,
false,
SynPat.Const(SynConst.Unit, mUnit),
rhsExpr,
[],
bodyExpr,
m,
SynExprLetOrUseBangTrivia.Zero
)
then
SynExpr.ImplicitZero m
else
match
TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AtMostOneResult cenv env m ad "Zero" builderTy
with
| minfo :: _ when MethInfoHasAttribute cenv.g m cenv.g.attrib_DefaultValueAttribute minfo -> SynExpr.ImplicitZero m
| _ -> SynExpr.YieldOrReturn((false, true), SynExpr.Const(SynConst.Unit, m), m)

let letBangBind =
SynExpr.LetOrUseBang(
DebugPointAtBinding.NoneAtDo,
false,
false,
SynPat.Const(SynConst.Unit, mUnit),
rhsExpr,
[],
bodyExpr,
m,
SynExprLetOrUseBangTrivia.Zero
)

trans CompExprTranslationPass.Initial q varSpace letBangBind translatedCtxt
trans CompExprTranslationPass.Initial q varSpace letBangBind translatedCtxt

// "expr;" in final position is treated as { expr; zero }
// Suppress the sequence point on the "zero"
| _ ->
// Check for 'where x > y' and other mis-applications of infix operators. If detected, give a good error message, and just ignore comp
if isQuery && checkForBinaryApp comp then
trans CompExprTranslationPass.Initial q varSpace (SynExpr.ImplicitZero comp.Range) translatedCtxt
else
if isQuery && not comp.IsArbExprAndThusAlreadyReportedError then
match comp with
| SynExpr.JoinIn _ -> () // an error will be reported later when we process innerComp1 as a sequential
| _ -> errorR (Error(FSComp.SR.tcUnrecognizedQueryOperator (), comp.RangeOfFirstPortion))

trans CompExprTranslationPass.Initial q varSpace (SynExpr.ImplicitZero comp.Range) (fun holeFill ->
let fillExpr =
if enableImplicitYield then
let implicitYieldExpr = mkSynCall "Yield" comp.Range [ comp ]

SynExpr.SequentialOrImplicitYield(
DebugPointAtSequential.SuppressExpr,
comp,
holeFill,
implicitYieldExpr,
comp.Range
)
else
SynExpr.Sequential(
DebugPointAtSequential.SuppressExpr,
true,
comp,
holeFill,
comp.Range,
SynExprSequentialTrivia.Zero
)
// "expr;" in final position is treated as { expr; zero }
// Suppress the sequence point on the "zero"
| _ ->
// Check for 'where x > y' and other mis-applications of infix operators. If detected, give a good error message, and just ignore comp
if isQuery && checkForBinaryApp comp then
trans CompExprTranslationPass.Initial q varSpace (SynExpr.ImplicitZero comp.Range) translatedCtxt
else
if isQuery && not comp.IsArbExprAndThusAlreadyReportedError then
match comp with
| SynExpr.JoinIn _ -> () // an error will be reported later when we process innerComp1 as a sequential
| _ -> errorR (Error(FSComp.SR.tcUnrecognizedQueryOperator (), comp.RangeOfFirstPortion))

trans CompExprTranslationPass.Initial q varSpace (SynExpr.ImplicitZero comp.Range) (fun holeFill ->
let fillExpr =
if enableImplicitYield then
let implicitYieldExpr = mkSynCall "Yield" comp.Range [ comp ]

SynExpr.SequentialOrImplicitYield(
DebugPointAtSequential.SuppressExpr,
comp,
holeFill,
implicitYieldExpr,
comp.Range
)
else
SynExpr.Sequential(
DebugPointAtSequential.SuppressExpr,
true,
comp,
holeFill,
comp.Range,
SynExprSequentialTrivia.Zero
)

translatedCtxt fillExpr)
translatedCtxt fillExpr)

and transBind q varSpace bindRange addBindDebugPoint bindName bindArgs (consumePat: SynPat) (innerComp: SynExpr) translatedCtxt =

Expand Down
Loading
Loading