forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix for issue microsoft#14696, things changed are;
- Empty class type will now throw an error, - Trailing comma in class type will also throw an error, - Added tests for empty class type parameter, - Updated tests for class type parameters with trailing comma This behavior is consistently following function or method like when its type parameter is either empty or has trailing comma.
- Loading branch information
Showing
5 changed files
with
34 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/classWithEmptyTypeParameter.errors.txt
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,8 @@ | ||
tests/cases/compiler/classWithEmptyTypeParameter.ts(1,8): error TS1098: Type parameter list cannot be empty. | ||
|
||
|
||
==== tests/cases/compiler/classWithEmptyTypeParameter.ts (1 errors) ==== | ||
class C<> { | ||
~~ | ||
!!! error TS1098: Type parameter list cannot be empty. | ||
} |
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,10 @@ | ||
//// [classWithEmptyTypeParameter.ts] | ||
class C<> { | ||
} | ||
|
||
//// [classWithEmptyTypeParameter.js] | ||
var C = (function () { | ||
function C() { | ||
} | ||
return C; | ||
}()); |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/typeParameterListWithTrailingComma1.errors.txt
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,8 @@ | ||
tests/cases/compiler/typeParameterListWithTrailingComma1.ts(1,10): error TS1009: Trailing comma not allowed. | ||
|
||
|
||
==== tests/cases/compiler/typeParameterListWithTrailingComma1.ts (1 errors) ==== | ||
class C<T,> { | ||
~ | ||
!!! error TS1009: Trailing comma not allowed. | ||
} |
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,2 @@ | ||
class C<> { | ||
} |