microsoft / microsoft/TypeScript
JS should allow merging/expando properties on imports
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
// Filename: mod.js
export const Ns = function () { }
// @Filename: use.js
import { Ns } from './mod'
Ns.expando = 1
Expected behavior:
No error, and Ns has property 'expando'
Actual behavior:
Error, 'expando' not found on 'Ns'.
This merge shouldn't be allowed in Typescript, but it will work in Javascript, so it should be allowed there.
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
The issue provides a minimal mod.js/use.js reproduction but names no implementation files or tests. Start by running this example through the TypeScript checker and then trace the diagnostic for property access on the imported Ns binding. Done means JavaScript accepts the expando assignment while TypeScript continues rejecting the equivalent merge.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100