Skip to content

Commit

Permalink
Merge branch 'main' into merges/release/dev17.8-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
vzarytovskii authored Oct 11, 2023
2 parents acf8795 + 111361d commit 76fe024
Show file tree
Hide file tree
Showing 140 changed files with 2,062 additions and 1,216 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \
# Verify bash, git, process tools, lsb-release (common in install instructions for CLIs) installed
&& apt-get -y install bash git openssh-client less iproute2 procps lsb-release \
&& apt-get -y install gnupg \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
Expand All @@ -23,4 +24,4 @@ RUN apt-get update \
ENV DEBIAN_FRONTEND=dialog

# Make sure we can build using plain dotnet
ENV BUILDING_USING_DOTNET="true"
ENV BUILDING_USING_DOTNET="true"
12 changes: 8 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
"type": "shell",
"args": [
"build",
"-c Debug",
"-c",
"Debug",
"FSharp.Compiler.Service.sln"
],
"windows": {
"command": "dotnet",
"args": [
"build",
"-c Debug",
"-c",
"Debug",
"FSharp.Compiler.Service.sln"
],
},
Expand All @@ -40,14 +42,16 @@
"type": "shell",
"args": [
"build",
"-c Release",
"-c",
"Release",
"FSharp.Compiler.Service.sln"
],
"windows": {
"command": "dotnet",
"args": [
"build",
"-c Release",
"-c",
"Release",
"FSharp.Compiler.Service.sln"
],
},
Expand Down
6 changes: 6 additions & 0 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ You can find all test options as separate flags. For example `build -testAll`:

Running any of the above will build the latest changes and run tests against them.

## Using your custom compiler to build this repository

By removing all the subfolders called `Proto` under `artifacts` and running the `build` script again, the proto compiler will include your changes.

Once the "proto" compiler is built, it won't be built again, so you may want to perform those steps again to ensure your changes don't break building the compiler itself.

## Using your custom compiler to build other projects

Building the compiler using `build.cmd` or `build.sh` will output artifacts in `artifacts\bin`.
Expand Down
25 changes: 1 addition & 24 deletions INTERNAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,6 @@ Since github issue filtering is currently not flexible enough, that query was ge
Invoke-WebRequest -Uri "https://api.github.com/repos/dotnet/fsharp/labels?per_page=100" | ConvertFrom-Json | % { $_.name } | ? { $_.StartsWith("Area-") } | % { Write-Host -NoNewLine ('-label:"' + $_ + '" ') }
```

## Less interesting links

[FSharp.Core (Official NuGet Release)](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=72).
Uploads the final `FSharp.Core` package from the specified build to NuGet. This should only be run when we know for
certain which build produced the final offical package.

[FSharp.Core (Preview NuGet Release)](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=92).
Uploads the preview `FSharp.Core.*-beta.*` package from the specified build to NuGet. This should be run every time
a new SDK preview is released.

[FCS (Official NuGet Release)](https://dev.azure.com/dnceng/internal/_release?view=mine&_a=releases&definitionId=99).
Uploads the final `FSharp.Compiler.Service` package from the specified build to NuGet. Only builds from the `release/fcs`
branch can be selected. This should only be run when we're fairly certain that the package is complete.

[FCS (Preview NuGet Release)](https://dev.azure.com/dnceng/internal/_release?view=mine&_a=releases&definitionId=98).
Uploads the preview `FSharp.Compiler.Service.*-preview.*` package from the specified build to NuGet. Only builds from the
`main` branch can be selected. This can be run whenever we think we're ready to preview a new FCS build.

[Nightly VSIX (main) uploader](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=70). Uploads
a package from every build of `main` to the [Nightly VSIX feed](README.md#using-nightly-releases-in-visual-studio).

[Nightly VSIX (preview) uploader](https://dev.azure.com/dnceng/internal/_release?_a=releases&definitionId=71). Uploads
a package from every build of the branch that corresponds to the current Visual Studio preview to the
[Preview VSIX feed](README.md#using-nightly-releases-in-visual-studio).
## Other links

[Internal source mirror](https://dev.azure.com/dnceng/internal/_git/dotnet-fsharp).
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Even if you find a single-character typo, we're happy to take the change! Althou
<add key="fsharp-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
```

**NOTE:** Official NuGet releases of FCS and FSharp.Core are synched with SDK releases (on purpose - we want to be in sync). Nightly packages release to Azure feeds on every successful insertion.

## Branches

These are the branches in use:
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ stages:
- template: eng/release/insert-into-vs.yml
parameters:
componentBranchName: refs/heads/release/dev17.8
insertTargetBranch: rel/d17.8
insertTargetBranch: main
insertTeamEmail: fsharpteam@microsoft.com
insertTeamName: 'F#'
completeInsertion: 'auto'
24 changes: 12 additions & 12 deletions 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.23468.3">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.23509.2">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>b88b567fbf54c5404d039b80cfb86f09a681f604</Sha>
<Sha>8a2f652b1f23d493fcce31b73e829de56df38d5f</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.7.0-preview-23217-02">
Expand Down Expand Up @@ -39,25 +39,25 @@
<Sha>194f32828726c3f1f63f79f3dc09b9e99c157b11</Sha>
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" />
</Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.23471.3">
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.23507.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>ee166d79f3a269d2a1c6b7d400df7e284b1aa67b</Sha>
<Sha>9d70382f52bc311fa51e523bb066ebb012bf8035</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.23471.3">
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.23507.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>ee166d79f3a269d2a1c6b7d400df7e284b1aa67b</Sha>
<Sha>9d70382f52bc311fa51e523bb066ebb012bf8035</Sha>
</Dependency>
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.23471.3">
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.23507.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>ee166d79f3a269d2a1c6b7d400df7e284b1aa67b</Sha>
<Sha>9d70382f52bc311fa51e523bb066ebb012bf8035</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.23471.3">
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.23507.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>ee166d79f3a269d2a1c6b7d400df7e284b1aa67b</Sha>
<Sha>9d70382f52bc311fa51e523bb066ebb012bf8035</Sha>
</Dependency>
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.23471.3">
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.23507.6">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>ee166d79f3a269d2a1c6b7d400df7e284b1aa67b</Sha>
<Sha>9d70382f52bc311fa51e523bb066ebb012bf8035</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
10 changes: 5 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
<HumanizerCoreVersion>2.2.0</HumanizerCoreVersion>
<!-- MIBC profile packages -->
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.23471.3</optimizationwindows_ntx64MIBCRuntimeVersion>
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.23471.3</optimizationwindows_ntx86MIBCRuntimeVersion>
<optimizationwindows_ntarm64MIBCRuntimeVersion>1.0.0-prerelease.23471.3</optimizationwindows_ntarm64MIBCRuntimeVersion>
<optimizationlinuxx64MIBCRuntimeVersion>1.0.0-prerelease.23471.3</optimizationlinuxx64MIBCRuntimeVersion>
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.23471.3</optimizationlinuxarm64MIBCRuntimeVersion>
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.23507.6</optimizationwindows_ntx64MIBCRuntimeVersion>
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.23507.6</optimizationwindows_ntx86MIBCRuntimeVersion>
<optimizationwindows_ntarm64MIBCRuntimeVersion>1.0.0-prerelease.23507.6</optimizationwindows_ntarm64MIBCRuntimeVersion>
<optimizationlinuxx64MIBCRuntimeVersion>1.0.0-prerelease.23507.6</optimizationlinuxx64MIBCRuntimeVersion>
<optimizationlinuxarm64MIBCRuntimeVersion>1.0.0-prerelease.23507.6</optimizationlinuxarm64MIBCRuntimeVersion>
</PropertyGroup>
</Project>
3 changes: 1 addition & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"sdk": {
"version": "8.0.100-rc.1.23463.5",
"allowPrerelease": true,
"rollForward": "latestMajor"
"allowPrerelease": true
},
"tools": {
"dotnet": "8.0.100-rc.1.23463.5",
Expand Down
8 changes: 6 additions & 2 deletions src/Compiler/Checking/CheckComputationExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol
// Give bespoke error messages for the FSharp.Core "query" builder
let isQuery =
match stripDebugPoints interpExpr with
| Expr.Val (vref, _, m) ->
// An unparameterized custom builder, e.g., `query`, `async`.
| Expr.Val (vref, _, m)
// A parameterized custom builder, e.g., `builder<…>`, `builder ()`.
| Expr.App (funcExpr = Expr.Val (vref, _, m)) ->
let item = Item.CustomBuilder (vref.DisplayName, vref)
CallNameResolutionSink cenv.tcSink (m, env.NameEnv, item, emptyTyparInst, ItemOccurence.Use, env.eAccessRights)
valRefEq cenv.g vref cenv.g.query_value_vref
Expand Down Expand Up @@ -2210,14 +2213,15 @@ let TcSequenceExpression (cenv: cenv) env tpenv comp (overallTy: OverallTy) m =

let env = { env with eContextInfo = ContextInfo.SequenceExpression genOuterTy }

if enableImplicitYield then
if enableImplicitYield then
let hasTypeUnit, expr, tpenv = TryTcStmt cenv env tpenv comp
if hasTypeUnit then
Choice2Of2 expr, tpenv
else
let genResultTy = NewInferenceType g
let mExpr = expr.Range
UnifyTypes cenv env mExpr genOuterTy (mkSeqTy cenv.g genResultTy)
let expr, tpenv = TcExprFlex cenv flex true genResultTy env tpenv comp
let exprTy = tyOfExpr cenv.g expr
AddCxTypeMustSubsumeType env.eContextInfo env.DisplayEnv cenv.css mExpr NoTrace genResultTy exprTy
let resExpr = mkCallSeqSingleton cenv.g mExpr genResultTy (mkCoerceExpr(expr, genResultTy, mExpr, exprTy))
Expand Down
17 changes: 13 additions & 4 deletions src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10759,6 +10759,15 @@ and TcNonrecBindingTyparDecls cenv env tpenv bind =
TcBindingTyparDecls true cenv env tpenv synTyparDecls

and TcNonRecursiveBinding declKind cenv env tpenv ty binding =
// Check for unintended shadowing
match binding with
| SynBinding(headPat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ident]); range = headPatRange)) ->
match env.eNameResEnv.ePatItems.TryFind ident.idText with
| Some (Item.UnionCase(_, false)) ->
warning(Error(FSComp.SR.tcInfoIfFunctionShadowsUnionCase(), headPatRange))
| _ -> ()
| _ -> ()

let binding = BindingNormalization.NormalizeBinding ValOrMemberBinding cenv env binding
let explicitTyparInfo, tpenv = TcNonrecBindingTyparDecls cenv env tpenv binding
TcNormalizedBinding declKind cenv env tpenv ty None NoSafeInitInfo ([], explicitTyparInfo) binding
Expand All @@ -10779,6 +10788,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn
let mAttr = synAttr.Range
let typath, tyid = List.frontAndBack tycon
let tpenv = emptyUnscopedTyparEnv
let ad = env.eAccessRights

// if we're checking an attribute that was applied directly to a getter or a setter, then
// what we're really checking against is a method, not a property
Expand All @@ -10787,13 +10797,12 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn
let try1 n =
let tyid = mkSynId tyid.idRange n
let tycon = (typath @ [tyid])
let ad = env.eAccessRights

match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurence.UseInAttribute OpenQualified env.eNameResEnv ad tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with
| Exception err -> raze err
| _ -> success(TcTypeAndRecover cenv NoNewTypars CheckCxs ItemOccurence.UseInAttribute WarnOnIWSAM.Yes env tpenv (SynType.App(SynType.LongIdent(SynLongIdent(tycon, [], List.replicate tycon.Length None)), None, [], [], None, false, mAttr)) )
ForceRaise ((try1 (tyid.idText + "Attribute")) |> otherwise (fun () -> (try1 tyid.idText)))
| Result(tinstEnclosing, tcref) -> success(TcTypeApp cenv NoNewTypars CheckCxs ItemOccurence.UseInAttribute env tpenv mAttr tcref tinstEnclosing [])

let ad = env.eAccessRights
ForceRaise ((try1 (tyid.idText + "Attribute")) |> otherwise (fun () -> (try1 tyid.idText)))

if not (IsTypeAccessible g cenv.amap mAttr ad ty) then errorR(Error(FSComp.SR.tcTypeIsInaccessible(), mAttr))

Expand Down
Loading

0 comments on commit 76fe024

Please sign in to comment.