-
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.
Merge branch 'main' into module-node20
- Loading branch information
Showing
15 changed files
with
1,441 additions
and
923 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
Large diffs are not rendered by default.
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
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
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
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
89 changes: 89 additions & 0 deletions
89
tests/baselines/reference/narrowUnknownByTypePredicate.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,89 @@ | ||
//// [tests/cases/compiler/narrowUnknownByTypePredicate.ts] //// | ||
|
||
=== narrowUnknownByTypePredicate.ts === | ||
declare function isNotNullish(value: unknown): value is {}; | ||
>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 0, 30)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 0, 30)) | ||
|
||
declare function isNullish(value: unknown): value is null | undefined; | ||
>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 1, 27)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 1, 27)) | ||
|
||
declare const value1: unknown; | ||
>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) | ||
|
||
if (isNotNullish(value1)) { | ||
>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) | ||
>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) | ||
|
||
value1; | ||
>value1 : Symbol(value1, Decl(narrowUnknownByTypePredicate.ts, 3, 13)) | ||
} | ||
|
||
declare const value2: unknown; | ||
>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) | ||
|
||
if (!isNotNullish(value2)) { | ||
>isNotNullish : Symbol(isNotNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 0)) | ||
>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) | ||
|
||
value2; | ||
>value2 : Symbol(value2, Decl(narrowUnknownByTypePredicate.ts, 8, 13)) | ||
} | ||
|
||
declare const value3: unknown; | ||
>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) | ||
|
||
if (isNullish(value3)) { | ||
>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) | ||
>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) | ||
|
||
value3; | ||
>value3 : Symbol(value3, Decl(narrowUnknownByTypePredicate.ts, 13, 13)) | ||
} | ||
|
||
declare const value4: unknown; | ||
>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) | ||
|
||
if (!isNullish(value4)) { | ||
>isNullish : Symbol(isNullish, Decl(narrowUnknownByTypePredicate.ts, 0, 59)) | ||
>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) | ||
|
||
value4; | ||
>value4 : Symbol(value4, Decl(narrowUnknownByTypePredicate.ts, 18, 13)) | ||
} | ||
|
||
declare class A { foo: string; } | ||
>A : Symbol(A, Decl(narrowUnknownByTypePredicate.ts, 21, 1)) | ||
>foo : Symbol(A.foo, Decl(narrowUnknownByTypePredicate.ts, 23, 17)) | ||
|
||
declare function isA(value: unknown): value is A; | ||
>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 24, 21)) | ||
>value : Symbol(value, Decl(narrowUnknownByTypePredicate.ts, 24, 21)) | ||
>A : Symbol(A, Decl(narrowUnknownByTypePredicate.ts, 21, 1)) | ||
|
||
declare const value5: unknown; | ||
>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) | ||
|
||
if (isA(value5)) { | ||
>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) | ||
>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) | ||
|
||
value5; | ||
>value5 : Symbol(value5, Decl(narrowUnknownByTypePredicate.ts, 26, 13)) | ||
} | ||
|
||
declare const value6: unknown; | ||
>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) | ||
|
||
if (!isA(value6)) { | ||
>isA : Symbol(isA, Decl(narrowUnknownByTypePredicate.ts, 23, 32)) | ||
>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) | ||
|
||
value6; | ||
>value6 : Symbol(value6, Decl(narrowUnknownByTypePredicate.ts, 31, 13)) | ||
} | ||
|
Oops, something went wrong.