microsoft / microsoft/TypeScript
TS:1379 An import alias cannot reference a declaration that was exported using 'export type'
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Bug Report
🔎 Search Terms
TS1379
An import alias cannot reference a declaration that was exported using 'export type'
🕗 Version & Regression Information
This has always been the behavior as far as I can tell (edit: tested on all versions listed in playground back to >3.7.5 (changed to export type {...} statement when needed))
⏯ Playground Link
Multi file: repro but I will show in playground.
Below are pictures that might be easier to parse
💻 Code
When annotated with type it errors
When not annotated with type it doesn't error:
🙁 Actual behavior
Exports of types annotated with type error while those not annotated as types do not error even though TS understand it is still a type.
🙂 Expected behavior
Honestly I don't know which of these behaviors is correct - this behavior could be completely intentional as well - intuitively I think these should match and I prefer the behavior with no errors but it is unclear to me if this is an emit issue? I'm sorry if this behavior is on purpose and I have wasted your time. Really appreciate the work!
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der verlinkten mehrteiligen TypeScript Playground-Reproduktion und vergleiche die annotierten und nicht annotierten import-alias-Fälle, die TS1379 erzeugen. Bestimme zunächst, ob die unterschiedlichen Diagnosen beabsichtigt sind oder auf einen Emit-/Type-Checking-Fehler zurückzuführen sind; abgeschlossen ist die Untersuchung, wenn das erwartete Verhalten festgelegt und durch einen geeigneten Regressionstest abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100