Skip to content

Commit fed0e8c

Browse files
committed
Accept new baselines
1 parent 5b45f42 commit fed0e8c

4 files changed

+14
-14
lines changed

tests/baselines/reference/recursiveConditionalTypes.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tests/cases/compiler/recursiveConditionalTypes.ts(89,9): error TS2345: Argument
4141
T;
4242

4343
type MyPromise<T> = {
44-
then<U>(f: ((value: T) => U | MyPromise<U>) | null | undefined): MyPromise<U>;
44+
then<U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined): MyPromise<U>;
4545
}
4646

4747
type InfinitePromise<T> = Promise<InfinitePromise<T>>;
@@ -129,7 +129,7 @@ tests/cases/compiler/recursiveConditionalTypes.ts(89,9): error TS2345: Argument
129129

130130
declare let z: Box2<Box2<string>>;
131131

132-
foo(z); // string
132+
foo(z); // unknown, but ideally would be string (requires unique recursion ID for each type reference)
133133

134134
// Intersect tuple element types
135135

tests/baselines/reference/recursiveConditionalTypes.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type Awaited<T> =
77
T;
88

99
type MyPromise<T> = {
10-
then<U>(f: ((value: T) => U | MyPromise<U>) | null | undefined): MyPromise<U>;
10+
then<U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined): MyPromise<U>;
1111
}
1212

1313
type InfinitePromise<T> = Promise<InfinitePromise<T>>;
@@ -64,7 +64,7 @@ declare function foo<T>(x: Box1<Box1<T>>): T;
6464

6565
declare let z: Box2<Box2<string>>;
6666

67-
foo(z); // string
67+
foo(z); // unknown, but ideally would be string (requires unique recursion ID for each type reference)
6868

6969
// Intersect tuple element types
7070

@@ -105,7 +105,7 @@ function f22(tn, tm) {
105105
tm = tn;
106106
}
107107
f23(['a', 'b', 'c']); // string
108-
foo(z); // string
108+
foo(z); // unknown, but ideally would be string (requires unique recursion ID for each type reference)
109109
function f20(x, y) {
110110
x = y;
111111
y = x;
@@ -119,7 +119,7 @@ function f21(x, y) {
119119
//// [recursiveConditionalTypes.d.ts]
120120
declare type Awaited<T> = T extends null | undefined ? T : T extends PromiseLike<infer U> ? Awaited<U> : T;
121121
declare type MyPromise<T> = {
122-
then<U>(f: ((value: T) => U | MyPromise<U>) | null | undefined): MyPromise<U>;
122+
then<U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined): MyPromise<U>;
123123
};
124124
declare type InfinitePromise<T> = Promise<InfinitePromise<T>>;
125125
declare type P0 = Awaited<Promise<string | Promise<MyPromise<number> | null> | undefined>>;

tests/baselines/reference/recursiveConditionalTypes.symbols

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ type MyPromise<T> = {
2323
>MyPromise : Symbol(MyPromise, Decl(recursiveConditionalTypes.ts, 5, 6))
2424
>T : Symbol(T, Decl(recursiveConditionalTypes.ts, 7, 15))
2525

26-
then<U>(f: ((value: T) => U | MyPromise<U>) | null | undefined): MyPromise<U>;
26+
then<U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined): MyPromise<U>;
2727
>then : Symbol(then, Decl(recursiveConditionalTypes.ts, 7, 21))
2828
>U : Symbol(U, Decl(recursiveConditionalTypes.ts, 8, 9))
2929
>f : Symbol(f, Decl(recursiveConditionalTypes.ts, 8, 12))
3030
>value : Symbol(value, Decl(recursiveConditionalTypes.ts, 8, 17))
3131
>T : Symbol(T, Decl(recursiveConditionalTypes.ts, 7, 15))
3232
>U : Symbol(U, Decl(recursiveConditionalTypes.ts, 8, 9))
33-
>MyPromise : Symbol(MyPromise, Decl(recursiveConditionalTypes.ts, 5, 6))
33+
>PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --))
3434
>U : Symbol(U, Decl(recursiveConditionalTypes.ts, 8, 9))
3535
>MyPromise : Symbol(MyPromise, Decl(recursiveConditionalTypes.ts, 5, 6))
3636
>U : Symbol(U, Decl(recursiveConditionalTypes.ts, 8, 9))
@@ -243,7 +243,7 @@ declare let z: Box2<Box2<string>>;
243243
>Box2 : Symbol(Box2, Decl(recursiveConditionalTypes.ts, 58, 28))
244244
>Box2 : Symbol(Box2, Decl(recursiveConditionalTypes.ts, 58, 28))
245245

246-
foo(z); // string
246+
foo(z); // unknown, but ideally would be string (requires unique recursion ID for each type reference)
247247
>foo : Symbol(foo, Decl(recursiveConditionalTypes.ts, 59, 28))
248248
>z : Symbol(z, Decl(recursiveConditionalTypes.ts, 63, 11))
249249

tests/baselines/reference/recursiveConditionalTypes.types

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type Awaited<T> =
1313
type MyPromise<T> = {
1414
>MyPromise : MyPromise<T>
1515

16-
then<U>(f: ((value: T) => U | MyPromise<U>) | null | undefined): MyPromise<U>;
17-
>then : <U>(f: ((value: T) => U | MyPromise<U>) | null | undefined) => MyPromise<U>
18-
>f : ((value: T) => U | MyPromise<U>) | null | undefined
16+
then<U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined): MyPromise<U>;
17+
>then : <U>(f: ((value: T) => U | PromiseLike<U>) | null | undefined) => MyPromise<U>
18+
>f : ((value: T) => U | PromiseLike<U>) | null | undefined
1919
>value : T
2020
>null : null
2121
}
@@ -152,8 +152,8 @@ declare function foo<T>(x: Box1<Box1<T>>): T;
152152
declare let z: Box2<Box2<string>>;
153153
>z : Box2<Box2<string>>
154154

155-
foo(z); // string
156-
>foo(z) : string
155+
foo(z); // unknown, but ideally would be string (requires unique recursion ID for each type reference)
156+
>foo(z) : unknown
157157
>foo : <T>(x: Box1<Box1<T>>) => T
158158
>z : Box2<Box2<string>>
159159

0 commit comments

Comments
 (0)