-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallycheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone

Description
TypeScript Version: 3.1.0-dev.20180807
Code
a.js
class A {
constructor() {
this.initializer = 2;
}
}
class B extends A {
constructor() {
super();
this.initializer = this.initializer + 1;
}
}
Expected behavior:
No error.
Actual behavior:
src/a.js:10:9 - error TS7022: 'initializer' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
10 this.initializer = this.initializer + 1;
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallycheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript