-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't bind JSDoc type parameter in a TS file (#16413)
* Don't bind JSDoc type parameter in a TS file * Fix tests * Remove unnecessary non-null assertions
- Loading branch information
Andy
committed
Jun 9, 2017
1 parent
a757e84
commit 13b7d17
Showing
13 changed files
with
104 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
/////** @template [|T|] */ | ||
////class C<[|{| "isWriteAccess": true, "isDefinition": true |}T|]> {} | ||
|
||
verify.singleReferenceGroup("(type parameter) T in C<T>"); |
17 changes: 17 additions & 0 deletions
17
tests/cases/fourslash/findAllRefsJsDocTemplateTag_class_js.ts
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,17 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
// @allowJs: true | ||
// @Filename: /a.js | ||
|
||
// TODO: https://github.com/Microsoft/TypeScript/issues/16411 | ||
// Both uses of T should be referenced. | ||
|
||
/////** @template [|{| "isWriteAccess": true, "isDefinition": true |}T|] */ | ||
////class C { | ||
//// constructor() { | ||
//// /** @type {T} */ | ||
//// this.x = null; | ||
//// } | ||
////} | ||
|
||
verify.singleReferenceGroup("(type parameter) T in C"); |
6 changes: 6 additions & 0 deletions
6
tests/cases/fourslash/findAllRefsJsDocTemplateTag_function.ts
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,6 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
/////** @template [|{| "isWriteAccess": false, "isDefinition": false |}T|] */ | ||
////function f<[|{| "isWriteAccess": true, "isDefinition": true |}T|]>() {} | ||
|
||
verify.singleReferenceGroup("(type parameter) T in f<T>(): void"); |
12 changes: 12 additions & 0 deletions
12
tests/cases/fourslash/findAllRefsJsDocTemplateTag_function_js.ts
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,12 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
// @allowJs: true | ||
// @Filename: /a.js | ||
|
||
/////** | ||
//// * @template [|{| "isWriteAccess": true, "isDefinition": true |}T|] | ||
//// * @return {[|T|]} | ||
//// */ | ||
////function f() {} | ||
|
||
verify.singleReferenceGroup("(type parameter) T"); // TODO:GH#??? should be "(type parameter) T in f<T>(): void" |