Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban class with empty type parameter list #14696

Closed
ghost opened this issue Mar 16, 2017 · 1 comment · Fixed by #14834
Closed

Ban class with empty type parameter list #14696

ghost opened this issue Mar 16, 2017 · 1 comment · Fixed by #14834
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@ghost
Copy link

ghost commented Mar 16, 2017

TypeScript Version: nightly (2.3.0-dev.20170316)

Code

class X<> {}
function f<>() {}
const x: X<> = new X<>();

Expected behavior:

All are errors.

Actual behavior:

All but class X<> {} are errors. We should consistently fail when a type parameter list is empty.

@DanielRosenwasser DanielRosenwasser added Help Wanted You can do this Bug A bug in TypeScript Good First Issue Well scoped, documented and has the green light labels Mar 17, 2017
@mhegazy mhegazy added this to the Community milestone Mar 20, 2017
@misoguy
Copy link
Contributor

misoguy commented Mar 21, 2017

I'd like to give this a shot if no one is already on it :)

chozzz added a commit to chozzz/TypeScript that referenced this issue Mar 24, 2017
- 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.
yuit added a commit that referenced this issue Mar 27, 2017
@mhegazy mhegazy added Fixed A PR has been merged for this issue Breaking Change Would introduce errors in existing code labels Mar 27, 2017
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.3 Mar 27, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants