Bug Report
🔎 Search Terms
mismatched overload names
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ
⏯ Playground Link
Playground link with relevant code
💻 Code
class Person {
["B"](a: number): string;
["A"](a: string|number): number | string {
return 0;
}
}
let p = new Person();
p.A(0)
// Runtime erorr
p.B(0)
🙁 Actual behavior
Runtime error, on p.B since that member does not actually exist.
🙂 Expected behavior
Compile time error when declaring overloads on methods with computed names and the overload names don't match
Notes
- Seems to happen with other types of computed properties such as symbols.
- Was not found in actual code I was just tinkering with
isolatedDeclarations.
Bug Report
🔎 Search Terms
mismatched overload names
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Runtime error, on
p.Bsince that member does not actually exist.🙂 Expected behavior
Compile time error when declaring overloads on methods with computed names and the overload names don't match
Notes
isolatedDeclarations.