Skip to content

Commit 8a29188

Browse files
T-GroCopilotabonie
authored
Add regression test for #15655: error codes 999 and 3217 are distinct (#19480)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: abonie <20281641+abonie@users.noreply.github.com>
1 parent 01b745a commit 8a29188

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tests/FSharp.Compiler.ComponentTests/ErrorMessages/DiagnosticRegressionTests.fs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ module ErrorMessages.DiagnosticRegressionTests
33
open Xunit
44
open FSharp.Test.Compiler
55

6+
// https://github.com/dotnet/fsharp/issues/15655
7+
[<Fact>]
8+
let ``Issue 15655 - error codes 999 and 3217 are distinct`` () =
9+
// Verify that notAFunctionButMaybeIndexerErrorCode (3217) is distinct from packageManagerError (999)
10+
// by triggering a "not a function but maybe indexer" error
11+
FSharp
12+
"""
13+
let d = System.Collections.Generic.Dictionary<string,int>()
14+
let v = d ["key"]
15+
"""
16+
|> typecheck
17+
|> shouldFail
18+
|> withErrorCode 3217
19+
20+
621
// https://github.com/dotnet/fsharp/issues/13697
722
[<Fact>]
823
let ``Issue 13697 - typeof with out of scope type in attribute should report FS0039`` () =
@@ -17,7 +32,8 @@ type Vehicle() = class end
1732
|> withDiagnostics
1833
[ (Error 39, Line 3, Col 14, Line 3, Col 28, "The type 'OutOfScopeType' is not defined.")
1934
(Error 267, Line 3, Col 7, Line 3, Col 29, "This is not a valid constant expression or custom attribute value") ]
20-
35+
36+
2137
// https://github.com/dotnet/fsharp/issues/16410
2238
[<Fact>]
2339
let ``Issue 16410 - no spurious FS3570 warning with KeyValue active pattern`` () =

0 commit comments

Comments
 (0)