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

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

Open
Andarist opened this issue Nov 28, 2024 · 0 comments
Open

Comments

@Andarist
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant