Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed Aug 26, 2024
1 parent 4b7967e commit 49c59fb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module MethodImplAttribute =
compilation
|> withLangVersion80
|> typecheck
|> withSingleDiagnostic (Warning 3151, Line 2, Col 1, Line 3, Col 38, "This member, function or value declaration may not be declared 'inline'")
|> withSingleDiagnostic (Warning 3151, Line 3, Col 12, Line 3, Col 19, "This member, function or value declaration may not be declared 'inline'")

[<Theory; Directory(__SOURCE_DIRECTORY__, Includes=[|"MethodImplAttribute.NoInlining_InlineKeyword.fs"|])>]
let ``NoInlining_fs with inline keyword => should not warn in F# 7 or older`` compilation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ let (|OddVOption|_|) x = if x % 2 = 1 then ValueSome() else ValueNone
|> typecheck
|> shouldFail
|> withDiagnostics [
(Error 3350, Line 1, Col 5, Line 1, Col 20, "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.")
(Error 3350, Line 2, Col 5, Line 2, Col 23, "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.")
(Error 3350, Line 1, Col 6, Line 1, Col 17, "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.")
(Error 3350, Line 2, Col 6, Line 2, Col 20, "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.")
]

[<Fact>]
Expand Down
10 changes: 5 additions & 5 deletions tests/fsharp/Compiler/Language/StructActivePatternTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ match ret_attrs, binding_attrs with
[<return:Struct>]
let (|Foo|_|) x = ValueNone
"""
[|(FSharpDiagnosticSeverity.Error, 3350, (2, 1, 3, 16),
[|(FSharpDiagnosticSeverity.Error, 3350, (3, 6, 3, 13),
"Feature 'struct representation for active patterns' is not available in F# 5.0. Please use language version 6.0 or greater.")|]

[<Test>]
Expand All @@ -179,7 +179,7 @@ let (|Foo|_|) x = ValueNone
"""
[|(FSharpDiagnosticSeverity.Error, 842, (2, 3, 2, 9),
"This attribute is not valid for use on this language element");
(FSharpDiagnosticSeverity.Error, 3350, (2, 1, 3, 16),
(FSharpDiagnosticSeverity.Error, 3350, (3, 6, 3, 13),
"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.")|]

[<Test>]
Expand All @@ -195,10 +195,10 @@ let f x = x
[<return:Struct>]
let (|A|B|) x = A
"""
[|(FSharpDiagnosticSeverity.Error, 3385, (2, 1, 3, 6),
[|(FSharpDiagnosticSeverity.Error, 3385, (3, 5, 3, 6),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")
(FSharpDiagnosticSeverity.Error, 3385, (5, 1, 6, 8),
(FSharpDiagnosticSeverity.Error, 3385, (6, 5, 6, 6),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")
(FSharpDiagnosticSeverity.Error, 3385, (8, 1, 9, 14),
(FSharpDiagnosticSeverity.Error, 3385, (9, 6, 9, 11),
"The use of '[<Struct>]' on values, functions and methods is only allowed on partial active pattern definitions")|]

2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg20.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ neg20.fs(195,5,195,10): typecheck error FS0842: This attribute is not valid for

neg20.fs(198,5,198,11): typecheck error FS0842: This attribute is not valid for use on this language element

neg20.fs(201,3,202,9): typecheck error FS0825: The 'DefaultValue' attribute may only be used on 'val' declarations
neg20.fs(202,7,202,9): typecheck error FS0825: The 'DefaultValue' attribute may only be used on 'val' declarations

neg20.fs(204,5,204,14): typecheck error FS0842: This attribute is not valid for use on this language element

Expand Down
10 changes: 5 additions & 5 deletions tests/fsharp/typecheck/sigs/neg32.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ neg32.fs(24,15,24,16): typecheck error FS0043: The member or object constructor

neg32.fs(43,17,43,19): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(44,4,44,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(44,15,44,17): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(44,21,44,23): typecheck error FS0039: The type parameter 'U is not defined.

Expand All @@ -19,7 +19,7 @@ neg32.fs(46,24,46,26): typecheck error FS0039: The type parameter 'U is not defi

neg32.fs(50,17,50,19): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(51,4,51,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(51,15,51,17): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(51,21,51,23): typecheck error FS0039: The type parameter 'U is not defined.

Expand All @@ -37,11 +37,11 @@ neg32.fs(55,18,55,20): typecheck error FS0039: The type parameter 'T is not defi

neg32.fs(56,18,56,20): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(57,4,57,38): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(57,16,57,18): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(58,4,58,33): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(58,16,58,18): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(59,4,59,33): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(59,16,59,18): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(62,10,62,12): typecheck error FS0039: The type parameter 'T is not defined.

Expand Down
4 changes: 2 additions & 2 deletions tests/fsharp/typecheck/sigs/neg37.bsl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

neg37.fs(7,19,7,29): typecheck error FS0670: This code is not sufficiently generic. The type variable 'T could not be generalized because it would escape its scope.
neg37.fs(7,19,7,22): typecheck error FS0670: This code is not sufficiently generic. The type variable 'T could not be generalized because it would escape its scope.

neg37.fs(19,33,19,40): typecheck error FS1125: The instantiation of the generic type 'CCC' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. 'CCC<_>'.

neg37.fs(19,19,19,29): typecheck error FS0670: This code is not sufficiently generic. The type variable 'T could not be generalized because it would escape its scope.
neg37.fs(19,19,19,22): typecheck error FS0670: This code is not sufficiently generic. The type variable 'T could not be generalized because it would escape its scope.

neg37.fs(24,10,24,37): typecheck error FS0331: The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. 'IComparable <'T>' and 'IEvent <'T>'. Consider using type annotations to resolve the ambiguity

Expand Down
6 changes: 3 additions & 3 deletions tests/fsharp/typecheck/sigs/neg47.bsl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

neg47.fs(18,9,18,26): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module

neg47.fs(23,5,24,33): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module
neg47.fs(24,14,24,31): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module

neg47.fs(28,9,29,27): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module
neg47.fs(29,18,29,24): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module

neg47.fs(32,5,33,27): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module
neg47.fs(33,14,33,25): typecheck error FS1221: DLLImport bindings must be static members in a class or function definitions in a module
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg62.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ neg62.fs(50,5,50,34): typecheck error FS0901: Structs cannot contain value defin

neg62.fs(54,31,54,34): typecheck error FS3135: To indicate that this property can be set, use 'member val PropertyName = expr with get,set'.

neg62.fs(69,22,69,40): typecheck error FS0670: This code is not sufficiently generic. The type variable 'S could not be generalized because it would escape its scope.
neg62.fs(69,24,69,30): typecheck error FS0670: This code is not sufficiently generic. The type variable 'S could not be generalized because it would escape its scope.

neg62.fs(75,5,75,28): typecheck error FS3151: This member, function or value declaration may not be declared 'inline'

Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg85.bsl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

neg85.fsx(7,9,7,56): typecheck error FS3162: A type variable has been constrained by multiple different class types. A type variable may only have one class constraint.
neg85.fsx(7,9,7,38): typecheck error FS3162: A type variable has been constrained by multiple different class types. A type variable may only have one class constraint.
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg92.bsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

neg92.fs(10,19,10,20): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type ''U'.

neg92.fs(9,9,9,30): typecheck error FS0670: This code is not sufficiently generic. The type variable 'U could not be generalized because it would escape its scope.
neg92.fs(9,9,9,17): typecheck error FS0670: This code is not sufficiently generic. The type variable 'U could not be generalized because it would escape its scope.

0 comments on commit 49c59fb

Please sign in to comment.