-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch illegal jsdoc tags on constructors
- Loading branch information
Andy Hanson
committed
Nov 15, 2017
1 parent
3d05952
commit 1b55365
Showing
5 changed files
with
66 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/a.js(2,19): error TS1092: Type parameters cannot appear on a constructor declaration. | ||
/a.js(6,18): error TS1093: Type annotation cannot appear on a constructor declaration. | ||
|
||
|
||
==== /a.js (2 errors) ==== | ||
class C { | ||
/** @template T */ | ||
~ | ||
!!! error TS1092: Type parameters cannot appear on a constructor declaration. | ||
constructor() { } | ||
} | ||
class D { | ||
/** @return {number} */ | ||
~~~~~~ | ||
!!! error TS1093: Type annotation cannot appear on a constructor declaration. | ||
constructor() {} | ||
} | ||
|
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,14 @@ | ||
=== /a.js === | ||
class C { | ||
>C : Symbol(C, Decl(a.js, 0, 0)) | ||
|
||
/** @template T */ | ||
constructor() { } | ||
} | ||
class D { | ||
>D : Symbol(D, Decl(a.js, 3, 1)) | ||
|
||
/** @return {number} */ | ||
constructor() {} | ||
} | ||
|
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,14 @@ | ||
=== /a.js === | ||
class C { | ||
>C : C | ||
|
||
/** @template T */ | ||
constructor() { } | ||
} | ||
class D { | ||
>D : D | ||
|
||
/** @return {number} */ | ||
constructor() {} | ||
} | ||
|
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 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
// @Filename: /a.js | ||
|
||
class C { | ||
/** @template T */ | ||
constructor() { } | ||
} | ||
class D { | ||
/** @return {number} */ | ||
constructor() {} | ||
} |