Skip to content

Commit 0aef3f6

Browse files
authored
Merge pull request #16680 from dotnet/merges/main-to-lsp
Merge main to lsp
2 parents d056cb9 + 5187461 commit 0aef3f6

File tree

33 files changed

+928
-291
lines changed

33 files changed

+928
-291
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
### Fixed
22

3+
* Fix missing warning for recursive calls in list comprehensions. ([PR #16652](https://github.com/dotnet/fsharp/pull/16652))
34
* 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))
45
* `nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16550](https://github.com/dotnet/fsharp/pull/16550))
56
* 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))
7+
* Various parenthesization API fixes. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578), [PR #16666](https://github.com/dotnet/fsharp/pull/16666))
68
* Keep parens for problematic exprs (`if`, `match`, etc.) in `$"{(…):N0}"`, `$"{(…),-3}"`, etc. ([PR #16578](https://github.com/dotnet/fsharp/pull/16578))
7-
* Fix crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode [#PR 16471](https://github.com/dotnet/fsharp/pull/16471))
8-
9+
* Fix crash in DOTNET_SYSTEM_GLOBALIZATION_INVARIANT mode ([PR #16471](https://github.com/dotnet/fsharp/pull/16471))
10+
* `[<CliEvent>]` member should not produce property symbol. ([Issue #16640](https://github.com/dotnet/fsharp/issues/16640), [PR #16658](https://github.com/dotnet/fsharp/pull/16658))
11+
* Fix discriminated union initialization. ([#PR 16661](https://github.com/dotnet/fsharp/pull/16661))
912

1013
### Added
1114

@@ -14,6 +17,7 @@
1417
* Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456))
1518
* Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462))
1619
* Allow returning bool instead of unit option for partial active patterns. ([Language suggestion #1041](https://github.com/fsharp/fslang-suggestions/issues/1041), [PR #16473](https://github.com/dotnet/fsharp/pull/16473))
20+
* Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470))
1721

1822
### Changed
1923

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Fixed
22

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

56
### Changed
67

eng/Version.Details.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
33
<ProductDependencies>
4-
<!-- Intermediate is necessary for source build. -->
5-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24073.1">
4+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24105.3">
65
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
7-
<Sha>412264fd6c04712d1d31ff05d37c6919101ef4f4</Sha>
6+
<Sha>ffac2194c39660f03761ba81bdd6026202942184</Sha>
87
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
98
</Dependency>
109
<!-- Intermediate is necessary for source build. -->
@@ -31,9 +30,9 @@
3130
</Dependency>
3231
</ProductDependencies>
3332
<ToolsetDependencies>
34-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24075.5">
33+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24081.5">
3534
<Uri>https://github.com/dotnet/arcade</Uri>
36-
<Sha>07cf24f27ee58b5d1a9662334a101d84bd1e07e5</Sha>
35+
<Sha>be88b08c41971b52ec11aec05ef31e72185d4a1f</Sha>
3736
<SourceBuild RepoName="arcade" ManagedOnly="true" />
3837
</Dependency>
3938
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"perl": "5.38.0.1"
1818
},
1919
"msbuild-sdks": {
20-
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24075.5",
20+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24081.5",
2121
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2222
}
2323
}

src/Compiler/AbstractIL/il.fs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,6 +3952,29 @@ let mdef_code2code f (md: ILMethodDef) =
39523952
let b = MethodBody.IL(notlazy ilCode)
39533953
md.With(body = notlazy b)
39543954

3955+
let appendInstrsToCode (instrs: ILInstr list) (c2: ILCode) =
3956+
let instrs = Array.ofList instrs
3957+
3958+
match
3959+
c2.Instrs
3960+
|> Array.tryFindIndexBack (fun instr ->
3961+
match instr with
3962+
| I_ret -> true
3963+
| _ -> false)
3964+
with
3965+
| Some 0 ->
3966+
{ c2 with
3967+
Instrs = Array.concat [| instrs; c2.Instrs |]
3968+
}
3969+
| Some index ->
3970+
{ c2 with
3971+
Instrs = Array.concat [| c2.Instrs[.. index - 1]; instrs; c2.Instrs[index..] |]
3972+
}
3973+
| None ->
3974+
{ c2 with
3975+
Instrs = Array.append c2.Instrs instrs
3976+
}
3977+
39553978
let prependInstrsToCode (instrs: ILInstr list) (c2: ILCode) =
39563979
let instrs = Array.ofList instrs
39573980
let n = instrs.Length
@@ -3985,6 +4008,9 @@ let prependInstrsToCode (instrs: ILInstr list) (c2: ILCode) =
39854008
Instrs = Array.append instrs c2.Instrs
39864009
}
39874010

4011+
let appendInstrsToMethod newCode md =
4012+
mdef_code2code (appendInstrsToCode newCode) md
4013+
39884014
let prependInstrsToMethod newCode md =
39894015
mdef_code2code (prependInstrsToCode newCode) md
39904016

src/Compiler/AbstractIL/il.fsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,8 +2162,9 @@ val internal mkRawDataValueTypeDef: ILType -> string * size: int32 * pack: uint1
21622162
/// the code, and the first instruction will be the new entry
21632163
/// of the method. The instructions should be non-branching.
21642164

2165+
val internal appendInstrsToCode: ILInstr list -> ILCode -> ILCode
2166+
val internal appendInstrsToMethod: ILInstr list -> ILMethodDef -> ILMethodDef
21652167
val internal prependInstrsToCode: ILInstr list -> ILCode -> ILCode
2166-
21672168
val internal prependInstrsToMethod: ILInstr list -> ILMethodDef -> ILMethodDef
21682169

21692170
/// Injecting initialization code into a class.

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,11 @@ module MutRecBindingChecking =
11401140
for b1, b2 in List.pairwise defnAs do
11411141
match b1, b2 with
11421142
| TyconBindingPhase2A.Phase2AMember {
1143-
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = getIdent)); valSynData = SynValData(memberFlags = Some mf))
1143+
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = Get_OrSet_Ident & getIdent)); valSynData = SynValData(memberFlags = Some mf))
11441144
RecBindingInfo = RecursiveBindingInfo(vspec = vGet)
11451145
},
11461146
TyconBindingPhase2A.Phase2AMember {
1147-
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = setIdent)))
1147+
SyntacticBinding = NormalizedBinding(pat = SynPat.Named(ident = SynIdent(ident = Get_OrSet_Ident & setIdent)))
11481148
RecBindingInfo = RecursiveBindingInfo(vspec = vSet)
11491149
} when Range.equals getIdent.idRange setIdent.idRange ->
11501150
match vGet.ApparentEnclosingEntity with

src/Compiler/Checking/NameResolution.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ type Item =
278278
| Item.CtorGroup(nm, _) -> nm |> DemangleGenericTypeName
279279
| Item.DelegateCtor ty ->
280280
match ty with
281-
| AbbrevOrAppTy tcref -> tcref.DisplayNameCore
281+
| AbbrevOrAppTy(tcref, _) -> tcref.DisplayNameCore
282282
// This case is not expected
283283
| _ -> ""
284284
| Item.UnqualifiedType(tcref :: _) -> tcref.DisplayNameCore
@@ -309,7 +309,7 @@ type Item =
309309
| Item.Property(info = pinfo :: _) -> pinfo.DisplayName
310310
| Item.Event einfo -> einfo.DisplayName
311311
| Item.MethodGroup(_, minfo :: _, _) -> minfo.DisplayName
312-
| Item.DelegateCtor (AbbrevOrAppTy tcref) -> tcref.DisplayName
312+
| Item.DelegateCtor (AbbrevOrAppTy(tcref, _)) -> tcref.DisplayName
313313
| Item.UnqualifiedType(tcref :: _) -> tcref.DisplayName
314314
| Item.ModuleOrNamespaces(modref :: _) -> modref.DisplayName
315315
| Item.TypeVar (nm, _) -> nm |> ConvertLogicalNameToDisplayName
@@ -1872,11 +1872,11 @@ let (|EntityUse|_|) (item: Item) =
18721872
match item with
18731873
| Item.UnqualifiedType (tcref :: _) -> ValueSome tcref
18741874
| Item.ExnCase tcref -> ValueSome tcref
1875-
| Item.Types(_, [AbbrevOrAppTy tcref])
1876-
| Item.DelegateCtor(AbbrevOrAppTy tcref) -> ValueSome tcref
1875+
| Item.Types(_, [AbbrevOrAppTy(tcref, _)])
1876+
| Item.DelegateCtor(AbbrevOrAppTy(tcref, _)) -> ValueSome tcref
18771877
| Item.CtorGroup(_, ctor :: _) ->
18781878
match ctor.ApparentEnclosingType with
1879-
| AbbrevOrAppTy tcref -> ValueSome tcref
1879+
| AbbrevOrAppTy(tcref, _) -> ValueSome tcref
18801880
| _ -> ValueNone
18811881
| _ -> ValueNone
18821882

@@ -1958,7 +1958,7 @@ let ItemsAreEffectivelyEqual g orig other =
19581958
not tp1.IsCompilerGenerated && not tp1.IsFromError &&
19591959
not tp2.IsCompilerGenerated && not tp2.IsFromError &&
19601960
equals tp1.Range tp2.Range
1961-
| AbbrevOrAppTy tcref1, AbbrevOrAppTy tcref2 ->
1961+
| AbbrevOrAppTy(tcref1, _), AbbrevOrAppTy(tcref2, _) ->
19621962
tyconRefDefnEq g tcref1 tcref2
19631963
| _ -> false)
19641964

src/Compiler/Checking/TailCallChecks.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,10 @@ and CheckExprOp cenv (op, tyargs, args, m) ctxt : unit =
539539
| TOp.ValFieldSet _rf, _, [ _arg1; _arg2 ] -> ()
540540

541541
| TOp.Coerce, [ tgtTy; srcTy ], [ x ] ->
542-
let tailCall = TailCall.YesFromExpr cenv.g x
543-
544542
if TypeDefinitelySubsumesTypeNoCoercion 0 g cenv.amap m tgtTy srcTy then
545-
CheckExpr cenv x ctxt tailCall
543+
CheckExpr cenv x ctxt TailCall.No
546544
else
547-
CheckExprNoByrefs cenv tailCall x
545+
CheckExprNoByrefs cenv TailCall.No x
548546

549547
| TOp.Reraise, [ _ty1 ], [] -> ()
550548

src/Compiler/Checking/infos.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ type MethInfo =
702702
member x.DebuggerDisplayName =
703703
match x with
704704
| ILMeth(_, y, _) -> y.DeclaringTyconRef.DisplayNameWithStaticParametersAndUnderscoreTypars + "::" + y.ILName
705-
| FSMeth(_, AbbrevOrAppTy tcref, vref, _) -> tcref.DisplayNameWithStaticParametersAndUnderscoreTypars + "::" + vref.LogicalName
705+
| FSMeth(_, AbbrevOrAppTy(tcref, _), vref, _) -> tcref.DisplayNameWithStaticParametersAndUnderscoreTypars + "::" + vref.LogicalName
706706
| FSMeth(_, _, vref, _) -> "??::" + vref.LogicalName
707707
#if !NO_TYPEPROVIDERS
708708
| ProvidedMeth(_, mi, _, m) -> "ProvidedMeth: " + mi.PUntaint((fun mi -> mi.Name), m)

0 commit comments

Comments
 (0)