ImportSpecifier.propertyName should allow string literals #49147
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
Bug Report
π Search Terms
import specifier, property name, ModuleExportName, named import
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Parser error
π Expected behavior
This should be parsed as valid code and properly type-checked. According to ES spec,
ImportSpecifier
can beModuleExportName as ImportedBinding
, whereModuleExportName
includesStringLiteral
.Babel parses this correctly.
Accordingly, this should be also allowed:
The text was updated successfully, but these errors were encountered: