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/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -100,3 +100,22 @@ match "A" with
100
100
Result")
101
101
(Error 3868, Line 13, Col 3, Line 13, Col 30,"This active pattern does not expect any arguments, i.e., it should be used like 'IsA' instead of 'IsA x'.")
102
102
]
103
+
104
+
[<Fact>]
105
+
let``Language version check`` ()=
106
+
FSharp """
107
+
let (|LessThan|_|) (other: int) x = x <= other
108
+
109
+
match 1 with
110
+
| LessThan "" -> UnresolvedName
111
+
| _ -> ()
112
+
"""
113
+
|> withLangVersion80
114
+
|> typecheck
115
+
|> shouldFail
116
+
|> withDiagnostics [
117
+
Error 3350, Line 2, Col 6, Line 2, Col 18,"Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater."
118
+
Error 3350, Line 5, Col 3, Line 5, Col 14,"Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater."
119
+
Error 1, Line 5, Col 12, Line 5, Col 14,"This expression was expected to have type\n 'int' \n but here has type\n 'string' "
120
+
Error 39, Line 5, Col 18, Line 5, Col 32,"The value or constructor 'UnresolvedName' is not defined."
0 commit comments