Microsoft/TypeScript

Line break in module declaration causes compile time error

開放

#11,167 建立於 2016年9月27日

 (5 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
BugDomain: ParserHelp Wanted

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

TypeScript Version: 2.0.3

A line break in the declaration of a module causes a compile time error. This could either be that the language specification isn't clear that this is illegal or a bug.

Code

// Example declaration with line break
declare module 
     my.very.long.name.foo.bar.baz.able.baker {}

Expected behavior: I don't see anything in the language specification that would make this a compile time error, so I would expect the statement to work as if declaration was all on one line, ie:

// Example declaration with line break
declare module my.very.long.name.foo.bar.baz.able.baker {}

Actual behavior:

A compile time error, in particular: (1, 9): error TS1005: ';' expected.

貢獻者指南