Closed
Description
Bug Report
π Search Terms
private field, decorators, broken emit
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about decorators
β― Playground Link
Playground link with relevant code
π» Code
function makeDecorator(fn: (...args: any[]) => any) {
return function decorateClass<C extends new (...args: any[]) => any>(
klass: C,
ctx: ClassDecoratorContext,
) {
// The implementation of this doesn't matter
}
}
@makeDecorator(x => x.#foo)
class Foo {
#foo: number = 3;
}
π Actual behavior
The generated code is syntatically incorrect with the error:
Unexpected token ')'
This happens on the line, basically nothing is emitted after the x.
:
let _classDecorators = [makeDecorator(x => x.)];
π Expected behavior
Functioning code should be emitted.