-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simple test works, but too eager for generics
- Loading branch information
1 parent
421ea01
commit 7312b32
Showing
6 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
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
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,11 @@ | ||
//// [nonNullType.ts] | ||
let a: string | undefined | null | never; | ||
let b: typeof a!; | ||
type Assert<T> = T!; | ||
let c: Assert<typeof a>; | ||
|
||
|
||
//// [nonNullType.js] | ||
var a; | ||
var b; | ||
var c; |
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,18 @@ | ||
=== tests/cases/compiler/nonNullType.ts === | ||
let a: string | undefined | null | never; | ||
>a : Symbol(a, Decl(nonNullType.ts, 0, 3)) | ||
|
||
let b: typeof a!; | ||
>b : Symbol(b, Decl(nonNullType.ts, 1, 3)) | ||
>a : Symbol(a, Decl(nonNullType.ts, 0, 3)) | ||
|
||
type Assert<T> = T!; | ||
>Assert : Symbol(Assert, Decl(nonNullType.ts, 1, 17)) | ||
>T : Symbol(T, Decl(nonNullType.ts, 2, 12)) | ||
>T : Symbol(T, Decl(nonNullType.ts, 2, 12)) | ||
|
||
let c: Assert<typeof a>; | ||
>c : Symbol(c, Decl(nonNullType.ts, 3, 3)) | ||
>Assert : Symbol(Assert, Decl(nonNullType.ts, 1, 17)) | ||
>a : Symbol(a, Decl(nonNullType.ts, 0, 3)) | ||
|
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,19 @@ | ||
=== tests/cases/compiler/nonNullType.ts === | ||
let a: string | undefined | null | never; | ||
>a : string | null | undefined | ||
>null : null | ||
|
||
let b: typeof a!; | ||
>b : string | ||
>a : string | null | undefined | ||
|
||
type Assert<T> = T!; | ||
>Assert : T | ||
>T : T | ||
>T : T | ||
|
||
let c: Assert<typeof a>; | ||
>c : string | null | undefined | ||
>Assert : T | ||
>a : string | null | undefined | ||
|
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// @strictNullChecks: true | ||
type z = string | undefined | null | never; | ||
type a = string | undefined | null | never; | ||
type b = a!; | ||
let a: string | undefined | null | never; | ||
let b: typeof a!; | ||
type Assert<T> = T!; | ||
type c = Assert<a>; | ||
|
||
let c: Assert<typeof a>; |