microsoft / microsoft/TypeScript
"Generic type ' Example' requires 1 type argument(s)." ts(2314) not thrown in .d.ts file
Open
Nobody has claimed this yet.
Bug
Domain: Something Else
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Bug Report
🔎 Search Terms
- generic type
- ts 2314
- .d.ts
🕗 Version & Regression Information
- Versions I tried: I tried
3.3.3,4.1.3and4.3.0-dev.20210216.
⏯ Playground Link
(Repo is small. TypeScript is the only dependency.)
💻 Code
export type Example = {
_links: Links<>; // throws error in a .ts file, but not a .d.ts file
};
🙁 Actual behavior
No error thrown.
🙂 Expected behavior
Throw "Generic type ' Example' requires 1 type argument(s)." ts(2314).
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 with the linked d-ts-bug-demo repository and reproduce the difference between the .ts and .d.ts examples using the reported TypeScript versions. Trace how the compiler handles the generic reference in declaration files, then verify that the expected ts(2314) diagnostic is produced without changing the valid .ts behavior.
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