opaque flow string type dropped in for-in loop
Open
Typing: opaque types
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Can't reproduce with try flow because I need an import :(
##### file1.js
```js
export opaque type T: string = string;
```
##### file2.js
```js
import type { T } from 'file1';
class Foo {
things: { [T]: string };
method() {
for (const key in this.things) {
this.things[key]; // Error: [flow] string (This type is incompatible with T)
}
}
```
I'd expect the key type to carry through since it's compatible with `string`. I could cast it back to type `T` via an exported function in `file1.js`, but that seems unnecessary.
Contributor guide
Assessment
This issue has not been assessed yet.