Closed as not planned
Closed as not planned
Description
π Search Terms
- verbatimModuleSyntax
- export default interface
π Version & Regression Information
- I can reproduce on v5.0.4 and the nightly version.
β― Playground Link
π» Code
export default interface I {}
π Actual behavior
The compiler allows export default interface I {}
with verbatimModuleSyntax
enabled.
π Expected behavior
When we try to export an interface separately with the definition and export default
syntax, the tsc
outputs an error.
interface I {}
export default I
An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but 'I' only refers to a type.
We can export an interface with export default interface I {...}
even if the exported name does not reference a value, it references an interface. I have no idea whether the tsc should output an error in that case since I cannot found such case in the test. I think it can either be an error or needs to update the error message.
Additional information about the issue
No response