Skip to content

Commit 2721571

Browse files
committed
Accept new baselines
1 parent 4bb5cfb commit 2721571

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [bivariantInferences.ts]
2+
// Repro from #27337
3+
4+
interface Array<T> {
5+
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
6+
}
7+
8+
declare const a: (string | number)[] | null[] | undefined[] | {}[];
9+
declare const b: (string | number)[] | null[] | undefined[] | {}[];
10+
11+
let x = a.equalsShallow(b);
12+
13+
14+
//// [bivariantInferences.js]
15+
"use strict";
16+
// Repro from #27337
17+
var x = a.equalsShallow(b);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts ===
2+
// Repro from #27337
3+
4+
interface Array<T> {
5+
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
6+
>equalsShallow : <T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean
7+
>this : ReadonlyArray<T>
8+
>other : ReadonlyArray<T>
9+
}
10+
11+
declare const a: (string | number)[] | null[] | undefined[] | {}[];
12+
>a : (string | number)[] | null[] | undefined[] | {}[]
13+
>null : null
14+
15+
declare const b: (string | number)[] | null[] | undefined[] | {}[];
16+
>b : (string | number)[] | null[] | undefined[] | {}[]
17+
>null : null
18+
19+
let x = a.equalsShallow(b);
20+
>x : boolean
21+
>a.equalsShallow(b) : boolean
22+
>a.equalsShallow : (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean)
23+
>a : (string | number)[] | null[] | undefined[] | {}[]
24+
>equalsShallow : (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean) | (<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean)
25+
>b : (string | number)[] | null[] | undefined[] | {}[]
26+

0 commit comments

Comments
 (0)