Microsoft/TypeScript
GitHub ã§èŠãDefault type imported with `import type` from not-found module not flagged when used as a value
Open
#57,820 opened on 2024幎3æ18æ¥
BugDomain: BinderHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð 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