Closed
Description
🔎 Search Terms
Mixin class, getter merging, property, is defined as a property in class but is overridden here in 'Test' as an accessor.
🕗 Version & Regression Information
- This changed in commit or PR 3ffe253
However, given that the title of this commit is "Always error when property overrides accessor or vice versa" I would say this issue likely originated earlier but was not reported.
⏯ Playground Link
💻 Code
declare function basicMixin<T extends object, U extends object>(t: T, u: U): T & U;
declare class GetterA {
constructor(...args: any[])
get inCompendium(): boolean;
}
declare class GetterB {
constructor(...args: any[])
get inCompendium(): boolean
}
declare class TestB extends basicMixin(GetterA, GetterB) {
override get inCompendium(): boolean;
// ^ 'inCompendium' is defined as a property in class 'GetterA & GetterB', but is overridden here in 'TestB' as an accessor.
}
🙁 Actual behavior
The error 'inCompendium' is defined as a property in class 'GetterA & GetterB', but is overridden here in 'TestB' as an accessor.
due to get inCompendium(): boolean
being converted to inCompendium: boolean
when computing GetterA & GetterB
🙂 Expected behavior
No error.
Additional information about the issue
No response