elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

importing an empty module #256

Open tinybeachthor opened 6 years ago

tinybeachthor commented 6 years ago

If an empty module is imported, the following error is displayed (from elm-make)

-- ./Model/Square.elm
module Square exposing (..)
-- SYNTAX PROBLEM ------------------------------------------- ./Model/Square.elm

I ran into something unexpected when parsing your code!

I am looking for one of the following things:

    "{-|"
    a definition or type annotation
    a port declaration
    a type declaration
    an import
    an infix declaration
    whitespace

Detected errors in 1 module.

This is a bit unexpected, especially when refactoring code into multiple files, this can lead to some confusion.

It probably should not be an error, a warning would be enough (importing an empty module). Or, at least a better explanation of the error (detected an empty module, add definitions to resolve).

I am proposing to change this to something like this:

-- SYNTAX WARNING ------------------------------------------- ./Model/Square.elm

I have found an empty module when parsing your code!

Check if you have remembered to save all files.
Check if you are including all the needed definitions.
Possibly remove the module, if not needed.

Detected warnings in 1 module.

elm --version 0.18.0