Checking initialization not working with module pattern literals
Open
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hi everyone,
I have the following simple code. Unfortunately flow doesn't recognize the initialization of the variable (I use nuclide and atom) inside the testMethod. So the last line complains "string - This type is incompatible with uninitialized variable" which is not correct because it is getting initialized in the testMethod before. This is a bug, isn't it?
Best,
Chris
```js
var Module = (function () {
var anotherMember : string;
var testMethod = function () {
anotherMember = "initialize123";
};
return {
testMethod: testMethod,
anotherMember: anotherMember
};
})();
Module.testMethod();
Module.anotherMember = "changeValue";
```
Contributor guide
Assessment
This issue has not been assessed yet.