mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Accept new baselines
This commit is contained in:
parent
b9d27c0f2c
commit
540134840d
@ -4,9 +4,51 @@
|
||||
type Maybe<T> = T | undefined;
|
||||
declare function concatMaybe<T>(...args: (Maybe<T> | Maybe<T>[])[]): T[];
|
||||
concatMaybe([1, 2, 3], 4);
|
||||
|
||||
// Repros from #32247
|
||||
|
||||
const g: <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U> = async <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>): Promise<U> => {
|
||||
throw com;
|
||||
};
|
||||
|
||||
interface Foo1<T> {
|
||||
test(value: T): void;
|
||||
}
|
||||
|
||||
interface Bar1<T> {
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
}
|
||||
|
||||
declare let f1: <T>(x: Foo1<T> | Bar1<T>) => Promise<T>;
|
||||
declare let f2: <U>(x: Foo1<U> | Bar1<U>) => Promise<U>;
|
||||
|
||||
f1 = f2;
|
||||
f2 = f1;
|
||||
|
||||
type Foo2<T> = {
|
||||
test(value: T): void;
|
||||
}
|
||||
|
||||
type Bar2<T> = {
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
}
|
||||
|
||||
declare let g1: <T>(x: Foo2<T> | Bar2<T>) => Promise<T>;
|
||||
declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
|
||||
|
||||
g1 = g2;
|
||||
g2 = g1;
|
||||
|
||||
|
||||
//// [unionAndIntersectionInference3.js]
|
||||
"use strict";
|
||||
// Repro from #30720
|
||||
concatMaybe([1, 2, 3], 4);
|
||||
// Repros from #32247
|
||||
const g = async (com) => {
|
||||
throw com;
|
||||
};
|
||||
f1 = f2;
|
||||
f2 = f1;
|
||||
g1 = g2;
|
||||
g2 = g1;
|
||||
|
||||
@ -19,3 +19,145 @@ declare function concatMaybe<T>(...args: (Maybe<T> | Maybe<T>[])[]): T[];
|
||||
concatMaybe([1, 2, 3], 4);
|
||||
>concatMaybe : Symbol(concatMaybe, Decl(unionAndIntersectionInference3.ts, 2, 30))
|
||||
|
||||
// Repros from #32247
|
||||
|
||||
const g: <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U> = async <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>): Promise<U> => {
|
||||
>g : Symbol(g, Decl(unionAndIntersectionInference3.ts, 8, 5))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
|
||||
>com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 19))
|
||||
>Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
|
||||
>AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 15))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 12))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 10))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
|
||||
>com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 106))
|
||||
>Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
|
||||
>AsyncIterator : Symbol(AsyncIterator, Decl(lib.es2018.asynciterable.d.ts, --, --))
|
||||
>S : Symbol(S, Decl(unionAndIntersectionInference3.ts, 8, 102))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
|
||||
>R : Symbol(R, Decl(unionAndIntersectionInference3.ts, 8, 99))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 8, 97))
|
||||
|
||||
throw com;
|
||||
>com : Symbol(com, Decl(unionAndIntersectionInference3.ts, 8, 106))
|
||||
|
||||
};
|
||||
|
||||
interface Foo1<T> {
|
||||
>Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 12, 15))
|
||||
|
||||
test(value: T): void;
|
||||
>test : Symbol(Foo1.test, Decl(unionAndIntersectionInference3.ts, 12, 19))
|
||||
>value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 13, 9))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 12, 15))
|
||||
}
|
||||
|
||||
interface Bar1<T> {
|
||||
>Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
|
||||
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
>test : Symbol(Bar1.test, Decl(unionAndIntersectionInference3.ts, 16, 19))
|
||||
>value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 17, 9))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
|
||||
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 16, 15))
|
||||
}
|
||||
|
||||
declare let f1: <T>(x: Foo1<T> | Bar1<T>) => Promise<T>;
|
||||
>f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
|
||||
>x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 20, 20))
|
||||
>Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
|
||||
>Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 20, 17))
|
||||
|
||||
declare let f2: <U>(x: Foo1<U> | Bar1<U>) => Promise<U>;
|
||||
>f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
|
||||
>x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 21, 20))
|
||||
>Foo1 : Symbol(Foo1, Decl(unionAndIntersectionInference3.ts, 10, 2))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
|
||||
>Bar1 : Symbol(Bar1, Decl(unionAndIntersectionInference3.ts, 14, 1))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 21, 17))
|
||||
|
||||
f1 = f2;
|
||||
>f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
|
||||
>f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
|
||||
|
||||
f2 = f1;
|
||||
>f2 : Symbol(f2, Decl(unionAndIntersectionInference3.ts, 21, 11))
|
||||
>f1 : Symbol(f1, Decl(unionAndIntersectionInference3.ts, 20, 11))
|
||||
|
||||
type Foo2<T> = {
|
||||
>Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 26, 10))
|
||||
|
||||
test(value: T): void;
|
||||
>test : Symbol(test, Decl(unionAndIntersectionInference3.ts, 26, 16))
|
||||
>value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 27, 9))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 26, 10))
|
||||
}
|
||||
|
||||
type Bar2<T> = {
|
||||
>Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
|
||||
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
>test : Symbol(test, Decl(unionAndIntersectionInference3.ts, 30, 16))
|
||||
>value : Symbol(value, Decl(unionAndIntersectionInference3.ts, 31, 9))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
|
||||
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 30, 10))
|
||||
}
|
||||
|
||||
declare let g1: <T>(x: Foo2<T> | Bar2<T>) => Promise<T>;
|
||||
>g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
|
||||
>x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 34, 20))
|
||||
>Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
|
||||
>Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 34, 17))
|
||||
|
||||
declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
|
||||
>g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
|
||||
>x : Symbol(x, Decl(unionAndIntersectionInference3.ts, 35, 20))
|
||||
>Foo2 : Symbol(Foo2, Decl(unionAndIntersectionInference3.ts, 24, 8))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
|
||||
>Bar2 : Symbol(Bar2, Decl(unionAndIntersectionInference3.ts, 28, 1))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
|
||||
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
|
||||
>U : Symbol(U, Decl(unionAndIntersectionInference3.ts, 35, 17))
|
||||
|
||||
g1 = g2;
|
||||
>g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
|
||||
>g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
|
||||
|
||||
g2 = g1;
|
||||
>g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
|
||||
>g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
|
||||
|
||||
|
||||
@ -17,3 +17,80 @@ concatMaybe([1, 2, 3], 4);
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
// Repros from #32247
|
||||
|
||||
const g: <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U> = async <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>): Promise<U> => {
|
||||
>g : <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U>
|
||||
>com : () => Iterator<S, U, R> | AsyncIterator<S, U, R>
|
||||
>async <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>): Promise<U> => { throw com;} : <U, R, S>(com: () => Iterator<S, U, R> | AsyncIterator<S, U, R>) => Promise<U>
|
||||
>com : () => Iterator<S, U, R> | AsyncIterator<S, U, R>
|
||||
|
||||
throw com;
|
||||
>com : () => Iterator<S, U, R> | AsyncIterator<S, U, R>
|
||||
|
||||
};
|
||||
|
||||
interface Foo1<T> {
|
||||
test(value: T): void;
|
||||
>test : (value: T) => void
|
||||
>value : T
|
||||
}
|
||||
|
||||
interface Bar1<T> {
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
>test : (value: T | PromiseLike<T>) => void
|
||||
>value : T | PromiseLike<T>
|
||||
}
|
||||
|
||||
declare let f1: <T>(x: Foo1<T> | Bar1<T>) => Promise<T>;
|
||||
>f1 : <T>(x: Foo1<T> | Bar1<T>) => Promise<T>
|
||||
>x : Foo1<T> | Bar1<T>
|
||||
|
||||
declare let f2: <U>(x: Foo1<U> | Bar1<U>) => Promise<U>;
|
||||
>f2 : <U>(x: Foo1<U> | Bar1<U>) => Promise<U>
|
||||
>x : Foo1<U> | Bar1<U>
|
||||
|
||||
f1 = f2;
|
||||
>f1 = f2 : <U>(x: Foo1<U> | Bar1<U>) => Promise<U>
|
||||
>f1 : <T>(x: Foo1<T> | Bar1<T>) => Promise<T>
|
||||
>f2 : <U>(x: Foo1<U> | Bar1<U>) => Promise<U>
|
||||
|
||||
f2 = f1;
|
||||
>f2 = f1 : <T>(x: Foo1<T> | Bar1<T>) => Promise<T>
|
||||
>f2 : <U>(x: Foo1<U> | Bar1<U>) => Promise<U>
|
||||
>f1 : <T>(x: Foo1<T> | Bar1<T>) => Promise<T>
|
||||
|
||||
type Foo2<T> = {
|
||||
>Foo2 : Foo2<T>
|
||||
|
||||
test(value: T): void;
|
||||
>test : (value: T) => void
|
||||
>value : T
|
||||
}
|
||||
|
||||
type Bar2<T> = {
|
||||
>Bar2 : Bar2<T>
|
||||
|
||||
test(value: T | PromiseLike<T>): void;
|
||||
>test : (value: T | PromiseLike<T>) => void
|
||||
>value : T | PromiseLike<T>
|
||||
}
|
||||
|
||||
declare let g1: <T>(x: Foo2<T> | Bar2<T>) => Promise<T>;
|
||||
>g1 : <T>(x: Foo2<T> | Bar2<T>) => Promise<T>
|
||||
>x : Foo2<T> | Bar2<T>
|
||||
|
||||
declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
|
||||
>g2 : <U>(x: Foo2<U> | Bar2<U>) => Promise<U>
|
||||
>x : Foo2<U> | Bar2<U>
|
||||
|
||||
g1 = g2;
|
||||
>g1 = g2 : <U>(x: Foo2<U> | Bar2<U>) => Promise<U>
|
||||
>g1 : <T>(x: Foo2<T> | Bar2<T>) => Promise<T>
|
||||
>g2 : <U>(x: Foo2<U> | Bar2<U>) => Promise<U>
|
||||
|
||||
g2 = g1;
|
||||
>g2 = g1 : <T>(x: Foo2<T> | Bar2<T>) => Promise<T>
|
||||
>g2 : <U>(x: Foo2<U> | Bar2<U>) => Promise<U>
|
||||
>g1 : <T>(x: Foo2<T> | Bar2<T>) => Promise<T>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user