error-message-catalog icon indicating copy to clipboard operation
error-message-catalog copied to clipboard

Disallow Type(..) in imports when no tags exported

Open mgold opened this issue 9 years ago • 2 comments

Not an error, but a lack of one.

module Definitions (Action) where

type Action = Increment | Decrement

In another file,

import Definitions exposing (Action(..))

x = "dummy definition"

The compiler fails to tell me that none of Action's tags are exported, so the (..) doesn't import anything. It's harmless as it is, but would be a nice error message.

mgold avatar Feb 22 '16 23:02 mgold

Also, might be nice when the tags/constructors are not exported to get a hint that that might be the case rather than just a I cannot find a [enum tag] variant. Since the compiler probably has no idea that's why something is missing, a hint about the fact that types must be exported and imported with exposing EnumName(..) would be useful, especially since even the linked page Hint: Read <[https://elm-lang.org/0.19.1/imports](https://elm-lang.org/0.19.1/imports)> to see how import declarations work in Elm. and the docs both don't seem to mention this somehow.

heyakyra avatar Sep 03 '22 04:09 heyakyra