-
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.
Narrow generic conditional and indexed access return types when check…
…ing return statements (#56941)
- Loading branch information
Showing
41 changed files
with
11,876 additions
and
42 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//// [tests/cases/compiler/arrowExpressionJs.ts] //// | ||
|
||
=== mytest.js === | ||
/** | ||
* @template T | ||
* @param {T|undefined} value value or not | ||
* @returns {T} result value | ||
*/ | ||
const cloneObjectGood = value => /** @type {T} */({ ...value }); | ||
>cloneObjectGood : Symbol(cloneObjectGood, Decl(mytest.js, 5, 5)) | ||
>value : Symbol(value, Decl(mytest.js, 5, 23)) | ||
>value : Symbol(value, Decl(mytest.js, 5, 23)) | ||
|
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,22 @@ | ||
//// [tests/cases/compiler/arrowExpressionJs.ts] //// | ||
|
||
=== mytest.js === | ||
/** | ||
* @template T | ||
* @param {T|undefined} value value or not | ||
* @returns {T} result value | ||
*/ | ||
const cloneObjectGood = value => /** @type {T} */({ ...value }); | ||
>cloneObjectGood : <T>(value: T | undefined) => T | ||
> : ^ ^^ ^^ ^^^^^ | ||
>value => /** @type {T} */({ ...value }) : <T>(value: T | undefined) => T | ||
> : ^ ^^ ^^ ^^^^^ | ||
>value : T | undefined | ||
> : ^^^^^^^^^^^^^ | ||
>({ ...value }) : T | ||
> : ^ | ||
>{ ...value } : {} | ||
> : ^^ | ||
>value : T | undefined | ||
> : ^^^^^^^^^^^^^ | ||
|
Oops, something went wrong.