Skip to content

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

Closed
@whzx5byb

Description

@whzx5byb

πŸ”Ž 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions