facebook / facebook/flow

`import type Foo...` is not semantically equivalent to `import type * as Foo...`

Open
#4,197 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

The changelog announced that `import type * as Foo...` was deprecated in favor of `import type Foo...` way back when (https://github.com/facebook/flow/blob/master/Changelog.md#v0190). [This repo](https://github.com/popham/import_type), however, demonstrates that the use case is broken:

```
consumer.js:5
5: var a: node.a = 1;
^^^^^^ a. Property not found in
exports. See: node.js:0

consumer.js:6
6: var b: node.b = 2;
^^^^^^ b. Property not found in
exports. See: node.js:0

Found 2 errors
```

The documentation doesn't mention the use case and I don't see any tests memorializing it. Is support intended for this use case? (Besides the changelog, I noticed a trace over at https://stackoverflow.com/questions/32602957/how-do-you-export-a-flow-type-definition-that-is-imported-from-another-file#comment-53297391).

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.