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 #17346

Merged
merged 4 commits into from
Jun 26, 2024
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
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/8.0.400.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Fixed

* Fix a false positive of the `[<TailCall>]` analysis in combination with async. ([Issue #17237](https://github.com/dotnet/fsharp/issues/17237), [PR #17241](https://github.com/dotnet/fsharp/pull/17241))
* Extended #help directive in fsi to show documentation in the REPL. ([PR #17140](https://github.com/dotnet/fsharp/pull/17140))
* Fix internal error when dotting into delegates with multiple type parameters. ([PR #17227](https://github.com/dotnet/fsharp/pull/17227))
* Error for partial implementation of interface with static and non-static abstract members. ([Issue #17138](https://github.com/dotnet/fsharp/issues/17138), [PR #17160](https://github.com/dotnet/fsharp/pull/17160))
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24324.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24311.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>748cd976bf8b0f69b809e569943635ab8be36dc8</Sha>
<Sha>c214b6ad17aedca4fa48294d80f6c52ef2463081</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
Expand Down
8 changes: 0 additions & 8 deletions eng/common/templates-official/job/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ parameters:
# container and pool.
platform: {}

# If set to true and running on a non-public project,
# Internal blob storage locations will be enabled.
# This is not enabled by default because many repositories do not need internal sources
# and do not need to have the required service connections approved in the pipeline.
enableInternalSources: false

jobs:
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
displayName: Source-Build (${{ parameters.platform.name }})
Expand Down Expand Up @@ -68,8 +62,6 @@ jobs:
clean: all

steps:
- ${{ if eq(parameters.enableInternalSources, true) }}:
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
- template: /eng/common/templates-official/steps/source-build.yml
parameters:
platform: ${{ parameters.platform }}
8 changes: 0 additions & 8 deletions eng/common/templates-official/jobs/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ parameters:
# one job runs on 'defaultManagedPlatform'.
platforms: []

# If set to true and running on a non-public project,
# Internal nuget and blob storage locations will be enabled.
# This is not enabled by default because many repositories do not need internal sources
# and do not need to have the required service connections approved in the pipeline.
enableInternalSources: false

jobs:

- ${{ if ne(parameters.allCompletedJobId, '') }}:
Expand All @@ -44,11 +38,9 @@ jobs:
parameters:
jobNamePrefix: ${{ parameters.jobNamePrefix }}
platform: ${{ platform }}
enableInternalSources: ${{ parameters.enableInternalSources }}

- ${{ if eq(length(parameters.platforms), 0) }}:
- template: /eng/common/templates-official/job/source-build.yml
parameters:
jobNamePrefix: ${{ parameters.jobNamePrefix }}
platform: ${{ parameters.defaultManagedPlatform }}
enableInternalSources: ${{ parameters.enableInternalSources }}

This file was deleted.

43 changes: 0 additions & 43 deletions eng/common/templates-official/steps/get-delegation-sas.yml

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions eng/common/templates/job/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ parameters:
# container and pool.
platform: {}

# If set to true and running on a non-public project,
# Internal blob storage locations will be enabled.
# This is not enabled by default because many repositories do not need internal sources
# and do not need to have the required service connections approved in the pipeline.
enableInternalSources: false

jobs:
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
displayName: Source-Build (${{ parameters.platform.name }})
Expand Down Expand Up @@ -67,8 +61,6 @@ jobs:
clean: all

steps:
- ${{ if eq(parameters.enableInternalSources, true) }}:
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
- template: /eng/common/templates/steps/source-build.yml
parameters:
platform: ${{ parameters.platform }}
8 changes: 0 additions & 8 deletions eng/common/templates/jobs/source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ parameters:
# one job runs on 'defaultManagedPlatform'.
platforms: []

# If set to true and running on a non-public project,
# Internal nuget and blob storage locations will be enabled.
# This is not enabled by default because many repositories do not need internal sources
# and do not need to have the required service connections approved in the pipeline.
enableInternalSources: false

jobs:

- ${{ if ne(parameters.allCompletedJobId, '') }}:
Expand All @@ -44,11 +38,9 @@ jobs:
parameters:
jobNamePrefix: ${{ parameters.jobNamePrefix }}
platform: ${{ platform }}
enableInternalSources: ${{ parameters.enableInternalSources }}

- ${{ if eq(length(parameters.platforms), 0) }}:
- template: /eng/common/templates/job/source-build.yml
parameters:
jobNamePrefix: ${{ parameters.jobNamePrefix }}
platform: ${{ parameters.defaultManagedPlatform }}
enableInternalSources: ${{ parameters.enableInternalSources }}
28 changes: 0 additions & 28 deletions eng/common/templates/steps/enable-internal-runtimes.yml

This file was deleted.

43 changes: 0 additions & 43 deletions eng/common/templates/steps/get-delegation-sas.yml

This file was deleted.

28 changes: 0 additions & 28 deletions eng/common/templates/steps/get-federated-access-token.yml

This file was deleted.

2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"perl": "5.38.2.2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.1",
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24311.3",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
}
}
13 changes: 12 additions & 1 deletion src/Compiler/Checking/TailCallChecks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,18 @@ let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) =
| Expr.Lambda(bodyExpr = bodyExpr) -> checkTailCall insideSubBindingOrTry bodyExpr
| Expr.DebugPoint(_debugPointAtLeafExpr, expr) -> checkTailCall insideSubBindingOrTry expr
| Expr.Let(binding = binding; bodyExpr = bodyExpr) ->
checkTailCall true binding.Expr
// detect continuation shapes like MakeAsync
let isContinuation =
match bodyExpr with
| Expr.App(funcExpr = Expr.Val(valRef = valRef)) ->
match valRef.GeneralizedType with
| [ _ ],
TType_fun(domainType = TType_fun(domainType = TType_app _; rangeType = TType_app _); rangeType = TType_app _) ->
true
| _ -> false
| _ -> false

checkTailCall (not isContinuation) binding.Expr

let warnForBodyExpr =
insideSubBindingOrTry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1683,3 +1683,42 @@ module M =
Message =
"The member or function 'traverseSequentials' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." }
]

[<FSharp.Test.FactForNETCOREAPP>]
let ``Don't warn for rec call of async func that evaluates an async parameter in a match!`` () =
"""
namespace N

module M =

[<TailCall>]
let rec f (g: bool Async) = async {
match! g with
| false -> ()
| true -> return! f g
}
"""
|> FSharp
|> withLangVersion80
|> compile
|> shouldSucceed

[<FSharp.Test.FactForNETCOREAPP>]
let ``Don't warn for rec call of async func that evaluates an async parameter in a let!`` () =
"""
namespace N

module M =

[<TailCall>]
let rec f (g: bool Async) = async {
let! x = g
match x with
| false -> ()
| true -> return! f g
}
"""
|> FSharp
|> withLangVersion80
|> compile
|> shouldSucceed
Loading