Skip to content

Commit 483e551

Browse files
authored
Merge pull request #16938 from dotnet/merges/main-to-release/dev17.10
Merge main to release/dev17.10
2 parents 4a39419 + d6773a3 commit 483e551

File tree

6 files changed

+32
-5
lines changed

6 files changed

+32
-5
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* Symbols: Add GenericArguments to FSharpEntity ([PR #16470](https://github.com/dotnet/fsharp/pull/16470))
4141
* Parser: more 'as' pattern recovery ([PR #16837](https://github.com/dotnet/fsharp/pull/16837))
4242
* Add extended data for `DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer` (FS0318). ([PR #16811](https://github.com/dotnet/fsharp/pull/16811)))
43+
* Checker/patterns: recover on unresolved long identifiers ([PR #16842](https://github.com/dotnet/fsharp/pull/16842))
4344

4445
### Changed
4546

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
</Dependency>
3131
</ProductDependencies>
3232
<ToolsetDependencies>
33-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24165.4">
33+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24170.6">
3434
<Uri>https://github.com/dotnet/arcade</Uri>
35-
<Sha>f311667e0587f19c3fa9553a909975662107a351</Sha>
35+
<Sha>8e3e00a76f467cc262dc14f6466ab884b2c4eb96</Sha>
3636
<SourceBuild RepoName="arcade" ManagedOnly="true" />
3737
</Dependency>
3838
<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.24165.4",
20+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24170.6",
2121
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2"
2222
}
2323
}

src/Compiler/Checking/CheckPatterns.fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ and TcPat warnOnUpper (cenv: cenv) env valReprInfo vFlags (patEnv: TcPatLinearEn
293293
TcPatAnds warnOnUpper cenv env vFlags patEnv ty pats m
294294

295295
| SynPat.LongIdent (longDotId=longDotId; typarDecls=tyargs; argPats=args; accessibility=vis; range=m) ->
296-
TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags patEnv ty (longDotId, tyargs, args, vis, m)
296+
try
297+
TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags patEnv ty (longDotId, tyargs, args, vis, m)
298+
with RecoverableException e ->
299+
errorRecovery e m
300+
(fun _ -> TPat_error m), patEnv
297301

298302
| SynPat.QuoteExpr(_, m) ->
299303
errorR (Error(FSComp.SR.tcInvalidPattern(), m))

tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,26 @@ but here has type
101101
(Error 39, Line 4, Col 7, Line 4, Col 13,
102102
"The value or constructor 'result' is not defined. Maybe you want one of the following:
103103
Result")
104+
(Warning 20, Line 3, Col 1, Line 5, Col 15,
105+
"The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.");
104106
(Error 1, Line 8, Col 3, Line 8, Col 13,
105107
"This expression was expected to have type
106108
'string -> bool'
107109
but here has type
108110
'bool' ")
109111
(Error 39, Line 8, Col 7, Line 8, Col 13,
110112
"The value or constructor 'result' is not defined. Maybe you want one of the following:
113+
Result");
114+
(Error 39, Line 8, Col 17, Line 8, Col 23,
115+
"The value or constructor 'result' is not defined. Maybe you want one of the following:
111116
Result")
117+
(Warning 20, Line 7, Col 1, Line 9, Col 15,
118+
"The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.");
112119
(Error 1, Line 12, Col 3, Line 12, Col 30,
113120
"This expression was expected to have type
114121
'string -> bool'
115122
but here has type
116123
'bool' ")
124+
(Warning 20, Line 11, Col 1, Line 13, Col 21,
125+
"The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.")
117126
]

tests/service/PatternMatchCompilationTests.fs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,4 +1260,17 @@ let f : obj -> _ =
12601260
assertHasSymbolUsages ["i"] checkResults
12611261
dumpDiagnostics checkResults |> shouldEqual [
12621262
"(5,6--5,18): Feature 'non-variable patterns to the right of 'as' patterns' is not available in F# 5.0. Please use language version 6.0 or greater."
1263-
]
1263+
]
1264+
1265+
[<Test>]
1266+
let ``Unresolved name - Qualifier 01`` () =
1267+
let _, checkResults = getParseAndCheckResults """
1268+
match None with
1269+
| Foo.Bar -> let a = 1 in ignore a
1270+
| Some b -> ignore b
1271+
"""
1272+
assertHasSymbolUsages ["a"; "b"] checkResults
1273+
dumpDiagnostics checkResults |> shouldEqual [
1274+
"(3,2--3,5): The namespace or module 'Foo' is not defined."
1275+
"(2,6--2,10): Incomplete pattern matches on this expression."
1276+
]

0 commit comments

Comments
 (0)