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

Trying to use non-exposed constructors

Open Janiczek opened this issue 3 years ago • 0 comments

module File1 exposing (CustomType)


type CustomType
  = Foo
  | Bar
module File2 exposing (usage)

import File1 exposing (CustomType(..))


usage =
    Foo

This will currently get you:

-- NAMING ERROR -------------------------------------------------- src/File2.elm

I cannot find a `Foo` variant:

7|     Foo
       ^^^
These names seem close though:

    Ok
    EQ
    Err
    GT

Hint: Read <https://elm-lang.org/0.19.1/imports> to see how `import`
declarations work in Elm.

while it could give you something like

-- IMPORT ERROR -------------------------------------------------- src/File2.elm

You're trying to import the constructors of the `CustomType` type:

3| import File1 exposing (CustomType(..))
                                    ^^^^

The module File1 doesn't expose them though.

Janiczek avatar Nov 08 '22 21:11 Janiczek