Open dnalborczyk opened 3 years ago
private, super
v4.3.2, also tested with nightly in playground
works with ESNext setting (which just strips out the types), Babel, V8
https://www.typescriptlang.org/play?ts=4.3.2#code/MYGwhgzhAECC3QN4CgEIC4FMLoBQEolU0SAnTdAV1IDtoByLHe4hAX2Q+VEhgCFomAB5YaAExjwUJAMQAzAPYKCREmQrU6ESgAdMpAHRM8+VtC4kARmFIrpahOSq1o6ABYBLCAflKCZji5gBRocaEtoAF5oGkwAd2g+AgNrW1NuEIgFEEwDEAUAc1xLfCA
class A { test() { return 'test' } } class B extends A { #foo() { return super.test() } bar() { return this.#foo() } } const b = new B().bar() console.log(b) // [ERR]: "Executed JavaScript Failed:" // [ERR]: 'super' keyword unexpected here
throws error
prints 'test'
It also seems to be working with target set to ES2022.
target
ES2022
because there is no down leveling, just the types are being removed.
Bug Report
🔎 Search Terms
private, super
🕗 Version & Regression Information
v4.3.2, also tested with nightly in playground
works with ESNext setting (which just strips out the types), Babel, V8
⏯ Playground Link
https://www.typescriptlang.org/play?ts=4.3.2#code/MYGwhgzhAECC3QN4CgEIC4FMLoBQEolU0SAnTdAV1IDtoByLHe4hAX2Q+VEhgCFomAB5YaAExjwUJAMQAzAPYKCREmQrU6ESgAdMpAHRM8+VtC4kARmFIrpahOSq1o6ABYBLCAflKCZji5gBRocaEtoAF5oGkwAd2g+AgNrW1NuEIgFEEwDEAUAc1xLfCA
💻 Code
🙁 Actual behavior
throws error
🙂 Expected behavior
prints 'test'