Microsoft/TypeScript
在 GitHub 查看Default type imported with `import type` from not-found module not flagged when used as a value
Open
#57,820 创建于 2024年3月18日
BugDomain: BinderHelp Wanted
仓库指标
- Star
- (48,455 star)
- PR 合并指标
- (平均合并 6天 17小时) (30 天内合并 9 个 PR)
描述
🔎 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