Merge branch 'master' into master-refactorJsDocTest

This commit is contained in:
Yui T
2017-05-31 09:48:36 -07:00
11 changed files with 1439 additions and 895 deletions

View File

@@ -0,0 +1,11 @@
//// [forAwaitForUnion.ts]
async function f<T>(source: Iterable<T> | AsyncIterable<T>) {
for await (const x of source) {
}
}
//// [forAwaitForUnion.js]
async function f(source) {
for await (const x of source) {
}
}

View File

@@ -0,0 +1,15 @@
=== tests/cases/compiler/forAwaitForUnion.ts ===
async function f<T>(source: Iterable<T> | AsyncIterable<T>) {
>f : Symbol(f, Decl(forAwaitForUnion.ts, 0, 0))
>T : Symbol(T, Decl(forAwaitForUnion.ts, 0, 17))
>source : Symbol(source, Decl(forAwaitForUnion.ts, 0, 20))
>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --))
>T : Symbol(T, Decl(forAwaitForUnion.ts, 0, 17))
>AsyncIterable : Symbol(AsyncIterable, Decl(lib.esnext.asynciterable.d.ts, --, --))
>T : Symbol(T, Decl(forAwaitForUnion.ts, 0, 17))
for await (const x of source) {
>x : Symbol(x, Decl(forAwaitForUnion.ts, 1, 20))
>source : Symbol(source, Decl(forAwaitForUnion.ts, 0, 20))
}
}

View File

@@ -0,0 +1,15 @@
=== tests/cases/compiler/forAwaitForUnion.ts ===
async function f<T>(source: Iterable<T> | AsyncIterable<T>) {
>f : <T>(source: Iterable<T> | AsyncIterable<T>) => Promise<void>
>T : T
>source : Iterable<T> | AsyncIterable<T>
>Iterable : Iterable<T>
>T : T
>AsyncIterable : AsyncIterable<T>
>T : T
for await (const x of source) {
>x : T
>source : Iterable<T> | AsyncIterable<T>
}
}

View File

@@ -0,0 +1,6 @@
// @target: esnext
// @lib: esnext
async function f<T>(source: Iterable<T> | AsyncIterable<T>) {
for await (const x of source) {
}
}