Skip to content

Trying to use non-exposed constructors #355

@Janiczek

Description

@Janiczek
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions