210 lines
12 KiB
Plaintext
210 lines
12 KiB
Plaintext
=== 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 : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>foo : string, Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 4, 12))
|
|
|
|
class Derived extends Base { bar: string; }
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>bar : string, Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 5, 28))
|
|
|
|
class Derived2 extends Derived { baz: string; }
|
|
>Derived2 : Derived2, Symbol(Derived2, Decl(subtypingWithConstructSignatures6.ts, 5, 43))
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>baz : string, Symbol(baz, Decl(subtypingWithConstructSignatures6.ts, 6, 32))
|
|
|
|
class OtherDerived extends Base { bing: string; }
|
|
>OtherDerived : OtherDerived, Symbol(OtherDerived, Decl(subtypingWithConstructSignatures6.ts, 6, 47))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>bing : string, Symbol(bing, Decl(subtypingWithConstructSignatures6.ts, 7, 33))
|
|
|
|
interface A { // T
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
// M's
|
|
a: new <T>(x: T) => T[];
|
|
>a : new <T>(x: T) => T[], Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 9, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 11, 15))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 11, 12))
|
|
|
|
a2: new <T>(x: T) => string[];
|
|
>a2 : new <T>(x: T) => string[], Symbol(a2, Decl(subtypingWithConstructSignatures6.ts, 11, 28))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 12, 13))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 12, 16))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 12, 13))
|
|
|
|
a3: new <T>(x: T) => void;
|
|
>a3 : new <T>(x: T) => void, Symbol(a3, Decl(subtypingWithConstructSignatures6.ts, 12, 34))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 13, 13))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 13, 16))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 13, 13))
|
|
|
|
a4: new <T, U>(x: T, y: U) => string;
|
|
>a4 : new <T, U>(x: T, y: U) => string, Symbol(a4, Decl(subtypingWithConstructSignatures6.ts, 13, 30))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 14, 13))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 14, 15))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 14, 19))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 14, 13))
|
|
>y : U, Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 14, 24))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 14, 15))
|
|
|
|
a5: new <T, U>(x: (arg: T) => U) => T;
|
|
>a5 : new <T, U>(x: (arg: T) => U) => T, Symbol(a5, Decl(subtypingWithConstructSignatures6.ts, 14, 41))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 15, 15))
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 15, 19))
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 15, 23))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 15, 15))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 15, 13))
|
|
|
|
a6: new <T extends Base>(x: (arg: T) => Derived) => T;
|
|
>a6 : new <T extends Base>(x: (arg: T) => Derived) => T, Symbol(a6, Decl(subtypingWithConstructSignatures6.ts, 15, 42))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>x : (arg: T) => Derived, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 16, 29))
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 16, 33))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
>Derived : Derived, Symbol(Derived, Decl(subtypingWithConstructSignatures6.ts, 4, 27))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 16, 13))
|
|
|
|
a11: new <T>(x: { foo: T }, y: { foo: T; bar: T }) => Base;
|
|
>a11 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base, Symbol(a11, Decl(subtypingWithConstructSignatures6.ts, 16, 58))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>x : { foo: T; }, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 17, 17))
|
|
>foo : T, Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 17, 21))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>y : { foo: T; bar: T; }, Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 17, 31))
|
|
>foo : T, Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 17, 36))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>bar : T, Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 17, 44))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 17, 14))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
|
|
a15: new <T>(x: { a: T; b: T }) => T[];
|
|
>a15 : new <T>(x: { a: T; b: T; }) => T[], Symbol(a15, Decl(subtypingWithConstructSignatures6.ts, 17, 63))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>x : { a: T; b: T; }, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 18, 17))
|
|
>a : T, Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 18, 21))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>b : T, Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 18, 27))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 18, 14))
|
|
|
|
a16: new <T extends Base>(x: { a: T; b: T }) => T[];
|
|
>a16 : new <T extends Base>(x: { a: T; b: T; }) => T[], Symbol(a16, Decl(subtypingWithConstructSignatures6.ts, 18, 43))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
>x : { a: T; b: T; }, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 19, 30))
|
|
>a : T, Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 19, 34))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>b : T, Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 19, 40))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 19, 14))
|
|
}
|
|
|
|
// S's
|
|
interface I<T> extends A {
|
|
>I : I<T>, Symbol(I, Decl(subtypingWithConstructSignatures6.ts, 20, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a: new (x: T) => T[];
|
|
>a : new (x: T) => T[], Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 23, 26))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 24, 12))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 23, 12))
|
|
}
|
|
|
|
interface I2<T> extends A {
|
|
>I2 : I2<T>, Symbol(I2, Decl(subtypingWithConstructSignatures6.ts, 25, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 27, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a2: new (x: T) => string[];
|
|
>a2 : new (x: T) => string[], Symbol(a2, Decl(subtypingWithConstructSignatures6.ts, 27, 27))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 28, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 27, 13))
|
|
}
|
|
|
|
interface I3<T> extends A {
|
|
>I3 : I3<T>, Symbol(I3, Decl(subtypingWithConstructSignatures6.ts, 29, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a3: new (x: T) => T;
|
|
>a3 : new (x: T) => T, Symbol(a3, Decl(subtypingWithConstructSignatures6.ts, 31, 27))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 32, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 31, 13))
|
|
}
|
|
|
|
interface I4<T> extends A {
|
|
>I4 : I4<T>, Symbol(I4, Decl(subtypingWithConstructSignatures6.ts, 33, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 35, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a4: new <U>(x: T, y: U) => string;
|
|
>a4 : new <U>(x: T, y: U) => string, Symbol(a4, Decl(subtypingWithConstructSignatures6.ts, 35, 27))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 36, 13))
|
|
>x : T, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 36, 16))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 35, 13))
|
|
>y : U, Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 36, 21))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 36, 13))
|
|
}
|
|
|
|
interface I5<T> extends A {
|
|
>I5 : I5<T>, Symbol(I5, Decl(subtypingWithConstructSignatures6.ts, 37, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a5: new <U>(x: (arg: T) => U) => T;
|
|
>a5 : new <U>(x: (arg: T) => U) => T, Symbol(a5, Decl(subtypingWithConstructSignatures6.ts, 39, 27))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 40, 13))
|
|
>x : (arg: T) => U, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 40, 16))
|
|
>arg : T, Symbol(arg, Decl(subtypingWithConstructSignatures6.ts, 40, 20))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 40, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 39, 13))
|
|
}
|
|
|
|
interface I7<T> extends A {
|
|
>I7 : I7<T>, Symbol(I7, Decl(subtypingWithConstructSignatures6.ts, 41, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 43, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
|
|
>a11 : new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base, Symbol(a11, Decl(subtypingWithConstructSignatures6.ts, 43, 27))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>x : { foo: T; }, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 44, 17))
|
|
>foo : T, Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 44, 21))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 43, 13))
|
|
>y : { foo: U; bar: U; }, Symbol(y, Decl(subtypingWithConstructSignatures6.ts, 44, 31))
|
|
>foo : U, Symbol(foo, Decl(subtypingWithConstructSignatures6.ts, 44, 36))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>bar : U, Symbol(bar, Decl(subtypingWithConstructSignatures6.ts, 44, 44))
|
|
>U : U, Symbol(U, Decl(subtypingWithConstructSignatures6.ts, 44, 14))
|
|
>Base : Base, Symbol(Base, Decl(subtypingWithConstructSignatures6.ts, 0, 0))
|
|
}
|
|
|
|
interface I9<T> extends A {
|
|
>I9 : I9<T>, Symbol(I9, Decl(subtypingWithConstructSignatures6.ts, 45, 1))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>A : A, Symbol(A, Decl(subtypingWithConstructSignatures6.ts, 7, 49))
|
|
|
|
a16: new (x: { a: T; b: T }) => T[];
|
|
>a16 : new (x: { a: T; b: T; }) => T[], Symbol(a16, Decl(subtypingWithConstructSignatures6.ts, 47, 27))
|
|
>x : { a: T; b: T; }, Symbol(x, Decl(subtypingWithConstructSignatures6.ts, 48, 14))
|
|
>a : T, Symbol(a, Decl(subtypingWithConstructSignatures6.ts, 48, 18))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>b : T, Symbol(b, Decl(subtypingWithConstructSignatures6.ts, 48, 24))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
>T : T, Symbol(T, Decl(subtypingWithConstructSignatures6.ts, 47, 13))
|
|
}
|