You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/FSharp.Compiler.ComponentTests/Language/FixedBindings/FixedBindings.fs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -43,9 +43,9 @@ module Legacy =
43
43
|> withDiagnostics [
44
44
(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"'.""")
45
45
(Error 1, Line 5, Col 9, Line 5, Col 31,"""Type mismatch. Expecting a
46
-
'nativeptr<int>'
46
+
'nativeptr<int>'
47
47
but given a
48
-
'nativeptr<byte>'
48
+
'nativeptr<byte>'
49
49
The type 'int' does not match the type 'byte'""")
50
50
(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"'.""")
Copy file name to clipboardExpand all lines: tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ let ("": unit), (x: int) = let y = () in ()
28
28
dumpDiagnostics checkResults |> shouldEqual [
29
29
"(2,5--2,7): This expression was expected to have type 'unit' but here has type 'string'";
30
30
"(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)."""
32
32
]
33
33
34
34
[<FactForNETCOREAPP>]
@@ -83,7 +83,7 @@ match A with
83
83
assertHasSymbolUsages ["x";"y"] checkResults
84
84
dumpDiagnostics checkResults |> shouldEqual [
85
85
"(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)."
87
87
]
88
88
89
89
@@ -171,7 +171,7 @@ match Some 1 with
171
171
assertHasSymbolUsages ["a"] checkResults
172
172
dumpDiagnostics checkResults |> shouldEqual [
173
173
"(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)."""
175
175
]
176
176
177
177
[<FactForNETCOREAPP>]
@@ -183,7 +183,7 @@ match Some 1 with
183
183
assertHasSymbolUsages ["a";"i"] checkResults
184
184
dumpDiagnostics checkResults |> shouldEqual [
185
185
"(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)."""
187
187
]
188
188
189
189
[<FactForNETCOREAPP>]
@@ -337,6 +337,8 @@ match Unchecked.defaultof<System.ValueType> with
"(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"
340
342
]
341
343
342
344
[<FactForNETCOREAPP>]
@@ -958,6 +960,8 @@ Some "" |> eq<int> // No more type checks after the above line?
958
960
dumpDiagnostics checkResults |> shouldEqual [
959
961
"(27,2--27,14): This expression was expected to have type 'objnull' but here has type 'struct ('a * 'b)'";
960
962
"(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).";
961
965
"(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).";
962
966
"(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).";
963
967
"(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).";
Copy file name to clipboardExpand all lines: tests/fsharp/Compiler/Language/AnonRecordTests.fs
+8-14Lines changed: 8 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -27,24 +27,18 @@ let sAnon = StructClass<struct {| S: int |}>()
27
27
28
28
[<Fact>]
29
29
letNotStructConstraintFail()=
30
-
CompilerAssert.TypeCheckSingleError
31
-
"""
30
+
CompilerAssert.TypeCheckWithErrors """
32
31
type RefClass<'a when 'a : not struct>() = class end
33
32
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"|]
39
36
40
37
[<Fact>]
41
38
letStructConstraintFail()=
42
-
CompilerAssert.TypeCheckSingleError
43
-
"""
39
+
CompilerAssert.TypeCheckWithErrors """
44
40
type StructClass<'a when 'a : struct>() = class end
45
41
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"|]
Copy file name to clipboardExpand all lines: tests/fsharp/typecheck/sigs/neg103.bsl
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to
19
19
but here has type
20
20
'MyUnion'
21
21
22
-
neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression.
23
-
24
22
neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type
25
23
'int'
26
24
but here has type
27
25
'MyUnion'
28
26
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).
30
28
31
29
neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type
32
30
'Async<int>'
33
31
but here has type
34
32
'int'
35
33
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).
37
35
38
36
neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type
39
37
'int'
@@ -50,4 +48,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to
50
48
but here has type
51
49
'MyUnion'
52
50
53
-
neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression.
Copy file name to clipboardExpand all lines: tests/fsharp/typecheck/sigs/neg103.vsbsl
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,19 @@ neg103.fs(12,26,12,34): typecheck error FS0001: This expression was expected to
19
19
but here has type
20
20
'MyUnion'
21
21
22
-
neg103.fs(11,5,11,11): typecheck error FS0025: Incomplete pattern matches on this expression.
23
-
24
22
neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type
25
23
'int'
26
24
but here has type
27
25
'MyUnion'
28
26
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).
30
28
31
29
neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type
32
30
'Async<int>'
33
31
but here has type
34
32
'int'
35
33
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).
37
35
38
36
neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type
39
37
'int'
@@ -49,5 +47,3 @@ neg103.fs(25,30,25,38): typecheck error FS0001: This expression was expected to
49
47
'int'
50
48
but here has type
51
49
'MyUnion'
52
-
53
-
neg103.fs(24,9,24,15): typecheck error FS0025: Incomplete pattern matches on this expression.
Copy file name to clipboardExpand all lines: tests/fsharp/typecheck/sigs/neg24.bsl
+44Lines changed: 44 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,3 +42,47 @@ neg24.fs(313,38,313,39): typecheck error FS0020: The result of this expression h
42
42
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'.
43
43
44
44
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,andnot 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'.
Copy file name to clipboardExpand all lines: tests/fsharp/typecheck/sigs/neg28.bsl
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,12 @@ neg28.fsx(69,39,69,40): typecheck error FS0001: The type 'int -> int' does not s
31
31
32
32
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
33
33
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
+
34
36
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
35
37
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
+
36
40
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
37
41
38
42
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
neg45.fs(72,26,72,31): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable'
27
27
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 donot 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
-
30
28
neg45.fs(73,36,73,41): typecheck error FS0001: A type parameter is missing a constraint 'when 'T :> System.IComparable'
31
29
32
30
neg45.fs(73,36,73,41): typecheck error FS0193: A type parameter is missing a constraint 'when 'T :> System.IComparable'
0 commit comments