-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current behavior
Type annotations containing named imports are incorrectly transformed to MemberExpressions and cause a validation error: Property typeName of TSTypeReference expected node to be of a type ["TSEntityName"] but instead got "MemberExpression". See Babel repl.
This seems to be due to this line in helper-module-transforms, which rewrites any ReferencedIdentifier to a MemberExpression; but type annotations may contain Identifiers and be matched by ReferencedIdentifier.
Input Code
import { Foo } from './foo'
function bar(foo: Foo) { }Expected behavior
Type annotations are transformed correctly, or (if this module is not intended to be used with type annotations) flagged with a clear error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue