Skip to content

Late bindable index signatures on classes vs override and noImplicitOverride Β #60637

Closed
@Andarist

Description

@Andarist

πŸ”Ž Search Terms

override ambient type declaration class dts noImplicitOverride late bindable index signatures

πŸ•— Version & Regression Information

⏯ Playground Link

https://www.typescriptlang.org/play/?noImplicitOverride=true&ts=5.8.0-dev.20241128#code/PTAEAEDsHsEkFsAOAbAlgY1QFwPIDcBTAJyNQBMCAuULIgVwIChH1pIBnLUdgT3mt7wARtGSgAvKADKfEcgAUASgDczdMgCG7dqABCWggEZQAb0ahQAbUEBdJaYC+jJy03bQAEWKpCZYwQAPLAJIMh19diNTc1BoQhJyAitbexMnF3UtcIMAJmiLaz47RUdnNTcdL1JfPMDg0OzIvLMClJK0stcsvQMAZlKu9yqfAjJ+upCwnsj+ltj40gpkotT0oA

πŸ’» Code

// @noImplicitOverride: true

const sym: symbol = Symbol();

class Base1 {
  [sym]() {}
}

class Derived1 extends Base1 {
  override [sym]() {}
}

class Base2 {
  [sym]() {}
}

class Derived2 extends Base2 {
  [sym]() {}
}

class Base3 {}

class Derived3 extends Base3 {
  override [sym]() {}
}

πŸ™ Actual behavior

No errors are raised

πŸ™‚ Expected behavior

I'd expect either:

  • errors on override with dynamic names
  • errors raised on override members without override under noImplicitOverride

Additional information about the issue

I implemented the first suggestion here f334978 but since I don't know if this is the desired behavior I didn't open a PR with this change yet, cc @weswigham

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some cases

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions