Microsoft/TypeScript

esmoduleinterop: Improve error message when calling static method on class

Open

#21,656 创建于 2018年2月6日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)TypeScript (48,455 star) (6,726 fork)batch import
Domain: Error MessagesHelp WantedSuggestion

描述

TypeScript Version: master

Code

b.d.ts:

declare class C { static m(): void }
declare namespace C {}
export = C;
import * as C from "./b";
C.m();

Expected behavior:

src/a.ts(1,1): error TS7038: A namespace-style import will import a module namespace object, not a class.
src/a.ts(2,3): error TS2339: Property 'm' does not exist on type 'typeof C'.

Actual behavior:

src/a.ts(2,3): error TS2339: Property 'm' does not exist on type 'typeof C'.

贡献者指南