Accept new baselines

This commit is contained in:
Anders Hejlsberg 2018-09-25 18:17:30 -07:00
parent 4bb5cfb9bb
commit 272157185f
3 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,17 @@
//// [bivariantInferences.ts]
// Repro from #27337
interface Array<T> {
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
}
declare const a: (string | number)[] | null[] | undefined[] | {}[];
declare const b: (string | number)[] | null[] | undefined[] | {}[];
let x = a.equalsShallow(b);
//// [bivariantInferences.js]
"use strict";
// Repro from #27337
var x = a.equalsShallow(b);

View file

@ -0,0 +1,31 @@
=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts ===
// Repro from #27337
interface Array<T> {
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 0, 0))
>T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 2, 16))
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20))
>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18))
>this : Symbol(this, Decl(bivariantInferences.ts, 3, 21))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18))
>other : Symbol(other, Decl(bivariantInferences.ts, 3, 44))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18))
}
declare const a: (string | number)[] | null[] | undefined[] | {}[];
>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13))
declare const b: (string | number)[] | null[] | undefined[] | {}[];
>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13))
let x = a.equalsShallow(b);
>x : Symbol(x, Decl(bivariantInferences.ts, 9, 3))
>a.equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13))
>equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20))
>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13))

View file

@ -0,0 +1,26 @@
=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts ===
// Repro from #27337
interface Array<T> {
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
>equalsShallow : <T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean
>this : ReadonlyArray<T>
>other : ReadonlyArray<T>
}
declare const a: (string | number)[] | null[] | undefined[] | {}[];
>a : (string | number)[] | null[] | undefined[] | {}[]
>null : null
declare const b: (string | number)[] | null[] | undefined[] | {}[];
>b : (string | number)[] | null[] | undefined[] | {}[]
>null : null
let x = a.equalsShallow(b);
>x : boolean
>a.equalsShallow(b) : boolean
>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)
>a : (string | number)[] | null[] | undefined[] | {}[]
>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)
>b : (string | number)[] | null[] | undefined[] | {}[]