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

override keyword doesn't check symbol-key class members #57141

Closed
whzx5byb opened this issue Jan 23, 2024 · 2 comments Β· Fixed by #57146
Closed

override keyword doesn't check symbol-key class members #57141

whzx5byb opened this issue Jan 23, 2024 · 2 comments Β· Fixed by #57146
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@whzx5byb
Copy link

πŸ”Ž Search Terms

override symbol
override symbol member
override in:title

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

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

πŸ’» Code

const foo = Symbol();
class A {
}

class B extends A {
    override [foo]() { }
} 

πŸ™ Actual behavior

It compiles.

πŸ™‚ Expected behavior

There should be an error: This member cannot have an 'override' modifier because it is not declared in the base class 'A'.

Additional information about the issue

No response

@fatcerberus
Copy link

Please don't post AI-generated replies that just explain normal everyday behavior and have nothing to do with the actual defect being reported.

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

Successfully merging a pull request may close this issue.

4 participants
@fatcerberus @whzx5byb @RyanCavanaugh and others