microsoft / microsoft/TypeScript
Bad error when using `import()` type within JSDoc tag `@implements`
Aperta
@sandersn ci sta già lavorando.
Dal 17/6/2024.
Bug
Domain: JSDoc
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 Search Terms
import@implements2304
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about the JSDoc tag
@implements
⏯ Playground Link
💻 Code
/** @implements {import("a").B} */
class A {}
🙁 Actual behavior
Two TypeScript errors:
Cannot find name 'import'.(2304)'}' expected.(2304)
🙂 Expected behavior
TypeScript should allow using import() types within the type of the JSDoc tag @implements.
Additional information about the issue
A workaround is to use a JSDoc @typedef to import the type under an alias, and then use that alias within the JSDoc tag @implements type, e.g:
/** @typedef {import("a").B} B */
/** @implements {B} */
class A {}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.