Open
Description
Currently, this pattern gives an error, but arguably shouldn't:
class B {
get p() { return B.s } // inferred p: {}
static get s() { return {} }
}
class C extends B {
declare readonly p: { x: 1 }
}
Expected behavior:
No error, and C.p: { x: 1 }
(but is still an accessor for emit and checking purposes). That is, this should be legal:
class D extends C {
get p() { return { x: 1 } as const }
}
Actual behavior:
Error, and C.p
is a property, not an accessor.