Unnecessary elaboration about not being assignable to type parameters (#42952)

This commit is contained in:
Jonas Hübotter
2021-03-05 20:15:05 +01:00
committed by GitHub
parent 408c804103
commit 25375a2213
22 changed files with 162 additions and 186 deletions

View File

@@ -0,0 +1,13 @@
// @lib: es2015
// @target: ES5
async function foo<T>(x: T): Promise<T> {
let yaddable = await getXOrYadda(x);
return yaddable;
}
interface Yadda {
stuff: string,
things: string,
}
declare function getXOrYadda<T>(x: T): T | Yadda;