Skip to content

Commit c2400bb

Browse files
committed
Merge remote-tracking branch 'upstream/main' into SupportCallerArgumentExpression
2 parents 8aa12a2 + 24b393c commit c2400bb

File tree

121 files changed

+855
-12961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+855
-12961
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ launchSettings.json
7474
*.jrs
7575
*.chk
7676
*.bak
77+
*.out
7778
*.vserr
7879
*.err
7980
*.orig
@@ -145,3 +146,4 @@ tests/**/TestResults/*.trx
145146
# Standard output/error files in root directory
146147
StandardOutput.txt
147148
StandardError.txt
149+
**/TestResults/

docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Add support for tail calls in computation expressions ([PR #18804](https://github.com/dotnet/fsharp/pull/18804))
55
* Add `--typecheck-only` flag support for F# Interactive (FSI) scripts to type-check without execution. ([Issue #18686](https://github.com/dotnet/fsharp/issues/18686))
66
* Diagnostics: add extended data for 'No constructors' error ([PR #18863](https://github.com/dotnet/fsharp/pull/18863))
7+
* FSharpType.Format: support top-level prefix generic types style. ([PR #18897](https://github.com/dotnet/fsharp/pull/18897))
8+
* FCS: allow getting captured types ([PR $18878](https://github.com/dotnet/fsharp/pull/18878))
79
* Support `CallerArgumentExpression` ([Language Suggestion #966](https://github.com/fsharp/fslang-suggestions/issues/966), [PR #17519](https://github.com/dotnet/fsharp/pull/17519))
810

911
### Fixed
@@ -25,11 +27,15 @@
2527
* Fix Show XML doc for enum fields in external metadata ([Issue #17939](https://github.com/dotnet/fsharp/issues/17939#issuecomment-3137410105), [PR #18800](https://github.com/dotnet/fsharp/pull/18800))
2628
* Fix nullable types formatting in `FSharpType.Format` and tooltips to include parentheses. ([PR #18842](https://github.com/dotnet/fsharp/pull/18842))
2729
* TypeMismatchDiagnosticExtendedData: fix expected and actual types calculation. ([Issue ](https://github.com/dotnet/fsharp/pull/18851))
30+
* Format top-level generic types using a prefix style in inherit/interface declarations and flexible type annotations. ([PR #18897](https://github.com/dotnet/fsharp/pull/18897))
31+
* Parser: fix range for computed binding expressions ([PR #18903](https://github.com/dotnet/fsharp/pull/18903))
2832

2933
### Changed
3034
* Use `errorR` instead of `error` in `CheckDeclarations.fs` when possible. ([PR #18645](https://github.com/dotnet/fsharp/pull/18645))
3135
* Parser: Capture named fields block separators. ([PR #18857](https://github.com/dotnet/fsharp/pull/18857))
3236
* Type checker: use inner expr range in upcast constraints errors ([PR #18850](https://github.com/dotnet/fsharp/pull/18850))
37+
* Import `IEnumerable` as `seq`. ([PR #18865](https://github.com/dotnet/fsharp/pull/18865))
38+
* Parser: Capture multiple block separators ([PR #18899](https://github.com/dotnet/fsharp/pull/18899))
3339
* `assert` keyword enhancement ([Issue #18489](https://github.com/dotnet/fsharp/issues/18489), [PR #17519](https://github.com/dotnet/fsharp/pull/17519))
3440

3541
### Breaking Changes

docs/release-notes/.VisualStudio/17.13.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
* Code fix for adding missing `seq`. ([PR #17772](https://github.com/dotnet/fsharp/pull/17772))
66

77
### Changed
8+
* Updated OpenTelemetry package references to version 1.11.2 for improved telemetry capabilities.
89

910
### Breaking Changes

docs/release-notes/.VisualStudio/17.14.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66

77
### Changed
88
* Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341))
9+
* Updated OpenTelemetry package references to version 1.11.2 for improved telemetry capabilities.
910

1011
### Breaking Changes
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Fixed
2+
* Split package init into foreground+background, fix background analysis setting ([Issue #18623](https://github.com/dotnet/fsharp/issues/18623), [Issue #18904](https://github.com/dotnet/fsharp/issues/18904), [PR #18646](https://github.com/dotnet/fsharp/pull/18646))
3+
4+
### Added
5+
6+
### Changed
7+
8+
### Breaking Changes

eng/Version.Details.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ This file should be imported by eng/Versions.props
66
<Project>
77
<PropertyGroup>
88
<!-- dotnet/msbuild dependencies -->
9-
<MicrosoftBuildPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildPackageVersion>
10-
<MicrosoftBuildFrameworkPackageVersion>17.15.0-preview-25278-01</MicrosoftBuildFrameworkPackageVersion>
11-
<MicrosoftBuildTasksCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildTasksCorePackageVersion>
12-
<MicrosoftBuildUtilitiesCorePackageVersion>17.15.0-preview-25278-01</MicrosoftBuildUtilitiesCorePackageVersion>
9+
<MicrosoftBuildPackageVersion>18.0.0-preview-25465-08</MicrosoftBuildPackageVersion>
10+
<MicrosoftBuildFrameworkPackageVersion>18.0.0-preview-25465-08</MicrosoftBuildFrameworkPackageVersion>
11+
<MicrosoftBuildTasksCorePackageVersion>18.0.0-preview-25465-08</MicrosoftBuildTasksCorePackageVersion>
12+
<MicrosoftBuildUtilitiesCorePackageVersion>18.0.0-preview-25465-08</MicrosoftBuildUtilitiesCorePackageVersion>
1313
<!-- dotnet/runtime dependencies -->
1414
<SystemCollectionsImmutablePackageVersion>9.0.0</SystemCollectionsImmutablePackageVersion>
1515
<SystemComponentModelCompositionPackageVersion>9.0.0</SystemComponentModelCompositionPackageVersion>
@@ -20,11 +20,11 @@ This file should be imported by eng/Versions.props
2020
<!-- dotnet/arcade dependencies -->
2121
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25426.3</MicrosoftDotNetArcadeSdkPackageVersion>
2222
<!-- _git/dotnet-optimization dependencies -->
23-
<optimizationlinuxarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25421.1</optimizationlinuxarm64MIBCRuntimePackageVersion>
24-
<optimizationlinuxx64MIBCRuntimePackageVersion>1.0.0-prerelease.25421.1</optimizationlinuxx64MIBCRuntimePackageVersion>
25-
<optimizationwindows_ntarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25421.1</optimizationwindows_ntarm64MIBCRuntimePackageVersion>
26-
<optimizationwindows_ntx64MIBCRuntimePackageVersion>1.0.0-prerelease.25421.1</optimizationwindows_ntx64MIBCRuntimePackageVersion>
27-
<optimizationwindows_ntx86MIBCRuntimePackageVersion>1.0.0-prerelease.25421.1</optimizationwindows_ntx86MIBCRuntimePackageVersion>
23+
<optimizationlinuxarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25458.1</optimizationlinuxarm64MIBCRuntimePackageVersion>
24+
<optimizationlinuxx64MIBCRuntimePackageVersion>1.0.0-prerelease.25458.1</optimizationlinuxx64MIBCRuntimePackageVersion>
25+
<optimizationwindows_ntarm64MIBCRuntimePackageVersion>1.0.0-prerelease.25458.1</optimizationwindows_ntarm64MIBCRuntimePackageVersion>
26+
<optimizationwindows_ntx64MIBCRuntimePackageVersion>1.0.0-prerelease.25458.1</optimizationwindows_ntx64MIBCRuntimePackageVersion>
27+
<optimizationwindows_ntx86MIBCRuntimePackageVersion>1.0.0-prerelease.25458.1</optimizationwindows_ntx86MIBCRuntimePackageVersion>
2828
</PropertyGroup>
2929
<!--Property group for alternate package version names-->
3030
<PropertyGroup>

eng/Version.Details.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="fsharp" Sha="7ac1ca67bb1fb8a381c1c94a9f82a97725f0ccf3" BarId="281128" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="fsharp" Sha="8ea69c337be69385ff7eb44b2a54db78010110d8" BarId="282240" />
44
<ProductDependencies>
5-
<Dependency Name="Microsoft.Build" Version="17.15.0-preview-25278-01">
5+
<Dependency Name="Microsoft.Build" Version="18.0.0-preview-25465-08">
66
<Uri>https://github.com/dotnet/msbuild</Uri>
7-
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
7+
<Sha>36b870ef0e3bc607c96e23f1f2d20125947be598</Sha>
88
</Dependency>
9-
<Dependency Name="Microsoft.Build.Framework" Version="17.15.0-preview-25278-01">
9+
<Dependency Name="Microsoft.Build.Framework" Version="18.0.0-preview-25465-08">
1010
<Uri>https://github.com/dotnet/msbuild</Uri>
11-
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
11+
<Sha>36b870ef0e3bc607c96e23f1f2d20125947be598</Sha>
1212
</Dependency>
13-
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.15.0-preview-25278-01">
13+
<Dependency Name="Microsoft.Build.Tasks.Core" Version="18.0.0-preview-25465-08">
1414
<Uri>https://github.com/dotnet/msbuild</Uri>
15-
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
15+
<Sha>36b870ef0e3bc607c96e23f1f2d20125947be598</Sha>
1616
</Dependency>
17-
<Dependency Name="Microsoft.Build.Utilities.Core" Version="17.15.0-preview-25278-01">
17+
<Dependency Name="Microsoft.Build.Utilities.Core" Version="18.0.0-preview-25465-08">
1818
<Uri>https://github.com/dotnet/msbuild</Uri>
19-
<Sha>6de64741f6440bb6730d9a342934ce49d600fcc9</Sha>
19+
<Sha>36b870ef0e3bc607c96e23f1f2d20125947be598</Sha>
2020
</Dependency>
2121
<Dependency Name="System.Reflection.Metadata" Version="9.0.0">
2222
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -48,25 +48,25 @@
4848
<Uri>https://github.com/dotnet/arcade</Uri>
4949
<Sha>5db998e02282e63bc375948a237bcdfef534a5c5</Sha>
5050
</Dependency>
51-
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25421.1">
51+
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.25458.1">
5252
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
53-
<Sha>b0395bd1ac86994182f1b1eb73bbdf4ce6338ca9</Sha>
53+
<Sha>373ed5bf1a64c212e655063e58967eb62f9187ef</Sha>
5454
</Dependency>
55-
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.25421.1">
55+
<Dependency Name="optimization.windows_nt-x86.MIBC.Runtime" Version="1.0.0-prerelease.25458.1">
5656
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
57-
<Sha>b0395bd1ac86994182f1b1eb73bbdf4ce6338ca9</Sha>
57+
<Sha>373ed5bf1a64c212e655063e58967eb62f9187ef</Sha>
5858
</Dependency>
59-
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.25421.1">
59+
<Dependency Name="optimization.linux-x64.MIBC.Runtime" Version="1.0.0-prerelease.25458.1">
6060
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
61-
<Sha>b0395bd1ac86994182f1b1eb73bbdf4ce6338ca9</Sha>
61+
<Sha>373ed5bf1a64c212e655063e58967eb62f9187ef</Sha>
6262
</Dependency>
63-
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25421.1">
63+
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25458.1">
6464
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
65-
<Sha>b0395bd1ac86994182f1b1eb73bbdf4ce6338ca9</Sha>
65+
<Sha>373ed5bf1a64c212e655063e58967eb62f9187ef</Sha>
6666
</Dependency>
67-
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25421.1">
67+
<Dependency Name="optimization.linux-arm64.MIBC.Runtime" Version="1.0.0-prerelease.25458.1">
6868
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
69-
<Sha>b0395bd1ac86994182f1b1eb73bbdf4ce6338ca9</Sha>
69+
<Sha>373ed5bf1a64c212e655063e58967eb62f9187ef</Sha>
7070
</Dependency>
7171
</ToolsetDependencies>
7272
</Dependencies>

src/Compiler/Checking/CheckRecordSyntaxHelpers.fs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,14 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid
9090
let totalRange (origId: Ident) (id: Ident) =
9191
withStartEnd origId.idRange.End id.idRange.Start origId.idRange
9292

93-
let rangeOfBlockSeparator (id: Ident) =
94-
let idEnd = id.idRange.End
95-
let blockSeparatorStartCol = idEnd.Column
96-
let blockSeparatorEndCol = blockSeparatorStartCol + 4
97-
let blockSeparatorStartPos = mkPos idEnd.Line blockSeparatorStartCol
98-
let blockSeparatorEndPos = mkPos idEnd.Line blockSeparatorEndCol
99-
100-
withStartEnd blockSeparatorStartPos blockSeparatorEndPos id.idRange
101-
10293
match withExpr with
103-
| SynExpr.Ident origId, (sepRange, _) ->
104-
let lid, rng = upToId sepRange id (origId :: ids)
105-
Some(SynExpr.LongIdent(false, LongIdentWithDots(lid, rng), None, totalRange origId id), (rangeOfBlockSeparator id, None))
94+
| SynExpr.Ident origId, (blockSep: BlockSeparator) ->
95+
let lid, rng = upToId blockSep.Range id (origId :: ids)
96+
97+
Some(
98+
SynExpr.LongIdent(false, LongIdentWithDots(lid, rng), None, totalRange origId id),
99+
BlockSeparator.Offside(blockSep.Range, None)
100+
)
106101
| _ -> None
107102

108103
let rec synExprRecd copyInfo (outerFieldId: Ident) innerFields exprBeingAssigned =

src/Compiler/Checking/CheckRecordSyntaxHelpers.fsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ open FSharp.Compiler.TypedTree
1010
val GroupUpdatesToNestedFields:
1111
fields: ((Ident list * Ident) * SynExpr option) list -> ((Ident list * Ident) * SynExpr option) list
1212

13-
val TransformAstForNestedUpdates<'a> :
13+
val TransformAstForNestedUpdates:
1414
cenv: TcFileState ->
1515
env: TcEnv ->
1616
overallTy: TType ->
1717
lid: LongIdent ->
1818
exprBeingAssigned: SynExpr ->
19-
withExpr: SynExpr * (range * 'a) ->
19+
withExpr: SynExpr * BlockSeparator ->
2020
(Ident list * Ident) * SynExpr option
2121

2222
val BindOriginalRecdExpr:

src/Compiler/Checking/Expressions/CheckExpressions.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6198,6 +6198,7 @@ and TcExprTuple (cenv: cenv) overallTy env tpenv (isExplicitStruct, args, m) =
61986198
let tupInfo, argTys = UnifyTupleTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv m overallTy isExplicitStruct args
61996199
let argsR, tpenv = TcExprsNoFlexes cenv env m tpenv argTys args
62006200
let expr = mkAnyTupled g m tupInfo argsR argTys
6201+
CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, mkAnyTupledTy g tupInfo argTys, env.eAccessRights)
62016202
expr, tpenv
62026203
)
62036204

@@ -7771,7 +7772,7 @@ and TcRecdExpr cenv overallTy env tpenv (inherits, withExprOpt, synRecdFields, m
77717772

77727773
match withExprOpt, synLongId.LongIdent, exprBeingAssigned with
77737774
| _, [ id ], _ -> ([], id), exprBeingAssigned
7774-
| Some withExpr, lid, Some exprBeingAssigned -> TransformAstForNestedUpdates cenv env overallTy lid exprBeingAssigned withExpr
7775+
| Some (origExpr, blockSep), lid, Some exprBeingAssigned -> TransformAstForNestedUpdates cenv env overallTy lid exprBeingAssigned (origExpr, blockSep)
77757776
| _ -> List.frontAndBack synLongId.LongIdent, exprBeingAssigned)
77767777

77777778
let flds = if hasOrigExpr then GroupUpdatesToNestedFields flds else flds
@@ -10676,6 +10677,8 @@ and TcLinearExprs bodyChecker cenv env overallTy tpenv isCompExpr synExpr cont =
1067610677
if not isRecovery && Option.isNone synElseExprOpt then
1067710678
UnifyTypes cenv env m g.unit_ty overallTy.Commit
1067810679

10680+
CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy.Commit, env.eAccessRights)
10681+
1067910682
TcExprThatCanBeCtorBody cenv overallTy env tpenv synThenExpr
1068010683

1068110684
match synElseExprOpt with

0 commit comments

Comments
 (0)