TypeScript/tests/baselines/reference/jsFileClassSelfReferencedProperty.types
Anders Hejlsberg 3919042c7f
Control flow for constructor initialized properties (#37920)
* Use CFA to determine types of properties declared by this.xxx assignments

* Accept new baselines

* Also use CFA in constructor functions

* Accept new baselines

* Fix lint error

* Only widen fresh literal types in CFA of assignment to auto-typed

* Auto-typing for declared properties with no type annotation or initializer

* Add optionality if declaration includes '?' modifier

* Always use CFA for properties with no initializer in .js files

* Small fix
2020-04-28 16:59:03 -07:00

21 lines
539 B
Plaintext

=== tests/cases/compiler/foo.js ===
export class StackOverflowTest {
>StackOverflowTest : StackOverflowTest
constructor () {
this.testStackOverflow = this.testStackOverflow.bind(this)
>this.testStackOverflow = this.testStackOverflow.bind(this) : error
>this.testStackOverflow : any
>this : this
>testStackOverflow : any
>this.testStackOverflow.bind(this) : error
>this.testStackOverflow.bind : error
>this.testStackOverflow : undefined
>this : this
>testStackOverflow : undefined
>bind : any
>this : this
}
}