Skip to content

Commit 92a714a

Browse files
migrate (as a separate copy) fsharpqa tests that are going to be impacted by dotnet#6596
the baseline files are empty on purpose, expecting CI failure reporting those tests, I intend to update the baseline and clean up the comments / xml tags from fsharpqa syntax in later commit, and then remove those specific tests altogether from fsharpqa if this is OK with the maintainers.
1 parent 2cac0e1 commit 92a714a

28 files changed

+629
-0
lines changed

tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// #Regression #Conformance #SyntacticSugar
2+
#light
3+
4+
// Verify errors related to ambiguous slicing overloads
5+
//<Expects id="FS0041" status="error" span="(22,9)">A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: member Foo\.GetSlice : x:int \* y1:int option \* y2:float option -> unit, member Foo\.GetSlice : x:int \* y1:int option \* y2:int option -> unit</Expects>
6+
//<Expects id="FS0041" status="error" span="(23,9)">A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: member Foo\.GetSlice : x:int \* y1:int option \* y2:float option -> unit, member Foo\.GetSlice : x:int \* y1:int option \* y2:int option -> unit</Expects>
7+
//<Expects id="FS0041" status="error" span="(24,9)">A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: member Foo\.GetSlice : x1:float option \* x2:int option \* y:int -> unit, member Foo\.GetSlice : x1:int option \* x2:int option \* y:int -> unit</Expects>
8+
//<Expects id="FS0041" status="error" span="(25,9)">A unique overload for method 'GetSlice' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: member Foo\.GetSlice : x1:float option \* x2:int option \* y:int -> unit, member Foo\.GetSlice : x1:int option \* x2:int option \* y:int -> unit</Expects>
9+
//<Expects id="FS0039" status="error" span="(26,9)">The field, constructor or member 'Item' is not defined</Expects>
10+
//<Expects id="FS0503" status="error" span="(27,9)">A member or object constructor 'GetSlice' taking 4 arguments is not accessible from this code location\. All accessible versions of method 'GetSlice' take 3 arguments\.</Expects>
11+
//<Expects id="FS0503" status="error" span="(28,9)">A member or object constructor 'GetSlice' taking 5 arguments is not accessible from this code location\. All accessible versions of method 'GetSlice' take 3 arguments\.</Expects>
12+
13+
type Foo<'a>() =
14+
member this.GetSlice(x : int, y1 : int option, y2 : int option) = ()
15+
member this.GetSlice(x : int, y1 : int option, y2 : float option) = ()
16+
member this.GetSlice(x1 : float option, x2 : int option, y : int) = ()
17+
member this.GetSlice(x1 : int option, x2 : int option, y : int) = ()
18+
19+
20+
let f = new Foo<char>()
21+
22+
let _ = f.[2, 1..]
23+
let _ = f.[2, *]
24+
let _ = f.[..1, 2]
25+
let _ = f.[*, 2]
26+
let _ = f.[3, 4]
27+
let _ = f.[1, *, Some(5)]
28+
let _ = f.[1, *, *]
29+
30+
exit 1

tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass01.bsl

Whitespace-only changes.

tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass03.bsl

Whitespace-only changes.

tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass04.bsl

Whitespace-only changes.

tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// #Regression #TypeInference
2+
// Regression for FSHARP1.0:5749
3+
// Better error message for overload resolution to help ease pain associated with mismatch of intellisense information
4+
5+
6+
let array = [| "Ted"; "Katie"; |]
7+
Array.iter (fun it -> System.Console.WriteLine(it))
8+
9+
Array.iter (fun it -> System.Console.WriteLine(it)) array
10+
11+
array |> Array.iter (fun it -> System.Console.WriteLine(it))
12+
13+
//<Expects status="error" span="(7,23-7,51)" id="FS0041">A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: System\.Console\.WriteLine\(buffer: char \[\]\) : unit, System\.Console\.WriteLine\(format: string, \[<System\.ParamArray>\] arg: obj \[\]\) : unit, System\.Console\.WriteLine\(value: bool\) : unit, System\.Console\.WriteLine\(value: char\) : unit, System\.Console\.WriteLine\(value: decimal\) : unit, System\.Console\.WriteLine\(value: float\) : unit, System\.Console\.WriteLine\(value: float32\) : unit, System\.Console\.WriteLine\(value: int\) : unit, System\.Console\.WriteLine\(value: int64\) : unit, System\.Console\.WriteLine\(value: obj\) : unit, System\.Console\.WriteLine\(value: string\) : unit, System\.Console\.WriteLine\(value: uint32\) : unit, System\.Console\.WriteLine\(value: uint64\) : unit$</Expects>
14+
//<Expects status="error" span="(9,23-9,51)" id="FS0041">A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: System\.Console\.WriteLine\(buffer: char \[\]\) : unit, System\.Console\.WriteLine\(format: string, \[<System\.ParamArray>\] arg: obj \[\]\) : unit, System\.Console\.WriteLine\(value: bool\) : unit, System\.Console\.WriteLine\(value: char\) : unit, System\.Console\.WriteLine\(value: decimal\) : unit, System\.Console\.WriteLine\(value: float\) : unit, System\.Console\.WriteLine\(value: float32\) : unit, System\.Console\.WriteLine\(value: int\) : unit, System\.Console\.WriteLine\(value: int64\) : unit, System\.Console\.WriteLine\(value: obj\) : unit, System\.Console\.WriteLine\(value: string\) : unit, System\.Console\.WriteLine\(value: uint32\) : unit, System\.Console\.WriteLine\(value: uint64\) : unit$</Expects>

tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl

Whitespace-only changes.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// #Regression #TypeInference
2+
// Regression test for FSHARP1.0:4758
3+
// Type Inference
4+
// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution
5+
6+
// These different return types are used to determine which overload got chosen
7+
type One = | One
8+
type Two = | Two
9+
type Three = | Three
10+
type Four = | Four
11+
12+
// An unsealed type
13+
type C() =
14+
member x.P = 1
15+
16+
type C1 =
17+
static member M<'a>(x:'a,y:'a) = One
18+
19+
type C2 =
20+
static member M<'a,'b>(x:'a,y:'b) = Two
21+
22+
type C3 =
23+
static member M<'a>(x:'a,y:int) = Three
24+
25+
type C4 =
26+
static member M<'a>(x:'a,y:C) = Four
27+
28+
type C12 =
29+
static member M<'a>(x:'a,y:'a) = One
30+
static member M<'a,'b>(x:'a,y:'b) = Two
31+
32+
type C23 =
33+
static member M<'a,'b>(x:'a,y:'b) = Two
34+
static member M<'a>(x:'a,y:int) = Three
35+
36+
type C13 =
37+
static member M<'a>(x:'a,y:'a) = One
38+
static member M<'a>(x:'a,y:int) = Three
39+
40+
type C14 =
41+
static member M<'a>(x:'a,y:'a) = One
42+
static member M<'a>(x:'a,y:C) = Four
43+
44+
type C24 =
45+
static member M<'a,'b>(x:'a,y:'b) = Two
46+
static member M<'a>(x:'a,y:C) = Four
47+
48+
type C123 =
49+
static member M<'a>(x:'a,y:'a) = One
50+
static member M<'a,'b>(x:'a,y:'b) = Two
51+
static member M<'a>(x:'a,y:int) = Three
52+
53+
type C1234 =
54+
static member M<'a>(x:'a,y:'a) = One
55+
static member M<'a,'b>(x:'a,y:'b) = Two
56+
static member M<'a>(x:'a,y:int) = Three
57+
static member M<'a>(x:'a,y:C) = Four
58+
59+
module M3 =
60+
let gB23 (x:'a) (y:int) = C23.M(x,y) // expect: ambiguity error
61+
let gB123 (x:'a) (y:int) = C123.M(x,y) // expect: ambiguous on 2,3
62+
63+
//<Expects status="error" span="(60,34-60,44)" id="FS0041">A unique overload for method 'M' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: static member C23\.M : x:'a \* y:'b -> Two, static member C23\.M : x:'a \* y:int -> Three$</Expects>
64+
//<Expects status="error" span="(61,34-61,45)" id="FS0041">A unique overload for method 'M' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: static member C123\.M : x:'a \* y:'a -> One, static member C123\.M : x:'a \* y:'b -> Two, static member C123\.M : x:'a \* y:int -> Three$</Expects>
65+

tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl

Whitespace-only changes.

0 commit comments

Comments
 (0)