elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

[0.18] Having a dot in type name will compile but crash at runtime #135

Closed pauldijou closed 7 years ago

pauldijou commented 7 years ago

Writing the following code type Toto = Tata.Titi will compile just fine but will crash at runtime with the following error:

var _user$project$Server$Tata.Titi = {ctor: 'Tata.Titi'};
                             ^
SyntaxError: Unexpected token .
    at Object.exports.runInThisContext (vm.js:78:16)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (...)
    at Module._compile (module.js:571:32)

Might need to fail compilation or escape the dot. Maybe related to https://github.com/elm-lang/elm-make/issues/106

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

evancz commented 7 years ago

Duplicate of https://github.com/elm-lang/elm-compiler/issues/1200, which was fixed recently. Thanks for the report!