-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingHelp WantedYou can do thisYou can do this
Milestone

Description
TypeScript Version: nightly (2.3.0-dev.20170417)
Code
function f() {}
Expected behavior:
No error, or an error message about a non-module file in an --isolatedModules
project.
Actual behavior:
src/a.ts(1,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
This occurs because we in program.ts
verifyCompilerOptions
to look for any source file that isn't an external module declaration, and fail on the first one, whatever it may be.
The error message should be upgraded to reflect the real reason we issue this error, and not mention namespaces.
Alternately, we could just allow files without imports and actually look for a namespace before adding this error.
haiyamicode, sripberger, AgentChris, Macil, shaunluttin and 25 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingHelp WantedYou can do thisYou can do this