facebook / facebook/flow

Warn if properties not initialized in constructor

Open
#650 10 comments 11 reactions 0 assignees View on GitHub
feature request
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

[Example](http://tryflow.org/#f53da3ebbf00a0e4165231d3d59c22ae):

``` es6
class C {
x: number;
y: number;
constructor() {
this.x = 0;
}
}

new C().y.toString(); // should produce error
```

I know this is complicated (what about derived classes? what if there is `this.initializeY()`?) but I don't think I've seen it being discussed on the issue tracker so far...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.