Closed
Description
Bug Report
π Search Terms
strictPropertyInitialization bracketed class property
π Version & Regression Information
Typescript 4.7.3, 4.7.2
β― Playground Link
Playground link with relevant code
π» Code
enum A {
A = 'A',
B = 'B'
}
class B {
[A.A]: string;
constructor() {
this[A.A] = '1';
this.A = '1';
this['A'] = '1';
}
}
π Actual behavior
Compilation error:
Error: Property '[A.A]' has no initializer and is not definitely assigned in the constructor.
π Expected behavior
Seems it should be compiled without errors.