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

satisfies does not work on a variable called type #58248

Open
ayoreis opened this issue Apr 19, 2024 · 0 comments
Open

satisfies does not work on a variable called type #58248

ayoreis opened this issue Apr 19, 2024 · 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@ayoreis
Copy link

ayoreis commented Apr 19, 2024

πŸ”Ž Search Terms

satisfies, type, ts1005

πŸ•— Version & Regression Information

This happens from 3.3.3333 to nightly.

satisfies was introduced in 4.9.

⏯ Playground Link

https://www.typescriptlang.org/play?#code/MYewdgzgLgBFCeAHApjAvDA5AD0wKDwRRggEMoBLCAMwuQhKgCcKwBzPIA

πŸ’» Code

const type = 'x'

type satisfies string // '=' expected.(1005)

πŸ™ Actual behavior

Gives an '=' expected.(1005) error.

πŸ™‚ Expected behavior

For it to work like with any other variable of any other name, specially since it's a common variable name.

Additional information about the issue

This also happens with other TypeScript keywords like interface.

If I wrap type in parenthesis it works, is this expected behaviour? The Deno formatter removes it (prettier handles it correctly), should I report this to them.

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Apr 19, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants