|
| 1 | +=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts === |
| 2 | +// Repro from #27337 |
| 3 | + |
| 4 | +interface Array<T> { |
| 5 | +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 0, 0)) |
| 6 | +>T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 2, 16)) |
| 7 | + |
| 8 | + equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean; |
| 9 | +>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20)) |
| 10 | +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) |
| 11 | +>this : Symbol(this, Decl(bivariantInferences.ts, 3, 21)) |
| 12 | +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) |
| 13 | +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) |
| 14 | +>other : Symbol(other, Decl(bivariantInferences.ts, 3, 44)) |
| 15 | +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) |
| 16 | +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) |
| 17 | +} |
| 18 | + |
| 19 | +declare const a: (string | number)[] | null[] | undefined[] | {}[]; |
| 20 | +>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13)) |
| 21 | + |
| 22 | +declare const b: (string | number)[] | null[] | undefined[] | {}[]; |
| 23 | +>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13)) |
| 24 | + |
| 25 | +let x = a.equalsShallow(b); |
| 26 | +>x : Symbol(x, Decl(bivariantInferences.ts, 9, 3)) |
| 27 | +>a.equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20)) |
| 28 | +>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13)) |
| 29 | +>equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20)) |
| 30 | +>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13)) |
| 31 | + |
0 commit comments