swc/crates/swc_ecma_parser/tests/tsc/readonlyInConstructorParameters.ts

13 lines
197 B
TypeScript

class C {
constructor(readonly x: number) {}
}
new C(1).x = 2;
class E {
constructor(readonly public x: number) {}
}
class F {
constructor(private readonly x: number) {}
}
new F(1).x;