diff --git a/tests/baselines/reference/asyncYieldStarContextualType.types b/tests/baselines/reference/asyncYieldStarContextualType.types index 0a340b75589ad..55377518eb3e0 100644 --- a/tests/baselines/reference/asyncYieldStarContextualType.types +++ b/tests/baselines/reference/asyncYieldStarContextualType.types @@ -66,13 +66,13 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW >authorPromise.then(mapper) : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise.then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^ ^^ ^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^^ ^^^^^^^^ >authorPromise : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^ ^^ ^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^^ ^^^^^^^^ >mapper : (result: Result) => Result -> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^ // With yield*, the type of test2 is // Author | BookWithAuthor @@ -87,13 +87,13 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW >authorPromise.then(mapper) : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >authorPromise.then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^ ^^ ^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^^ ^^^^^^^^ >authorPromise : Promise> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >then : , TResult2 = never>(onfulfilled?: (value: Result) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^ ^^ ^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^^ ^^^^^^^^ >mapper : (result: Result) => Result -> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^ const x1 = yield* g(); >x1 : unknown @@ -103,7 +103,7 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW >g() : AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", unknown, unknown> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >g : () => AsyncGenerator -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^^ const x2: number = yield* g(); >x2 : number @@ -113,7 +113,7 @@ async function* f(): AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", BookW >g() : AsyncGenerator<"NOT_FOUND_AUTHOR" | "NOT_FOUND_BOOK", number, unknown> > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >g : () => AsyncGenerator -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^^ return null! as BookWithAuthor; >null! as BookWithAuthor : BookWithAuthor diff --git a/tests/baselines/reference/yieldStarContextualType.types b/tests/baselines/reference/yieldStarContextualType.types index 08f89242fda8c..a3996cf7981ef 100644 --- a/tests/baselines/reference/yieldStarContextualType.types +++ b/tests/baselines/reference/yieldStarContextualType.types @@ -17,7 +17,7 @@ function* f(): Generator { >g() : Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >g : () => Generator -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^^ const x2: number = yield* g(); >x2 : number @@ -27,5 +27,5 @@ function* f(): Generator { >g() : Generator > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >g : () => Generator -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^^ }