You misunderstand. The error message that I listed is fine, which is given 
when the file name is "Main.elm" and the module name is "xMain". The 
problem that I am documenting here is that when the file name is "Main.elm" 
and the module name is "NotMain", *no* error is given by the compiler. The 
module name should be forced to be "Main".

On Tuesday, August 2, 2016 at 3:09:02 PM UTC-5, Joey Eremondi wrote:
>
> I'm not sure that the problem is that the filename doesn't match the 
> module name, but that the module name needs to start with a capital letter.
>
> That's why it's a syntax error: the parser is looking for a capitalized 
> word, and it's not seeing one.
>
> Certainly the message could be more clear and better documented.
>
> On Tue, Aug 2, 2016 at 12:50 PM, John Bugner <[email protected] 
> <javascript:>> wrote:
>
>> I'm running Elm 0.17.1, and the compiler doesn't care whether the *name 
>> given in the module declaration* of the module being compiled (with either 
>> elm-make or elm-reactor) matches the *file name*.
>>
>> However, the compiler *does* catch if the name in the module declaration 
>> doesn't start with a capital letter, as seen below:
>>
>> -- SYNTAX PROBLEM ------------------------------------------------- 
>> src\Main.elm
>>
>> I ran into something unexpected when parsing your code!
>>
>> 1| module xNotMain exposing (..)
>>           ^
>> I am looking for one of the following things:
>>
>>     the name of this module
>>     whitespace
>>
>>
>> But, if I turn `xNotMain` into `NotMain`, then the compiler succeeds, and 
>> the program works as intended, despite the name in the module declaration 
>> still not matching the file name. Note, however, that any imported modules 
>> *are* checked!, but *not* the "base" file itself.
>>
>> Where should I submit this error? 
>> github.com/elm-lang/error-message-catalog/issues ?. Technically it is 
>> not an error message, but the lack of one.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to