Skip to content

Commit e684f30

Browse files
authored
Fix build in the presence of definite assignment analysis (#20170)
1 parent 005838f commit e684f30

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

tests/baselines/reference/narrowingConstrainedTypeVariable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function f2<T extends C, U extends D>(v: T | U) {
2323
}
2424
}
2525

26-
class E { x: string }
26+
class E { x: string | undefined }
2727

2828
function f3<T extends E>(v: T | { x: string }) {
2929
if (v instanceof E) {

tests/baselines/reference/narrowingConstrainedTypeVariable.symbols

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ function f2<T extends C, U extends D>(v: T | U) {
5757
}
5858
}
5959

60-
class E { x: string }
60+
class E { x: string | undefined }
6161
>E : Symbol(E, Decl(narrowingConstrainedTypeVariable.ts, 22, 1))
6262
>x : Symbol(E.x, Decl(narrowingConstrainedTypeVariable.ts, 24, 9))
6363

6464
function f3<T extends E>(v: T | { x: string }) {
65-
>f3 : Symbol(f3, Decl(narrowingConstrainedTypeVariable.ts, 24, 21))
65+
>f3 : Symbol(f3, Decl(narrowingConstrainedTypeVariable.ts, 24, 33))
6666
>T : Symbol(T, Decl(narrowingConstrainedTypeVariable.ts, 26, 12))
6767
>E : Symbol(E, Decl(narrowingConstrainedTypeVariable.ts, 22, 1))
6868
>v : Symbol(v, Decl(narrowingConstrainedTypeVariable.ts, 26, 25))

tests/baselines/reference/narrowingConstrainedTypeVariable.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ function f2<T extends C, U extends D>(v: T | U) {
5959
}
6060
}
6161

62-
class E { x: string }
62+
class E { x: string | undefined }
6363
>E : E
64-
>x : string
64+
>x : string | undefined
6565

6666
function f3<T extends E>(v: T | { x: string }) {
6767
>f3 : <T extends E>(v: T | { x: string; }) => void

tests/cases/conformance/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function f2<T extends C, U extends D>(v: T | U) {
2424
}
2525
}
2626

27-
class E { x: string }
27+
class E { x: string | undefined }
2828

2929
function f3<T extends E>(v: T | { x: string }) {
3030
if (v instanceof E) {

0 commit comments

Comments
 (0)