Skip to content

Commit d217778

Browse files
committed
Fix tests
1 parent 0db078a commit d217778

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ module CustomAttributes_Basic =
106106
|> verifyCompile
107107
|> shouldFail
108108
|> withDiagnostics [
109-
(Error 1, Line 10, Col 3, Line 10, Col 59, "This expression was expected to have type\n 'int array' \nbut here has type\n 'unit' ")
110-
(Error 267, Line 10, Col 3, Line 10, Col 59, "This is not a valid constant expression or custom attribute value")
111-
(Error 850, Line 10, Col 3, Line 10, Col 59, "This attribute cannot be used in this version of F#")
109+
(Error 193, Line 10, Col 3, Line 10, Col 59, """Type constraint mismatch. The type
110+
'unit'
111+
is not compatible with type
112+
'int array'
113+
""")
112114
(Error 850, Line 13, Col 3, Line 13, Col 101, "This attribute cannot be used in this version of F#")
113115
(Error 850, Line 16, Col 3, Line 16, Col 50, "This attribute cannot be used in this version of F#")
114116
]

tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalDefaultParamArgs/OptionalDefaultParamArgs.fs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ module MemberDefinitions_OptionalDefaultParamArgs =
3535
compilation
3636
|> verifyCompile
3737
|> shouldFail
38-
|> withDiagnostics [
39-
(Error 1, Line 13, Col 18, Line 13, Col 20, "This expression was expected to have type\n 'int' \nbut here has type\n 'unit' ")
40-
]
38+
|> withDiagnostics
39+
[(Error 193, Line 13, Col 18, Line 13, Col 20, "Type constraint mismatch. The type
40+
'unit'
41+
is not compatible with type
42+
'int'
43+
")]
4144

4245
// SOURCE=InterfaceMethod.fs
4346
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"InterfaceMethod.fs"|])>]
@@ -76,12 +79,13 @@ module MemberDefinitions_OptionalDefaultParamArgs =
7679
|> withLangVersionPreview
7780
|> verifyCompile
7881
|> shouldFail
79-
|> withDiagnostics [
80-
Warning 3211, Line 10, Col 62, Line 10, Col 63, "The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'."
81-
Error 193, Line 13, Col 25, Line 13, Col 27, """Type constraint mismatch. The type
82-
'unit'
83-
is not compatible with type
84-
'string' """ ]
82+
|> withDiagnostics
83+
[(Warning 3211, Line 10, Col 62, Line 10, Col 63, "The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'.");
84+
(Error 193, Line 13, Col 25, Line 13, Col 27, "Type constraint mismatch. The type
85+
'unit'
86+
is not compatible with type
87+
'string'
88+
")]
8589

8690
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"W_WrongDefaultObj.fs"|])>]
8791
let ``W_WrongDefaultObjType_fs`` compilation =

0 commit comments

Comments
 (0)