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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignaturesWithOptionalParameters.ts ===
// call signatures in derived types must have the same or fewer optional parameters as the base type
interface Base {
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 0, 0))
a: new () => number;
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a2: new (x?: number) => number;
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 13))
a3: new (x: number) => number;
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 13))
a4: new (x: number, y?: number) => number;
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 13))
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 23))
a5: new (x?: number, y?: number) => number;
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 13))
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 24))
a6: new (x: number, y: number) => number;
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 8, 13))
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 8, 23))
}
var b: Base;
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>Base : Symbol(Base, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 0, 0))
var a: new () => number;
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
a = b.a; // ok
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a = b.a2; // ok
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
a = b.a3; // error
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
a = b.a4; // error
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
a = b.a5; // ok
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
a = b.a6; // error
>a : Symbol(a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 12, 3))
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
var a2: new (x?: number) => number;
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 13))
a2 = b.a; // ok
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a2 = b.a2; // ok
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
a2 = b.a3; // ok
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
a2 = b.a4; // ok
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
a2 = b.a5; // ok
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
a2 = b.a6; // error
>a2 : Symbol(a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 20, 3))
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
var a3: new (x: number) => number;
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 13))
a3 = b.a; // ok
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a3 = b.a2; // ok
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
a3 = b.a3; // ok
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
a3 = b.a4; // ok
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
a3 = b.a5; // ok
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
a3 = b.a6; // error
>a3 : Symbol(a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 28, 3))
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
var a4: new (x: number, y?: number) => number;
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 13))
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 23))
a4 = b.a; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a4 = b.a2; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
a4 = b.a3; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
a4 = b.a4; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
a4 = b.a5; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
a4 = b.a6; // ok
>a4 : Symbol(a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 36, 3))
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
var a5: new (x?: number, y?: number) => number;
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>x : Symbol(x, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 13))
>y : Symbol(y, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 24))
a5 = b.a; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a : Symbol(Base.a, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 2, 16))
a5 = b.a2; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a2 : Symbol(Base.a2, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 3, 24))
a5 = b.a3; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a3 : Symbol(Base.a3, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 4, 35))
a5 = b.a4; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a4 : Symbol(Base.a4, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 5, 34))
a5 = b.a5; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a5 : Symbol(Base.a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 6, 46))
a5 = b.a6; // ok
>a5 : Symbol(a5, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 44, 3))
>b.a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
>b : Symbol(b, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 10, 3))
>a6 : Symbol(Base.a6, Decl(assignmentCompatWithConstructSignaturesWithOptionalParameters.ts, 7, 47))
|