Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Gro committed Feb 24, 2025
1 parent 0db078a commit d217778
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ module CustomAttributes_Basic =
|> verifyCompile
|> shouldFail
|> withDiagnostics [
(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' ")
(Error 267, Line 10, Col 3, Line 10, Col 59, "This is not a valid constant expression or custom attribute value")
(Error 850, Line 10, Col 3, Line 10, Col 59, "This attribute cannot be used in this version of F#")
(Error 193, Line 10, Col 3, Line 10, Col 59, """Type constraint mismatch. The type
'unit'
is not compatible with type
'int array'
""")
(Error 850, Line 13, Col 3, Line 13, Col 101, "This attribute cannot be used in this version of F#")
(Error 850, Line 16, Col 3, Line 16, Col 50, "This attribute cannot be used in this version of F#")
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ module MemberDefinitions_OptionalDefaultParamArgs =
compilation
|> verifyCompile
|> shouldFail
|> withDiagnostics [
(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' ")
]
|> withDiagnostics
[(Error 193, Line 13, Col 18, Line 13, Col 20, "Type constraint mismatch. The type
'unit'
is not compatible with type
'int'
")]

// SOURCE=InterfaceMethod.fs
[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"InterfaceMethod.fs"|])>]
Expand Down Expand Up @@ -76,12 +79,13 @@ module MemberDefinitions_OptionalDefaultParamArgs =
|> withLangVersionPreview
|> verifyCompile
|> shouldFail
|> withDiagnostics [
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)'."
Error 193, Line 13, Col 25, Line 13, Col 27, """Type constraint mismatch. The type
'unit'
is not compatible with type
'string' """ ]
|> withDiagnostics
[(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)'.");
(Error 193, Line 13, Col 25, Line 13, Col 27, "Type constraint mismatch. The type
'unit'
is not compatible with type
'string'
")]

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

0 comments on commit d217778

Please sign in to comment.