1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignaturesWithSpecializedSignatures.ts ===
// same as subtypingWithCallSignatures but with additional specialized signatures that should not affect the results
module CallSignature {
>CallSignature : Symbol(CallSignature, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 0, 0))
interface Base { // T
>Base : Symbol(Base, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 2, 22))
// M's
new (x: 'a'): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 5, 13))
new (x: string, y: number): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 6, 13))
>y : Symbol(y, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 6, 23))
}
// S's
interface I extends Base {
>I : Symbol(I, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 7, 5))
>Base : Symbol(Base, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 2, 22))
// N's
new (x: 'a'): number; // ok because base returns void
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 12, 13))
new (x: string, y: number): number; // ok because base returns void
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 13, 13))
>y : Symbol(y, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 13, 23))
new <T>(x: T): string; // ok because base returns void
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 14, 13))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 14, 16))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 14, 13))
}
interface Base2 { // T
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 15, 5))
// M's
new (x: 'a'): number;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 19, 13))
new (x: string): number;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 20, 13))
}
// S's
interface I2 extends Base2 {
>I2 : Symbol(I2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 21, 5))
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 15, 5))
// N's
new (x: 'a'): string;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 26, 13))
new (x: string): string; // error because base returns non-void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 27, 13))
}
// S's
interface I3 extends Base2 {
>I3 : Symbol(I3, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 28, 5))
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 15, 5))
// N's
new <T>(x: T): string; // ok, adds a new call signature
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 33, 13))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 33, 16))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 33, 13))
}
}
module MemberWithCallSignature {
>MemberWithCallSignature : Symbol(MemberWithCallSignature, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 35, 1))
interface Base { // T
>Base : Symbol(Base, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 37, 32))
// M's
a: {
>a : Symbol(Base.a, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 38, 20))
new (x: 'a'): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 41, 17))
new (x: string): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 42, 17))
}
a2: {
>a2 : Symbol(Base.a2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 43, 9))
new (x: 'a', y: number): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 45, 17))
>y : Symbol(y, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 45, 24))
new (x: string, y: number): void;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 46, 17))
>y : Symbol(y, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 46, 27))
}
a3: new <T>(x: T) => void;
>a3 : Symbol(Base.a3, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 47, 9))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 48, 17))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 48, 20))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 48, 17))
}
// S's
interface I extends Base {
>I : Symbol(I, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 49, 5))
>Base : Symbol(Base, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 37, 32))
// N's
a: new (x: string) => number; // ok because base returns void
>a : Symbol(I.a, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 52, 30))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 54, 16))
a2: new (x: string, y: number) => boolean; // ok because base returns void
>a2 : Symbol(I.a2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 54, 37))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 55, 18))
>y : Symbol(y, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 55, 28))
a3: new <T>(x: T) => string; // ok because base returns void
>a3 : Symbol(I.a3, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 55, 51))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 56, 17))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 56, 20))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 56, 17))
}
interface Base2 { // T
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 57, 5))
// M's
a: {
>a : Symbol(Base2.a, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 59, 21))
new (x: 'a'): number;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 62, 17))
new (x: string): number;
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 63, 17))
}
a2: new <T>(x: T) => T;
>a2 : Symbol(Base2.a2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 64, 9))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 65, 17))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 65, 20))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 65, 17))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 65, 17))
}
// S's
interface I2 extends Base2 {
>I2 : Symbol(I2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 66, 5))
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 57, 5))
// N's
a: new (x: string) => string; // error because base returns non-void;
>a : Symbol(I2.a, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 69, 32))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 71, 16))
}
// S's
interface I3 extends Base2 {
>I3 : Symbol(I3, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 72, 5))
>Base2 : Symbol(Base2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 57, 5))
// N's
a2: new <T>(x: T) => string; // error because base returns non-void;
>a2 : Symbol(I3.a2, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 75, 32))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 77, 17))
>x : Symbol(x, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 77, 20))
>T : Symbol(T, Decl(subtypingWithConstructSignaturesWithSpecializedSignatures.ts, 77, 17))
}
}
|