Skip to content

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

Closed

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

Activity

  1. fatcerberus commented on Jan 24, 2024

    @fatcerberus

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

  2. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions