Microsoft/TypeScript
Voir sur GitHubDefault type imported with `import type` from not-found module not flagged when used as a value
Open
#57 820 ouverte le 18 mars 2024
BugDomain: BinderHelp Wanted
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
Description
🔎 Search Terms
cannot be used as a value because it was imported using import type
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
💻 Code
import type T from
// @ts-expect-error
'mod';
const t = T;
import {type U} from
// @ts-expect-error
'mod';
const u = U;
🙁 Actual behavior
TS does not error on the usage of T.
TS errors on the usage of U with the error
'U' cannot be used as a value because it was imported using 'import type'.(1361)
🙂 Expected behavior
TS errors on the usage of T with the error
'T' cannot be used as a value because it was imported using 'import type'.(1361)
TS errors on the usage of U with the error
'U' cannot be used as a value because it was imported using 'import type'.(1361)
Additional information about the issue
No response