Fix build in the presence of definite assignment analysis (#20170)

This commit is contained in:
Wesley Wigham 2017-11-20 14:49:15 -08:00 committed by GitHub
parent 005838f6df
commit e684f30d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ function f2<T extends C, U extends D>(v: T | U) {
}
}
class E { x: string }
class E { x: string | undefined }
function f3<T extends E>(v: T | { x: string }) {
if (v instanceof E) {

View File

@ -57,12 +57,12 @@ function f2<T extends C, U extends D>(v: T | U) {
}
}
class E { x: string }
class E { x: string | undefined }
>E : Symbol(E, Decl(narrowingConstrainedTypeVariable.ts, 22, 1))
>x : Symbol(E.x, Decl(narrowingConstrainedTypeVariable.ts, 24, 9))
function f3<T extends E>(v: T | { x: string }) {
>f3 : Symbol(f3, Decl(narrowingConstrainedTypeVariable.ts, 24, 21))
>f3 : Symbol(f3, Decl(narrowingConstrainedTypeVariable.ts, 24, 33))
>T : Symbol(T, Decl(narrowingConstrainedTypeVariable.ts, 26, 12))
>E : Symbol(E, Decl(narrowingConstrainedTypeVariable.ts, 22, 1))
>v : Symbol(v, Decl(narrowingConstrainedTypeVariable.ts, 26, 25))

View File

@ -59,9 +59,9 @@ function f2<T extends C, U extends D>(v: T | U) {
}
}
class E { x: string }
class E { x: string | undefined }
>E : E
>x : string
>x : string | undefined
function f3<T extends E>(v: T | { x: string }) {
>f3 : <T extends E>(v: T | { x: string; }) => void

View File

@ -24,7 +24,7 @@ function f2<T extends C, U extends D>(v: T | U) {
}
}
class E { x: string }
class E { x: string | undefined }
function f3<T extends E>(v: T | { x: string }) {
if (v instanceof E) {