forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proposed work around the flaky error message until dotnet#6725 has a fix
we keep the fsharpqa test around (but removing the overload error messages from what is asserted out of it) in the meantime
- Loading branch information
1 parent
b82ed30
commit 67fc801
Showing
5 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
24 changes: 4 additions & 20 deletions
24
tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.bsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,32 @@ | ||
|
||
E_LessThanDotOpenParen001.fsx(13,71,13,75): typecheck error FS0193: A type parameter is missing a constraint 'when ( ^T or ^?8151) : (static member ( + ) : ^T * ^?8151 -> ^?8152)' | ||
|
||
E_LessThanDotOpenParen001.fsx(13,73,13,75): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'S has been constrained to be type 'int'. | ||
|
||
E_LessThanDotOpenParen001.fsx(13,27,13,30): typecheck error FS1198: The generic member '( +++ )' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. | ||
|
||
E_LessThanDotOpenParen001.fsx(13,19,13,67): typecheck error FS0670: This code is not sufficiently generic. The type variable ^T when ^T : (static member ( + ) : ^T * ^T -> ^a) could not be generalized because it would escape its scope. | ||
|
||
E_LessThanDotOpenParen001.fsx(26,12,26,15): typecheck error FS0043: No overloads match for method 'op_PlusPlusPlus'. | ||
E_LessThanDotOpenParen001.fsx(23,12,23,15): typecheck error FS0043: No overloads match for method 'op_PlusPlusPlus'. | ||
|
||
Known return type: ^a | ||
|
||
Known type parameters: < (string -> int) , TestType<int,string> > | ||
|
||
Available overloads: | ||
- static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:(int -> 'T) * b:TestType<'T,int> -> ^a when ^T1 : (static member ( + ) : ^T1 * ^T1 -> ^a) // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:('T -> 'S) -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match | ||
|
||
E_LessThanDotOpenParen001.fsx(28,10,28,45): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. | ||
E_LessThanDotOpenParen001.fsx(25,10,25,45): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. | ||
|
||
Known types of arguments: (string -> int) * TestType<int,string> | ||
|
||
Available overloads: | ||
- static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:(int -> 'T) * b:TestType<'T,int> -> ^a when ^T1 : (static member ( + ) : ^T1 * ^T1 -> ^a) // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:('T -> 'S) -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match | ||
|
||
E_LessThanDotOpenParen001.fsx(29,44,29,54): typecheck error FS0001: This expression was expected to have type | ||
'int' | ||
but here has type | ||
'string' | ||
|
||
E_LessThanDotOpenParen001.fsx(29,10,29,68): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. | ||
E_LessThanDotOpenParen001.fsx(26,10,26,68): typecheck error FS0041: No overloads match for method 'op_PlusPlusPlus'. | ||
|
||
Known types of arguments: (int -> 'a) * TestType<int,string> | ||
Known types of arguments: (string -> int) * TestType<int,string> | ||
|
||
Available overloads: | ||
- static member TestType.( +++ ) : a:'T * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:(int -> 'T) * b:TestType<'T,int> -> ^a when ^T1 : (static member ( + ) : ^T1 * ^T1 -> ^a) // Argument 'b' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:'T -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:('T -> 'S) -> 'T // Argument 'a' doesn't match | ||
- static member TestType.( +++ ) : a:TestType<'T,'S> * b:TestType<'T,'S> -> 'T // Argument 'a' doesn't match |
9 changes: 3 additions & 6 deletions
9
tests/fsharp/conformance/lexicalanalysis/E_LessThanDotOpenParen001.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...sharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_LessThanDotOpenParen001.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// #Regression #Conformance #LexicalAnalysis #Operators | ||
// Regression test for FSHARP1.0:4805 | ||
// We are not really after the actual error messages here (some of them have been omitted), rather we | ||
// want to verify we do not crash! | ||
//<Expects status="warning" id="FS0064">This construct causes code to be less generic than indicated by the type annotations\. The type variable 'S has been constrained to be type 'int'</Expects> | ||
//<Expects status="error" id="FS0670">This code is not sufficiently generic\. The type variable \^T when \^T : \(static member \( \+ \) : \^T \* \^T -> \^a\) could not be generalized because it would escape its scope</Expects> | ||
|
||
type public TestType<'T,'S>() = | ||
|
||
member public s.Value with get() = Unchecked.defaultof<'T> | ||
static member public (+++) (a : TestType<'T,'S>, b : TestType<'T,'S>) = a.Value | ||
static member public (+++) (a : TestType<'T,'S>, b : 'T) = b | ||
static member public (+++) (a : 'T, b : TestType<'T,'S>) = a | ||
static member public (+++) (a : TestType<'T,'S>, b : 'T -> 'S) = a.Value | ||
static member public (+++) (a : 'S -> 'T, b : TestType<'T,'S>) = (a 17) + b.Value | ||
|
||
let inline (+++) (a : ^a) (b : ^b) = ((^a or ^b): (static member (+++): ^a * ^b -> ^c) (a,b) ) | ||
|
||
let tt0 = TestType<int, string>() | ||
let tt1 = TestType<int, string>() | ||
|
||
let f (x : string) = 18 | ||
|
||
let a0 = tt0 +++ tt1 | ||
let a1 = tt0 +++ 11 | ||
let a2 = 12 +++ tt1 | ||
let a3 = tt0 +++ (fun x -> "18") | ||
let a4 = f +++ tt0 | ||
|
||
let a5 = TestType<int, string>.(+++)(f, tt0) | ||
let a6 = TestType<int, string>.(+++)((fun (x : string) -> 18), tt0) |
1 change: 1 addition & 0 deletions
1
tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/env.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters