TypeScript/tests/cases/compiler/recursiveFieldSetting.ts
Eli Barzilay 4942fd2b84 Make checkPropertyNotUsedBeforeDeclaration ignore properties of properties
Use `isAccessExpression` to cover both `PropertyAccess` and
`ElementAccess`.  Also use it in a few other places that used both
explicitly.  (And also fix a random weird formatting.)

Fixes #32721.
2020-01-02 16:38:54 -05:00

18 lines
345 B
TypeScript

// #32721
class Recursive1 {
constructor(private readonly parent?: Recursive1) {}
private depth: number = this.parent ? this.parent.depth + 1 : 0;
}
class Recursive2 {
parent!: Recursive2;
depth: number = this.parent.depth;
}
class Recursive3 {
parent!: Recursive3;
depth: number = this.parent.alpha;
alpha = 0;
}