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

Missing ASI after field named get #59549

Closed
nicolo-ribaudo opened this issue Aug 7, 2024 · 0 comments Β· Fixed by #60225
Closed

Missing ASI after field named get #59549

nicolo-ribaudo opened this issue Aug 7, 2024 · 0 comments Β· Fixed by #60225
Assignees
Labels
Fix Available A PR has been opened for this issue

Comments

@nicolo-ribaudo
Copy link

πŸ”Ž Search Terms

class field asi

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?noImplicitAny=false&filetype=js#code/MYGwhgzhAECC0G8BQ1XQOYFMAuK0CoAPACgEpEBfJKoA

πŸ’» Code

class A {
    get
    *x() {}
}

πŸ™ Actual behavior

tsc marks the * as an error (Identifier expected.)

πŸ™‚ Expected behavior

Given that there cannot be a * after get, ASI kicks in and that code is equivalent to

class A {
    get;
    *x() {}
}

Additional information about the issue

Firefox also gets this wrong, I submitted a test262 test case: tc39/test262#4189

Also, ASI does not apply to

class A {
    get
    async x() {}
}

because async is a valid token after get.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Aug 8, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.7.0 milestone Aug 8, 2024
@typescript-bot typescript-bot added Fix Available A PR has been opened for this issue labels Oct 14, 2024
@rbuckton rbuckton removed the Needs Investigation This issue needs a team member to investigate its status. label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants