Microsoft/TypeScript

Line break in module declaration causes compile time error

Open

#11 167 ouverte le 27 sept. 2016

Voir sur GitHub
 (5 commentaires) (0 réactions) (0 assignés)TypeScript (6 726 forks)batch import
BugDomain: ParserHelp Wanted

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

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.

Guide contributeur