TypeScript/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.errors.txt
2014-09-12 13:35:07 -07:00

51 lines
4.3 KiB
Plaintext

tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(3,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(4,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(6,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(7,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(9,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(10,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(13,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(14,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(17,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(18,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts (10 errors) ====
// all of the below should be errors
class C<T extends T> { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
class C2<T, U extends U> { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
interface I<T extends T> { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
interface I2<T, U extends U> { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function f<T extends T>() { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
function f2<T, U extends U>() { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
var a: {
<T extends T>(): void;
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
<T, U extends U>(): void;
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
}
var b = <T extends T>() => { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.
var b2 = <T, U extends U>() => { }
~~~~~~~~~~~
!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list.