Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upComplier fails to recognize imported module. #906
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Sep 3, 2017
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Sep 3, 2017
|
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Sep 3, 2017
Member
When you say exposing (X) you are only exposing the type, not the constructors. You must say exposing (X(..)) to reveal the constructors as well. This allows you to hide details if you want, and it is very important to creating strong abstractions. I recommend asking around on Slack for further details.
So there is no bug here, but that is certainly a weird error message. This is a good candidate for https://github.com/elm-lang/error-message-catalog/issues Can you put it there?
|
When you say So there is no bug here, but that is certainly a weird error message. This is a good candidate for https://github.com/elm-lang/error-message-catalog/issues Can you put it there? |
evancz
closed this
Sep 3, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
martian57
Oct 4, 2017
I am new to elm. Exposing the constructors work, but a slight modification to the code cause the compiler to fail:
X.elm:
module X exposing (XType(..))
type XType
= X1 Int
Y.elm:
module Y exposing (..)
import X
type Thing
= A X.XType
thingToString : Thing -> String
thingToString thing =
case thing of
A (X.XType int) ->
"A X int"
results in
Cannot find pattern `X.XType`.
13| A (X.XType int) ->
^^^^^^^^^^^
`X` does not expose `XType`.
martian57
commented
Oct 4, 2017
|
I am new to elm. Exposing the constructors work, but a slight modification to the code cause the compiler to fail: X.elm:
Y.elm:
results in
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Try replacing |
z5h commentedSep 3, 2017
X.elm
Y.elm
Error is on 2nd use of
X.Xin Y.elm: