Skip to content

Commit be79b41

Browse files
committed
Update baselines
1 parent f3f6b5d commit be79b41

File tree

16 files changed

+455
-62
lines changed

16 files changed

+455
-62
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ module Legacy =
4343
|> withDiagnostics [
4444
(Warning 9, Line 5, Col 9, Line 5, Col 31, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""")
4545
(Error 1, Line 5, Col 9, Line 5, Col 31, """Type mismatch. Expecting a
46-
'nativeptr<int>'
46+
'nativeptr<int>'
4747
but given a
48-
'nativeptr<byte>'
48+
'nativeptr<byte>'
4949
The type 'int' does not match the type 'byte'""")
5050
(Warning 9, Line 6, Col 5, Line 6, Col 18, """Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.""")
5151
]

tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let ("": unit), (x: int) = let y = () in ()
2828
dumpDiagnostics checkResults |> shouldEqual [
2929
"(2,5--2,7): This expression was expected to have type 'unit' but here has type 'string'";
3030
"(2,41--2,43): This expression was expected to have type 'unit * int' but here has type 'unit'";
31-
"(2,4--2,24): Incomplete pattern matches on this expression."
31+
"""(2,4--2,24): Incomplete pattern matches on this expression. For example, the value '("a",_)' may indicate a case not covered by the pattern(s)."""
3232
]
3333

3434
[<FactForNETCOREAPP>]
@@ -83,7 +83,7 @@ match A with
8383
assertHasSymbolUsages ["x"; "y"] checkResults
8484
dumpDiagnostics checkResults |> shouldEqual [
8585
"(7,5--7,12): This expression was expected to have type 'int' but here has type ''a * 'b * 'c'";
86-
"(6,6--6,7): Incomplete pattern matches on this expression."
86+
"(6,6--6,7): Incomplete pattern matches on this expression. For example, the value 'A' may indicate a case not covered by the pattern(s)."
8787
]
8888

8989

@@ -171,7 +171,7 @@ match Some 1 with
171171
assertHasSymbolUsages ["a"] checkResults
172172
dumpDiagnostics checkResults |> shouldEqual [
173173
"(3,7--3,14): This expression was expected to have type 'int' but here has type ''a option'"
174-
"(2,6--2,12): Incomplete pattern matches on this expression."
174+
"""(2,6--2,12): Incomplete pattern matches on this expression. For example, the value 'Some (Some ("a"))' may indicate a case not covered by the pattern(s)."""
175175
]
176176

177177
[<FactForNETCOREAPP>]
@@ -183,7 +183,7 @@ match Some 1 with
183183
assertHasSymbolUsages ["a"; "i"] checkResults
184184
dumpDiagnostics checkResults |> shouldEqual [
185185
"(3,7--3,18): This expression was expected to have type 'int' but here has type ''a option'";
186-
"(2,6--2,12): Incomplete pattern matches on this expression."
186+
"""(2,6--2,12): Incomplete pattern matches on this expression. For example, the value 'Some (Some (("a",_)))' may indicate a case not covered by the pattern(s)."""
187187
]
188188

189189
[<FactForNETCOREAPP>]
@@ -337,6 +337,8 @@ match Unchecked.defaultof<System.ValueType> with
337337
assertHasSymbolUsages ["a"; "b"; "c"; "d"] checkResults
338338
dumpDiagnostics checkResults |> shouldEqual [
339339
"(5,21--5,27): Type constraint mismatch. The type 'int' is not compatible with type 'System.Enum'"
340+
"(6,2--6,11): Type constraint mismatch. The type 'string' is not compatible with type 'System.ValueType'"
341+
"(4,2--4,46): This rule will never be matched"
340342
]
341343

342344
[<FactForNETCOREAPP>]
@@ -958,6 +960,8 @@ Some "" |> eq<int> // No more type checks after the above line?
958960
dumpDiagnostics checkResults |> shouldEqual [
959961
"(27,2--27,14): This expression was expected to have type 'objnull' but here has type 'struct ('a * 'b)'";
960962
"(52,2--52,13): This expression was expected to have type 'objnull' but here has type 'AAA'";
963+
"(53,11--53,18): Type mismatch. Expecting a 'string option -> 'a' but given a 'int option -> unit' The type 'int' does not match the type 'string'"
964+
"(51,6--51,21): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s).";
961965
"(26,6--26,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s).";
962966
"(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s).";
963967
"(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s).";

tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ let ``Test Project21 whole project errors`` () =
30603060
let wholeProjectResults = checker.ParseAndCheckProject(Project21.options) |> Async.RunImmediate
30613061
for e in wholeProjectResults.Diagnostics do
30623062
printfn "Project21 error: <<<%s>>>" e.Message
3063-
wholeProjectResults.Diagnostics.Length |> shouldEqual 2
3063+
wholeProjectResults.Diagnostics.Length |> shouldEqual 1
30643064

30653065

30663066
[<Fact>]
@@ -3090,13 +3090,20 @@ let ``Test Project21 all symbols`` () =
30903090
("int", "int", "file1", ((8, 27), (8, 30)), ["type"], ["abbrev"]);
30913091
("val x", "x", "file1", ((9, 21), (9, 22)), ["defn"], []);
30923092
("string", "string", "file1", ((9, 37), (9, 43)), ["type"], ["abbrev"]);
3093+
("val arg1", "arg1", "file1", ((9, 31), (9, 35)), ["defn"], []);
3094+
("unit", "unit", "file1", ((9, 46), (9, 50)), ["type"], ["abbrev"]);
3095+
("val raise", "raise", "file1", ((10, 18), (10, 23)), [], ["val"]);
3096+
("System", "System", "file1", ((10, 25), (10, 31)), [], ["namespace"]);
3097+
("member .ctor", "NotImplementedException", "file1", ((10, 25), (10, 55)), [], ["member"]);
30933098
("val x", "x", "file1", ((12, 21), (12, 22)), ["defn"], []);
30943099
("int", "int", "file1", ((12, 37), (12, 40)), ["type"], ["abbrev"]);
30953100
("val arg1", "arg1", "file1", ((12, 31), (12, 35)), ["defn"], []);
30963101
("unit", "unit", "file1", ((12, 43), (12, 47)), ["type"], ["abbrev"]);
30973102
("val raise", "raise", "file1", ((13, 18), (13, 23)), [], ["val"]);
30983103
("System", "System", "file1", ((13, 25), (13, 31)), [], ["namespace"]);
30993104
("member .ctor", "NotImplementedException", "file1", ((13, 25), (13, 55)), [], ["member"]);
3105+
("member Method1", "Method1", "file1", ((9, 23), (9, 30)), ["override"], ["slot"; "member"]);
3106+
("member Method2", "Method2", "file1", ((12, 23), (12, 30)), ["override"], ["slot"; "member"])
31003107
("Impl", "Impl", "file1", ((2, 7), (2, 11)), ["defn"], ["module"])|]
31013108

31023109
//-----------------------------------------------------------------------------------------

tests/fsharp/Compiler/Language/AnonRecordTests.fs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,18 @@ let sAnon = StructClass<struct {| S: int |}>()
2727

2828
[<Fact>]
2929
let NotStructConstraintFail() =
30-
CompilerAssert.TypeCheckSingleError
31-
"""
30+
CompilerAssert.TypeCheckWithErrors """
3231
type RefClass<'a when 'a : not struct>() = class end
3332
let rAnon = RefClass<struct {| R: int |}>()
34-
"""
35-
FSharpDiagnosticSeverity.Error
36-
1
37-
(3, 13, 3, 42)
38-
"A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct"
33+
"""
34+
[| FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 42), "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct"
35+
FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 44), "A generic construct requires that the type 'struct {| R: int |}' have reference semantics, but it does not, i.e. it is a struct" |]
3936

4037
[<Fact>]
4138
let StructConstraintFail() =
42-
CompilerAssert.TypeCheckSingleError
43-
"""
39+
CompilerAssert.TypeCheckWithErrors """
4440
type StructClass<'a when 'a : struct>() = class end
4541
let sAnon = StructClass<{| S: int |}>()
46-
"""
47-
FSharpDiagnosticSeverity.Error
48-
1
49-
(3, 13, 3, 38)
50-
"A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type"
42+
"""
43+
[| FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 38), "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type"
44+
FSharpDiagnosticSeverity.Error, 1, (3, 13, 3, 40), "A generic construct requires that the type '{| S: int |}' is a CLI or F# struct type" |]

0 commit comments

Comments
 (0)