Skip to content

Commit 4b5f7bd

Browse files
committed
Update baselines
1 parent f3f6b5d commit 4b5f7bd

File tree

14 files changed

+99
-62
lines changed

14 files changed

+99
-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" |]

tests/fsharp/typecheck/sigs/neg103.bsl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to
1919
but here has type
2020
'MyUnion'
2121

22-
neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression.
23-
2422
neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type
2523
'int'
2624
but here has type
2725
'MyUnion'
2826

29-
neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression.
27+
neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'CaseB' may indicate a case not covered by the pattern(s).
3028

3129
neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type
3230
'Async<int>'
3331
but here has type
3432
'int'
3533

36-
neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression.
34+
neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s).
3735

3836
neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type
3937
'int'
@@ -50,4 +48,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to
5048
but here has type
5149
'MyUnion'
5250

53-
neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression.

tests/fsharp/typecheck/sigs/neg103.vsbsl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to
1919
but here has type
2020
'MyUnion'
2121

22-
neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression.
23-
2422
neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type
2523
'int'
2624
but here has type
2725
'MyUnion'
2826

29-
neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression.
27+
neg103.fs(15,5,15,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'CaseB' may indicate a case not covered by the pattern(s).
3028

3129
neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type
3230
'Async<int>'
3331
but here has type
3432
'int'
3533

36-
neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression.
34+
neg103.fs(20,5,20,11): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s).
3735

3836
neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type
3937
'int'
@@ -49,5 +47,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to
4947
'int'
5048
but here has type
5149
'MyUnion'
52-
53-
neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression.

tests/fsharp/typecheck/sigs/neg24.bsl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,47 @@ neg24.fs(313,38,313,39): typecheck error FS0020: The result of this expression h
4242
neg24.fs(313,47,313,48): typecheck error FS0020: The result of this expression has type 'int' 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'.
4343

4444
neg24.fs(337,37,337,42): typecheck error FS0020: The result of this expression has type 'obj' 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'.
45+
46+
neg24.fs(53,24,53,30): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
47+
48+
neg24.fs(55,31,55,37): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
49+
50+
neg24.fs(57,38,57,42): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
51+
52+
neg24.fs(60,24,60,34): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
53+
54+
neg24.fs(62,31,62,41): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
55+
56+
neg24.fs(64,44,64,48): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.
57+
58+
neg24.fs(70,15,70,18): typecheck error FS0495: The member or object constructor 'M' has no argument or settable return property 'qez'. The required signature is member C.M: abc: int * def: string -> int.
59+
60+
neg24.fs(300,29,300,30): typecheck error FS0020: The result of this expression has type 'int' 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'.
61+
62+
neg24.fs(301,17,301,18): typecheck error FS0020: The result of this expression has type 'int' 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'.
63+
64+
neg24.fs(302,33,302,34): typecheck error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 'unit'. This element has type 'int'.
65+
66+
neg24.fs(302,36,302,37): typecheck error FS0001: All elements of a list must be implicitly convertible to the type of the first element, which here is 'unit'. This element has type 'int'.
67+
68+
neg24.fs(305,24,305,25): typecheck error FS0001: This expression was expected to have type
69+
'unit'
70+
but here has type
71+
'int'
72+
73+
neg24.fs(305,31,305,32): typecheck error FS0001: This expression was expected to have type
74+
'unit'
75+
but here has type
76+
'int'
77+
78+
neg24.fs(308,30,308,31): typecheck error FS0020: The result of this expression has type 'int' 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'.
79+
80+
neg24.fs(309,31,309,32): typecheck error FS0001: This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type 'int'.
81+
82+
neg24.fs(312,33,312,34): typecheck error FS0020: The result of this expression has type 'int' 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'.
83+
84+
neg24.fs(313,38,313,39): typecheck error FS0020: The result of this expression has type 'int' 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'.
85+
86+
neg24.fs(313,47,313,48): typecheck error FS0020: The result of this expression has type 'int' 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'.
87+
88+
neg24.fs(337,37,337,42): typecheck error FS0020: The result of this expression has type 'obj' 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'.

tests/fsharp/typecheck/sigs/neg28.bsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ neg28.fsx(69,39,69,40): typecheck error FS0001: The type 'int -> int' does not s
3131

3232
neg28.fsx(70,17,70,34): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
3333

34+
neg28.fsx(70,39,70,40): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type
35+
3436
neg28.fsx(71,17,71,38): typecheck error FS0001: The type 'int -> int' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
3537

38+
neg28.fsx(71,43,71,44): typecheck error FS0001: The type 'int -> int' does not support the 'equality' constraint because it is a function type
39+
3640
neg28.fsx(79,17,79,39): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface
3741

3842
neg28.fsx(80,17,80,41): typecheck error FS0001: The type 'System.Type' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface

tests/fsharp/typecheck/sigs/neg30.bsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,28 @@ neg30.fs(45,7,45,16): typecheck error FS0001: A generic construct requires that
99

1010
neg30.fs(46,7,46,26): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type
1111

12+
neg30.fs(46,7,46,26): typecheck error FS1133: No constructors are available for the type 'SBadRecursion'
13+
1214
neg30.fs(47,6,47,8): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type
1315

16+
neg30.fs(59,9,59,26): typecheck error FS0001: A generic construct requires that the type 'SManaged' is an unmanaged type
17+
1418
neg30.fs(59,13,59,24): typecheck error FS0001: A generic construct requires that the type 'SManaged' is an unmanaged type
1519

20+
neg30.fs(60,9,60,35): typecheck error FS0001: A generic construct requires that the type 'SManagedRecursive' is an unmanaged type
21+
1622
neg30.fs(60,13,60,33): typecheck error FS0001: A generic construct requires that the type 'SManagedRecursive' is an unmanaged type
1723

24+
neg30.fs(61,9,61,21): typecheck error FS0001: A generic construct requires that the type 'obj' is an unmanaged type
25+
1826
neg30.fs(61,13,61,19): typecheck error FS0001: A generic construct requires that the type 'obj' is an unmanaged type
1927

28+
neg30.fs(62,9,62,31): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type
29+
2030
neg30.fs(62,13,62,29): typecheck error FS0001: A generic construct requires that the type 'SBadRecursion' is an unmanaged type
2131

32+
neg30.fs(63,9,63,29): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type
33+
2234
neg30.fs(63,13,63,27): typecheck error FS0001: A generic construct requires that the type 'FSharpUnion' is an unmanaged type
2335

2436
neg30.fs(71,12,71,35): typecheck error FS0120: hello!

tests/fsharp/typecheck/sigs/neg45.bsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ neg45.fs(64,19,64,20): typecheck error FS0025: Incomplete pattern matches on thi
2525

2626
neg45.fs(72,26,72,31): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable'
2727

28-
neg45.fs(72,10,72,19): typecheck error FS0035: This construct is deprecated: This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'.
29-
3028
neg45.fs(73,36,73,41): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable'
3129

3230
neg45.fs(73,36,73,41): typecheck error FS0193: A type parameter is missing a constraint 'when 'T :> System.IComparable'

0 commit comments

Comments
 (0)