Microsoft/TypeScript

esmoduleinterop: Improve error message when calling static method on class

オープン

#21,656 opened on 2018/02/06

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Domain: Error MessagesHelp WantedSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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'.

コントリビューターガイド