14:01
<Jack Works>
a dev in my chat group just hit this foot gun
14:01
<Jack Works>
https://github.com/microsoft/TypeScript/pull/54056
14:02
<Jack Works>

the only correct way to inherit a class like this is to:

class T extends Parent {
    constructor() {
        super()
        const old = this.foo
        this.foo = () => old.call(this)
    }
}
14:02
<Jack Works>
looks like we have too much footgun with class fields
15:37
<bakkot>
that doesn't really look like a footgun to me
15:38
<bakkot>
or at least not a footgun with class fields
19:28
<ljharb>
indeed, that looks fine to me
19:29
<ljharb>

i'd probably do something like

class T extends Parent {
  #oldFoo = this.foo;
  foo = () => this.#oldFoo.call(this);
}

tho, to avoid a constructor