TypeScript/tests/baselines/reference/validUseOfThisInSuper.symbols
2015-04-15 16:44:20 -07:00

20 lines
786 B
Plaintext

=== tests/cases/compiler/validUseOfThisInSuper.ts ===
class Base {
>Base : Symbol(Base, Decl(validUseOfThisInSuper.ts, 0, 0))
constructor(public b: Base) {
>b : Symbol(b, Decl(validUseOfThisInSuper.ts, 1, 16))
>Base : Symbol(Base, Decl(validUseOfThisInSuper.ts, 0, 0))
}
}
class Super extends Base {
>Super : Symbol(Super, Decl(validUseOfThisInSuper.ts, 3, 1))
>Base : Symbol(Base, Decl(validUseOfThisInSuper.ts, 0, 0))
constructor() {
super((() => this)()); // ok since this is not the case: The constructor declares parameter properties or the containing class declares instance member variables with initializers.
>super : Symbol(Base, Decl(validUseOfThisInSuper.ts, 0, 0))
>this : Symbol(Super, Decl(validUseOfThisInSuper.ts, 3, 1))
}
}