-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename test, check other CFA branch, test without strictNullChecks
- Loading branch information
1 parent
46ce0b2
commit 3e227f7
Showing
8 changed files
with
148 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/undefinedAsDiscriminantWithUnknown(strictnullchecks=false).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/compiler/undefinedAsDiscriminantWithUnknown.ts === | ||
type S = | ||
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0)) | ||
|
||
| { type: 'string', value: string } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19)) | ||
|
||
| { type: 'number', value: number } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19)) | ||
|
||
| { type: 'unknown', value: unknown } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20)) | ||
|
||
| { value: undefined }; | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
|
||
declare var s: S | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0)) | ||
|
||
if (s.value !== undefined) { | ||
>s.value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
>undefined : Symbol(undefined) | ||
|
||
s; | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
} | ||
else { | ||
s; | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/undefinedAsDiscriminantWithUnknown(strictnullchecks=false).types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/compiler/undefinedAsDiscriminantWithUnknown.ts === | ||
type S = | ||
>S : { type: 'string'; value: string; } | { type: 'number'; value: number; } | { type: 'unknown'; value: unknown; } | { value: undefined; } | ||
|
||
| { type: 'string', value: string } | ||
>type : "string" | ||
>value : string | ||
|
||
| { type: 'number', value: number } | ||
>type : "number" | ||
>value : number | ||
|
||
| { type: 'unknown', value: unknown } | ||
>type : "unknown" | ||
>value : unknown | ||
|
||
| { value: undefined }; | ||
>value : undefined | ||
|
||
declare var s: S | ||
>s : S | ||
|
||
if (s.value !== undefined) { | ||
>s.value !== undefined : boolean | ||
>s.value : unknown | ||
>s : S | ||
>value : unknown | ||
>undefined : undefined | ||
|
||
s; | ||
>s : S | ||
} | ||
else { | ||
s; | ||
>s : S | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/undefinedAsDiscriminantWithUnknown(strictnullchecks=true).js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//// [undefinedAsDiscriminantWithUnknown.ts] | ||
type S = | ||
| { type: 'string', value: string } | ||
| { type: 'number', value: number } | ||
| { type: 'unknown', value: unknown } | ||
| { value: undefined }; | ||
|
||
declare var s: S | ||
|
||
if (s.value !== undefined) { | ||
s; | ||
} | ||
else { | ||
s; | ||
} | ||
|
||
//// [undefinedAsDiscriminantWithUnknown.js] | ||
if (s.value !== undefined) { | ||
s; | ||
} | ||
else { | ||
s; | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/undefinedAsDiscriminantWithUnknown(strictnullchecks=true).symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=== tests/cases/compiler/undefinedAsDiscriminantWithUnknown.ts === | ||
type S = | ||
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0)) | ||
|
||
| { type: 'string', value: string } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19)) | ||
|
||
| { type: 'number', value: number } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19)) | ||
|
||
| { type: 'unknown', value: unknown } | ||
>type : Symbol(type, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 3)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20)) | ||
|
||
| { value: undefined }; | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
|
||
declare var s: S | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
>S : Symbol(S, Decl(undefinedAsDiscriminantWithUnknown.ts, 0, 0)) | ||
|
||
if (s.value !== undefined) { | ||
>s.value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
>value : Symbol(value, Decl(undefinedAsDiscriminantWithUnknown.ts, 1, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 2, 19), Decl(undefinedAsDiscriminantWithUnknown.ts, 3, 20), Decl(undefinedAsDiscriminantWithUnknown.ts, 4, 3)) | ||
>undefined : Symbol(undefined) | ||
|
||
s; | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
} | ||
else { | ||
s; | ||
>s : Symbol(s, Decl(undefinedAsDiscriminantWithUnknown.ts, 6, 11)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters