diff --git a/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl new file mode 100644 index 00000000000..7f35dc88647 --- /dev/null +++ b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.bsl @@ -0,0 +1,14 @@ + +E_Slices01.fsx(22,9,22,19): typecheck error FS0041: 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 + +E_Slices01.fsx(23,9,23,17): typecheck error FS0041: 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 + +E_Slices01.fsx(24,9,24,19): typecheck error FS0041: 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 + +E_Slices01.fsx(25,9,25,17): typecheck error FS0041: 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 + +E_Slices01.fsx(26,9,26,17): typecheck error FS0039: The field, constructor or member 'Item' is not defined. + +E_Slices01.fsx(27,9,27,26): typecheck error FS0503: 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. + +E_Slices01.fsx(28,9,28,20): typecheck error FS0503: 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. diff --git a/tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/E_Slices01.fs b/tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/E_Slices01.fs rename to tests/fsharp/conformance/expressions/syntacticsugar/E_Slices01.fsx diff --git a/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass01.bsl b/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass01.bsl new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass03.bsl b/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass03.bsl new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass04.bsl b/tests/fsharp/conformance/inference/E_Clashing_Values_in_AbstractClass04.bsl new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl new file mode 100644 index 00000000000..640806d814c --- /dev/null +++ b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.bsl @@ -0,0 +1,4 @@ + +E_LeftToRightOverloadResolution01.fsx(7,23,7,51): typecheck error 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, [] 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 + +E_LeftToRightOverloadResolution01.fsx(9,23,9,51): typecheck error 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, [] 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 diff --git a/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.fsx b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.fsx new file mode 100644 index 00000000000..9a067fb5d75 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_LeftToRightOverloadResolution01.fsx @@ -0,0 +1,12 @@ +// #Regression #TypeInference +// Regression for FSHARP1.0:5749 +// Better error message for overload resolution to help ease pain associated with mismatch of intellisense information + + +let array = [| "Ted"; "Katie"; |] +Array.iter (fun it -> System.Console.WriteLine(it)) + +Array.iter (fun it -> System.Console.WriteLine(it)) array + +array |> Array.iter (fun it -> System.Console.WriteLine(it)) + diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl new file mode 100644 index 00000000000..ca730fe7ad2 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03.bsl @@ -0,0 +1,4 @@ + +E_OneTypeVariable03.fsx(60,34,60,44): typecheck error 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 + +E_OneTypeVariable03.fsx(61,34,61,45): typecheck error 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 diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03.fsx b/tests/fsharp/conformance/inference/E_OneTypeVariable03.fsx new file mode 100644 index 00000000000..727d3db5334 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03.fsx @@ -0,0 +1,62 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution + +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + +module M3 = + let gB23 (x:'a) (y:int) = C23.M(x,y) // expect: ambiguity error + let gB123 (x:'a) (y:int) = C123.M(x,y) // expect: ambiguous on 2,3 + diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl new file mode 100644 index 00000000000..c3d473b6f8c --- /dev/null +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.bsl @@ -0,0 +1,4 @@ + +E_OneTypeVariable03rec.fsx(60,38,60,48): typecheck error 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 + +E_OneTypeVariable03rec.fsx(61,38,61,49): typecheck error 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 diff --git a/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.fsx b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.fsx new file mode 100644 index 00000000000..011743fa44e --- /dev/null +++ b/tests/fsharp/conformance/inference/E_OneTypeVariable03rec.fsx @@ -0,0 +1,61 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution + +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + +module M3Rec = + let rec gB23 (x:'a) (y:int) = C23.M(x,y) // expect: ambiguity error + let rec gB123 (x:'a) (y:int) = C123.M(x,y) // expect: ambiguous on 2,3 diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl new file mode 100644 index 00000000000..ad9bf2298fc --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.bsl @@ -0,0 +1,8 @@ + +E_TwoDifferentTypeVariables01.fsx(61,33,61,43): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariables01.fsx(62,33,62,43): typecheck error 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 C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four + +E_TwoDifferentTypeVariables01.fsx(63,33,63,47): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariables01.fsx(64,33,64,46): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.fsx b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.fsx new file mode 100644 index 00000000000..d9504aabec4 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01.fsx @@ -0,0 +1,64 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution + +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + +module M1 = +// Errors + let gB13 (x:'a) (y:'b) = C13.M(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let gB24 (x:'a) (y:'b) = C24.M(x,y) = Four // expect: ambiguity error + let gC13 (x:'a) (y:'b) = C13.M<'a>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let gD13 (x:'a) (y:'b) = C13.M<_>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl new file mode 100644 index 00000000000..45b7dfd315d --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.bsl @@ -0,0 +1,8 @@ + +E_TwoDifferentTypeVariables01rec.fsx(60,37,60,47): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariables01rec.fsx(61,37,61,47): typecheck error 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 C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four + +E_TwoDifferentTypeVariables01rec.fsx(62,37,62,51): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariables01rec.fsx(63,37,63,50): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.fsx b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.fsx new file mode 100644 index 00000000000..744d839aaf1 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariables01rec.fsx @@ -0,0 +1,63 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution + +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + +module M1Rec = + let rec gB13 (x:'a) (y:'b) = C13.M(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gB24 (x:'a) (y:'b) = C24.M(x,y) = Four // expect: ambiguity error + let rec gC13 (x:'a) (y:'b) = C13.M<'a>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gD13 (x:'a) (y:'b) = C13.M<_>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl new file mode 100644 index 00000000000..615200ca5b2 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.bsl @@ -0,0 +1,38 @@ + +E_TwoDifferentTypeVariablesGen00rec.fsx(61,52,61,53): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(61,18,61,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(61,18,61,42): typecheck error FS0043: The type ''b' does not match the type ''b0' + +E_TwoDifferentTypeVariablesGen00rec.fsx(62,52,62,53): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(62,18,62,42): typecheck error FS0043: The type ''b' does not match the type 'int' + +E_TwoDifferentTypeVariablesGen00rec.fsx(63,45,63,55): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00rec.fsx(64,56,64,57): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(64,18,64,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(64,18,64,42): typecheck error FS0043: The type ''b' does not match the type ''b0' + +E_TwoDifferentTypeVariablesGen00rec.fsx(65,54,65,55): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(65,56,65,57): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(65,18,65,42): typecheck error FS0043: The type ''a' does not match the type 'int' + +E_TwoDifferentTypeVariablesGen00rec.fsx(66,45,66,59): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00rec.fsx(67,55,67,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''b'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,42): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type ''a'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(67,18,67,42): typecheck error FS0043: The type ''b' does not match the type ''b0' + +E_TwoDifferentTypeVariablesGen00rec.fsx(68,45,68,58): typecheck error 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 C13.M : x:'a * y:'a -> One, static member C13.M : x:'a * y:int -> Three + +E_TwoDifferentTypeVariablesGen00rec.fsx(69,55,69,56): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'b has been constrained to be type 'int'. + +E_TwoDifferentTypeVariablesGen00rec.fsx(69,18,69,42): typecheck error FS0043: The type ''b' does not match the type 'int' diff --git a/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.fsx b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.fsx new file mode 100644 index 00000000000..304f6681422 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoDifferentTypeVariablesGen00rec.fsx @@ -0,0 +1,69 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution +module M +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + + +module M0Rec = + let rec gB1<'a,'b> (x:'a) (y:'b) = C1.M(x,y) = One // expect: type error + let rec gB3<'a,'b> (x:'a) (y:'b) = C3.M(x,y) = Three // expect: type error + let rec gB13<'a,'b> (x:'a) (y:'b) = C13.M(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gC1<'a,'b> (x:'a) (y:'b) = C1.M<'a>(x,y) = One // expect: error + let rec gC3<'a,'b> (x:'a) (y:'b) = C3.M<'b>(x,y) = Three // expect: error + let rec gC13<'a,'b> (x:'a) (y:'b) = C13.M<'a>(x,y) // expect: ambiguity error + let rec gD1<'a,'b> (x:'a) (y:'b) = C1.M<_>(x,y) = One // expect: type error + let rec gD13<'a,'b> (x:'a) (y:'b) = C13.M<_>(x,y) // expect: ambiguity error (and note: both would instantiate 'a or 'b) + let rec gD3<'a,'b> (x:'a) (y:'b) = C3.M<_>(x,y) = Three // expect: error diff --git a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl new file mode 100644 index 00000000000..0e2957d293f --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.bsl @@ -0,0 +1,12 @@ + +E_TwoEqualTypeVariables02.fsx(61,33,61,43): typecheck error 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 C12.M : x:'a * y:'a -> One, static member C12.M : x:'a * y:'b -> Two + +E_TwoEqualTypeVariables02.fsx(62,33,62,43): typecheck error 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 C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four + +E_TwoEqualTypeVariables02.fsx(63,33,63,43): typecheck error 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 C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four + +E_TwoEqualTypeVariables02.fsx(64,33,64,44): typecheck error 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 + +E_TwoEqualTypeVariables02.fsx(65,33,65,45): typecheck error 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 C1234.M : x:'a * y:'a -> One, static member C1234.M : x:'a * y:'b -> Two, static member C1234.M : x:'a * y:C -> Four, static member C1234.M : x:'a * y:int -> Three + +E_TwoEqualTypeVariables02.fsx(66,33,66,46): typecheck error 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 C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four diff --git a/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.fsx b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.fsx new file mode 100644 index 00000000000..e389b65c9be --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoEqualTypeVariables02.fsx @@ -0,0 +1,66 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution +module M +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + + +module M2 = + let gB12 (x:'a) (y:'a) = C12.M(x,y) // expect: ambiguity error + let gB14 (x:'a) (y:'a) = C14.M(x,y) // expect: ambiguity error + let gB24 (x:'a) (y:'a) = C24.M(x,y) // expect: ambiguity error + let gB123 (x:'a) (y:'a) = C123.M(x,y) // expect: ambiguity error + let gB1234 (x:'a) (y:'a) = C1234.M(x,y) // expect: ambiguity error + let gD14 (x:'a) (y:'a) = C14.M<_>(x,y) = One // expect: ambiguity error diff --git a/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl new file mode 100644 index 00000000000..d9974a98abe --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.bsl @@ -0,0 +1,12 @@ + +E_TwoEqualYypeVariables02rec.fsx(60,37,60,47): typecheck error 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 C12.M : x:'a * y:'a -> One, static member C12.M : x:'a * y:'b -> Two + +E_TwoEqualYypeVariables02rec.fsx(61,37,61,47): typecheck error 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 C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four + +E_TwoEqualYypeVariables02rec.fsx(62,37,62,47): typecheck error 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 C24.M : x:'a * y:'b -> Two, static member C24.M : x:'a * y:C -> Four + +E_TwoEqualYypeVariables02rec.fsx(63,37,63,48): typecheck error 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 + +E_TwoEqualYypeVariables02rec.fsx(64,37,64,49): typecheck error 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 C1234.M : x:'a * y:'a -> One, static member C1234.M : x:'a * y:'b -> Two, static member C1234.M : x:'a * y:C -> Four, static member C1234.M : x:'a * y:int -> Three + +E_TwoEqualYypeVariables02rec.fsx(65,37,65,50): typecheck error 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 C14.M : x:'a * y:'a -> One, static member C14.M : x:'a * y:C -> Four diff --git a/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.fsx b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.fsx new file mode 100644 index 00000000000..7cdad8df3f2 --- /dev/null +++ b/tests/fsharp/conformance/inference/E_TwoEqualYypeVariables02rec.fsx @@ -0,0 +1,65 @@ +// #Regression #TypeInference +// Regression test for FSHARP1.0:4758 +// Type Inference +// Check Method Disambiguation When User Generic Variable Get Instantiated By Overload Resolution +module M +// These different return types are used to determine which overload got chosen +type One = | One +type Two = | Two +type Three = | Three +type Four = | Four + +// An unsealed type +type C() = + member x.P = 1 + +type C1 = + static member M<'a>(x:'a,y:'a) = One + +type C2 = + static member M<'a,'b>(x:'a,y:'b) = Two + +type C3 = + static member M<'a>(x:'a,y:int) = Three + +type C4 = + static member M<'a>(x:'a,y:C) = Four + +type C12 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + +type C23 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C13 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:int) = Three + +type C14 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a>(x:'a,y:C) = Four + +type C24 = + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:C) = Four + +type C123 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + +type C1234 = + static member M<'a>(x:'a,y:'a) = One + static member M<'a,'b>(x:'a,y:'b) = Two + static member M<'a>(x:'a,y:int) = Three + static member M<'a>(x:'a,y:C) = Four + +module M2Rec = + let rec gB12 (x:'a) (y:'a) = C12.M(x,y) // expect: ambiguity error + let rec gB14 (x:'a) (y:'a) = C14.M(x,y) // expect: ambiguity error + let rec gB24 (x:'a) (y:'a) = C24.M(x,y) // expect: ambiguity error + let rec gB123 (x:'a) (y:'a) = C123.M(x,y) // expect: ambiguity error + let rec gB1234 (x:'a) (y:'a) = C1234.M(x,y) // expect: ambiguity error + let rec gD14 (x:'a) (y:'a) = C14.M<_>(x,y) = One // expect: ambiguity error diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl new file mode 100644 index 00000000000..89cb5ac7714 --- /dev/null +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.bsl @@ -0,0 +1,2 @@ + +E_Clashing_Values_in_AbstractClass01.fsx(22,11,22,16): typecheck error FS0041: A unique overload for method 'X' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: member Q.X : unit -> decimal, member Q.X : unit -> float diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass01.fs b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.fsx similarity index 66% rename from tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass01.fs rename to tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.fsx index 99fea05510f..d5d5fff3c47 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass01.fs +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass01.fsx @@ -1,11 +1,6 @@ // #Regression #Conformance #TypeInference // Regression tests for FSHARP1.0:1348, FSHARP1.0:2949,FSHARP1.0:4927,FSHARP1.0:5939 // Overloads that differ for the return type only are not allowed (in general) - -//A unique overload for method 'X' could not be determined based on type information prior to this program point\. A type annotation may be needed\. Candidates: member Q\.X : unit -> decimal, member Q\.X : unit -> float$ - - - [] type T() = abstract X : unit -> decimal diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl new file mode 100644 index 00000000000..76328f65578 --- /dev/null +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.bsl @@ -0,0 +1,4 @@ + +E_Clashing_Values_in_AbstractClass03.fsx(16,18,16,25): typecheck error 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: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string + +E_Clashing_Values_in_AbstractClass03.fsx(17,18,17,25): typecheck error 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: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.fsx b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.fsx new file mode 100644 index 00000000000..dffcb92a095 --- /dev/null +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass03.fsx @@ -0,0 +1,17 @@ +// #Regression #Conformance #TypeInference +// Regression test for FSHARP1.0:5939 +// With generics +[] +type D<'T,'U>() = + abstract M : 'T -> int + abstract M : 'U -> string + +// not an abstract class +type D2<'T,'U>() = + inherit D<'T,'U>() + override this.M(x:'T) = 2 + override this.M(x:'U) = "text" + +let d2 = D2() +let x : int = d2.M(2) // should not be ok +let x : string = d2.M(2) // should not be diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl new file mode 100644 index 00000000000..af3ee273c49 --- /dev/null +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.bsl @@ -0,0 +1,4 @@ + +E_Clashing_Values_in_AbstractClass04.fsx(16,18,16,25): typecheck error 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: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string + +E_Clashing_Values_in_AbstractClass04.fsx(17,18,17,25): typecheck error 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: abstract member D.M : 'T -> int, abstract member D.M : 'U -> string diff --git a/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.fsx b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.fsx new file mode 100644 index 00000000000..9688c3b9b4e --- /dev/null +++ b/tests/fsharp/conformance/wellformedness/E_Clashing_Values_in_AbstractClass04.fsx @@ -0,0 +1,17 @@ +// #Regression #Conformance #TypeInference +// Regression test for FSHARP1.0:5939 +// With generics +[] +type D<'T,'U>() = + abstract M : 'T -> int + abstract M : 'U -> string + +// not an abstract class +type D2<'T,'U>() = + inherit D<'T,'U>() + override this.M(x:'T) = 2 + override this.M(x:'U) = "text" + +let d2 = D2() +let x : int = d2.M(2) // should not be ok +let x : string = d2.M(2) // should not be ok (due to 268041, we are not emitting this error though) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index e6ef7520a1c..96c7be28364 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2850,3 +2850,20 @@ module GeneratedSignatureTests = [] let ``measures-GENERATED_SIGNATURE`` () = singleTestBuildAndRun "core/measures" GENERATED_SIGNATURE #endif + +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS +module OverloadResolution = + module FSharpQAMigrated = + let [] ``Conformance\Expressions\SyntacticSugar (E_Slices01.fs)`` () = singleNegTest (testConfig "conformance/expressions/syntacticsugar") "E_Slices01" + let [] ``Conformance\InferenceProcedures\TypeInference (E_OneTypeVariable03.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03" + let [] ``Conformance\InferenceProcedures\TypeInference (E_OneTypeVariable03rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_OneTypeVariable03rec" + let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariables01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01" + let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariables01rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariables01rec" + let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoDifferentTypeVariablesGen00rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoDifferentTypeVariablesGen00rec" + let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoEqualTypeVariables02.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualTypeVariables02" + let [] ``Conformance\InferenceProcedures\TypeInference (E_TwoEqualYypeVariables02rec.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_TwoEqualYypeVariables02rec" + let [] ``Conformance\InferenceProcedures\TypeInference (E_LeftToRightOverloadResolution01.fs)`` () = singleNegTest (testConfig "conformance/inference") "E_LeftToRightOverloadResolution01" + let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass01.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass01" + let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass03.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass03" + let [] ``Conformance\InferenceProcedures\WellFormednessChecking (E_Clashing_Values_in_AbstractClass04.fs) `` () = singleNegTest (testConfig "conformance/wellformedness") "E_Clashing_Values_in_AbstractClass04" +#endif diff --git a/tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/env.lst b/tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/env.lst index c89b460e647..c858fb1637b 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/env.lst +++ b/tests/fsharpqa/Source/Conformance/Expressions/SyntacticSugar/env.lst @@ -14,5 +14,4 @@ NoMT SOURCE=Slices03.fs # Slices03.fs SOURCE=Slices07.fs # Slices07.fs SOURCE=E_GetSliceNotDef01.fs # E_GetSliceNotDef01.fs - SOURCE=E_GetSliceNotDef02.fs # E_GetSliceNotDef02.fs - SOURCE=E_Slices01.fs # E_Slices01.fs.fs \ No newline at end of file + SOURCE=E_GetSliceNotDef02.fs # E_GetSliceNotDef02.fs \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst index 710b50ca1be..72da539ce69 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/env.lst @@ -16,25 +16,14 @@ SOURCE=OneTypeVariable03.fs SCFLAGS="-a --test:ErrorRanges --warnaserror+" # OneTypeVariable03.fs SOURCE=OneTypeVariable03rec.fs SCFLAGS="-a --test:ErrorRanges --warnaserror+" # OneTypeVariable03rec.fs - SOURCE=E_OneTypeVariable03.fs SCFLAGS="--test:ErrorRanges" # E_OneTypeVariable03.fs - SOURCE=E_OneTypeVariable03rec.fs SCFLAGS="--test:ErrorRanges" # E_OneTypeVariable03rec.fs - SOURCE=E_TwoDifferentTypeVariables01.fs SCFLAGS="--test:ErrorRanges" # E_TwoDifferentTypeVariables01.fs - SOURCE=E_TwoDifferentTypeVariables01rec.fs SCFLAGS="--test:ErrorRanges" # E_TwoDifferentTypeVariables01rec.fs SOURCE=E_TwoDifferentTypeVariablesGen00.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_TwoDifferentTypeVariablesGen00.fs - - SOURCE=E_TwoDifferentTypeVariablesGen00rec.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_TwoDifferentTypeVariablesGen00rec.fs SOURCE=E_TwoDifferentTypeVariablesGen01rec.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_TwoDifferentTypeVariablesGen01rec.fs - - SOURCE=E_TwoEqualTypeVariables02.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_TwoEqualTypeVariables02.fs - SOURCE=E_TwoEqualYypeVariables02rec.fs SCFLAGS="-a --test:ErrorRanges --flaterrors" # E_TwoEqualYypeVariables02rec.fs - SOURCE=W_OneTypeVariable03.fs SCFLAGS="-a --test:ErrorRanges" # W_OneTypeVariable03.fs SOURCE=W_OneTypeVariable03rec.fs SCFLAGS="-a --test:ErrorRanges" # W_OneTypeVariable03rec.fs SOURCE=W_TwoDifferentTypeVariables01.fs SCFLAGS="-a --test:ErrorRanges" # W_TwoDifferentTypeVariables01.fs SOURCE=W_TwoDifferentTypeVariables01rec.fs SCFLAGS="-a --test:ErrorRanges" # W_TwoDifferentTypeVariables01rec.fs SOURCE=W_TwoEqualTypeVariables02.fs SCFLAGS="-a --test:ErrorRanges" # W_TwoEqualTypeVariables02.fs SOURCE=W_TwoEqualTypeVariables02rec.fs SCFLAGS="-a --test:ErrorRanges" # W_TwoEqualTypeVariables02rec.fs - SOURCE=E_LeftToRightOverloadResolution01.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_LeftToRightOverloadResolution01.fs SOURCE=E_PrettifyForall.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_PrettifyForall.fs diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass03.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass03.fs deleted file mode 100644 index a796a461d9a..00000000000 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass03.fs +++ /dev/null @@ -1,19 +0,0 @@ -// #Regression #Conformance #TypeInference -// Regression test for FSHARP1.0:5939 -// With generics -//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: abstract member D\.M : 'T -> int, abstract member D\.M : 'U -> string$ -//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: abstract member D\.M : 'T -> int, abstract member D\.M : 'U -> string$ -[] -type D<'T,'U>() = - abstract M : 'T -> int - abstract M : 'U -> string - -// not an abstract class -type D2<'T,'U>() = - inherit D<'T,'U>() - override this.M(x:'T) = 2 - override this.M(x:'U) = "text" - -let d2 = D2() -let x : int = d2.M(2) // should not be ok -let x : string = d2.M(2) // should not be diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass04.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass04.fs deleted file mode 100644 index 9c2e3ee8660..00000000000 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/E_Clashing_Values_in_AbstractClass04.fs +++ /dev/null @@ -1,21 +0,0 @@ -// #Regression #Conformance #TypeInference -// Regression test for FSHARP1.0:5939 -// With generics -//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: abstract member D\.M : 'T -> int, abstract member D\.M : 'U -> string$ -//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: abstract member D\.M : 'T -> int, abstract member D\.M : 'U -> string$ -//Duplicate definition of value 'x'$ - -[] -type D<'T,'U>() = - abstract M : 'T -> int - abstract M : 'U -> string - -// not an abstract class -type D2<'T,'U>() = - inherit D<'T,'U>() - override this.M(x:'T) = 2 - override this.M(x:'U) = "text" - -let d2 = D2() -let x : int = d2.M(2) // should not be ok -let x : string = d2.M(2) // should not be ok (due to 268041, we are not emitting this error though) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/env.lst b/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/env.lst index be0495cf1ee..7abdbe19e01 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/env.lst +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/WellFormednessChecking/env.lst @@ -3,10 +3,7 @@ SOURCE=E_Clashing_Methods_in_Interface01.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Methods_in_Interface01.fs SOURCE=E_Clashing_Methods_in_Interface02.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Methods_in_Interface02.fs SOURCE=E_Clashing_Record_Field_and_Member01.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Record_Field_and_Member01.fs - SOURCE=E_Clashing_Values_in_AbstractClass01.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Values_in_AbstractClass01.fs SOURCE=E_Clashing_Values_in_AbstractClass02.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Values_in_AbstractClass02.fs - SOURCE=E_Clashing_Values_in_AbstractClass03.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Values_in_AbstractClass03.fs - SOURCE=E_Clashing_Values_in_AbstractClass04.fs SCFLAGS="--test:ErrorRanges" # E_Clashing_Values_in_AbstractClass04.fs SOURCE=E_Override_with_Incorrect_Type01.fs SCFLAGS="--test:ErrorRanges" # E_Override_with_Incorrect_Type01.fs