Skip to content

import type Foo... is not semantically equivalent to import type * as Foo... #4197

@popham

Description

@popham

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, 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions