microsoft / microsoft/TypeScript
`export default interface` with two names should be an error
Open
Nobody has claimed this yet.
Bug
Domain: Binder
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
The following does not report an error:
export default interface A { a: string; }
export default interface B { b: string; }
and instead makes both names refer to the merged interface.
Sidenote: if this does not become an error for whatever reason, then this should be made to work too:
export default interface A { a: string; }
export default interface B { b: string; }
declare var xa: A;
declare var xb: B;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the two export-default interface declarations shown in the report and inspect the TypeScript compiler's handling of duplicate default interface names. Done means the reported case produces an error, or, if that behavior is rejected, the sidenote declarations preserve distinct A and B references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100