Closed stormont closed 8 years ago
You mean you tried to compile such a source?
module Main where
import App
import StartApp.Simple
-- EOF here --
Actually, a module can be compiled without main
declaration.
So, it might be good to hint that a module must have one or more type or value definition.
Yes, a module needs to define at least one thing. It would be good to have a better error message, but the current one isn't terrible: it's looking for you to define or declare some things.
Yes, sorry, I didn't explain this as well as I could have (I was kind of tired when I wrote this up). I'm really just asking for a more helpful error message. I had done something just like @igrep asked about to generate the error (just module declaration + imports).
Can we move this to https://github.com/elm-lang/error-message-catalog/issues where we track "bad error messages" such that it's easy to see connections and categories of things to improve?
When it is moved, please look around for similar things. If you don't see anything, be sure to put a http://sscce.org in the initial description. If we have the exact source code you used to get that error, it'll be much easier to fix the thing you saw. No chance of confusion!
I was running through the elm-architecture example with core 0.16 and I ran into a situation where I was compiling without a "main" function defined (intentionally; I was trying to catch other compile errors). But, the output I got wouldn't provide much guidance to someone with expectations of a full compile:
I know that elm-make allows more distinct module-level compilations, but in this case, I was using the default options, which will assume a "main" function (or, presumably, some combination of other declarations, as reported by the output).
It might be helpful to suggest "Did you forget to create a
main
declaration?" or something of that sort.