209 lines
11 KiB
Text
209 lines
11 KiB
Text
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures6.ts ===
|
|
// checking subtype relations for function types as it relates to contextual signature instantiation
|
|
// same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures
|
|
// all are errors
|
|
|
|
class Base { foo: string; }
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>foo : Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 4, 12))
|
|
|
|
class Derived extends Base { bar: string; }
|
|
>Derived : Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>bar : Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 5, 28))
|
|
|
|
class Derived2 extends Derived { baz: string; }
|
|
>Derived2 : Symbol(Derived2, Decl(subtypingWithConstructSignatures6.ts, 5, 43))
|
|
>Derived : Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>baz : Symbol(baz, Decl(subtypingWithConstructSignatures6.ts, 6, 32))
|
|
|
|
class OtherDerived extends Base { bing: string; }
|
|
>OtherDerived : Symbol(OtherDerived, Decl(subtypingWithConstructSignatures6.ts, 6, 47))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>bing : Symbol(bing, Decl(subtypingWithConstructSignatures6.ts, 7, 33))
|
|
|
|
interface A { // T
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
// M's
|
|
a: new <T>(x: T) => T[];
|
|
>a : Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 9, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 11, 15))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
|
|
a2: new <T>(x: T) => string[];
|
|
>a2 : Symbol(a2, Decl(subtypingWithConstructSignatures6.ts, 11, 28))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 12, 13))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 12, 16))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 12, 13))
|
|
|
|
a3: new <T>(x: T) => void;
|
|
>a3 : Symbol(a3, Decl(subtypingWithConstructSignatures6.ts, 12, 34))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 13, 13))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 13, 16))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 13, 13))
|
|
|
|
a4: new <T, U>(x: T, y: U) => string;
|
|
>a4 : Symbol(a4, Decl(subtypingWithConstructSignatures6.ts, 13, 30))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 14, 13))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 14, 15))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 14, 19))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 14, 13))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 14, 24))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 14, 15))
|
|
|
|
a5: new <T, U>(x: (arg: T) => U) => T;
|
|
>a5 : Symbol(a5, Decl(subtypingWithConstructSignatures6.ts, 14, 41))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 15, 15))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 15, 19))
|
|
>arg : Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 15, 23))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 15, 15))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
|
|
a6: new <T extends Base>(x: (arg: T) => Derived) => T;
|
|
>a6 : Symbol(a6, Decl(subtypingWithConstructSignatures6.ts, 15, 42))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 16, 29))
|
|
>arg : Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 16, 33))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
>Derived : Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
|
|
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
|
|
>a11 : Symbol(a11, Decl(subtypingWithConstructSignatures6.ts, 16, 58))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 17, 17))
|
|
>foo : Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 17, 21))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 17, 31))
|
|
>foo : Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 17, 36))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>bar : Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 17, 44))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
|
|
a15: new <T>(x: { a: T; b: T }) => T[];
|
|
>a15 : Symbol(a15, Decl(subtypingWithConstructSignatures6.ts, 17, 63))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 18, 17))
|
|
>a : Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 18, 21))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>b : Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 18, 27))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
|
|
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
|
|
>a16 : Symbol(a16, Decl(subtypingWithConstructSignatures6.ts, 18, 43))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 19, 30))
|
|
>a : Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 19, 34))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>b : Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 19, 40))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
}
|
|
|
|
// S's
|
|
interface I<T> extends A {
|
|
>I : Symbol(I, Decl(subtypingWithConstructSignatures6.ts, 20, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a: new (x: T) => T[];
|
|
>a : Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 23, 26))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 24, 12))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
}
|
|
|
|
interface I2<T> extends A {
|
|
>I2 : Symbol(I2, Decl(subtypingWithConstructSignatures6.ts, 25, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 27, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a2: new (x: T) => string[];
|
|
>a2 : Symbol(a2, Decl(subtypingWithConstructSignatures6.ts, 27, 27))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 28, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 27, 13))
|
|
}
|
|
|
|
interface I3<T> extends A {
|
|
>I3 : Symbol(I3, Decl(subtypingWithConstructSignatures6.ts, 29, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a3: new (x: T) => T;
|
|
>a3 : Symbol(a3, Decl(subtypingWithConstructSignatures6.ts, 31, 27))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 32, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
}
|
|
|
|
interface I4<T> extends A {
|
|
>I4 : Symbol(I4, Decl(subtypingWithConstructSignatures6.ts, 33, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 35, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a4: new <U>(x: T, y: U) => string;
|
|
>a4 : Symbol(a4, Decl(subtypingWithConstructSignatures6.ts, 35, 27))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 36, 13))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 36, 16))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 35, 13))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 36, 21))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 36, 13))
|
|
}
|
|
|
|
interface I5<T> extends A {
|
|
>I5 : Symbol(I5, Decl(subtypingWithConstructSignatures6.ts, 37, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a5: new <U>(x: (arg: T) => U) => T;
|
|
>a5 : Symbol(a5, Decl(subtypingWithConstructSignatures6.ts, 39, 27))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 40, 13))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 40, 16))
|
|
>arg : Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 40, 20))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 40, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
}
|
|
|
|
interface I7<T> extends A {
|
|
>I7 : Symbol(I7, Decl(subtypingWithConstructSignatures6.ts, 41, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 43, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
|
>a11 : Symbol(a11, Decl(subtypingWithConstructSignatures6.ts, 43, 27))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 44, 17))
|
|
>foo : Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 44, 21))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 43, 13))
|
|
>y : Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 44, 31))
|
|
>foo : Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 44, 36))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>bar : Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 44, 44))
|
|
>U : Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>Base : Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
}
|
|
|
|
interface I9<T> extends A {
|
|
>I9 : Symbol(I9, Decl(subtypingWithConstructSignatures6.ts, 45, 1))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>A : Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a16: new (x: { a: T; b: T }) => T[];
|
|
>a16 : Symbol(a16, Decl(subtypingWithConstructSignatures6.ts, 47, 27))
|
|
>x : Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 48, 14))
|
|
>a : Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 48, 18))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>b : Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 48, 24))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>T : Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
}
|