Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to use non-exposed constructors #355

Open
Janiczek opened this issue Nov 8, 2022 · 0 comments
Open

Trying to use non-exposed constructors #355

Janiczek opened this issue Nov 8, 2022 · 0 comments

Comments

@Janiczek
Copy link

Janiczek commented Nov 8, 2022

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant