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

Reference to Module.record.field is treated as reference to field in module Module.record. #1555

Closed
marick opened this issue Jan 13, 2017 · 4 comments

Comments

@marick
Copy link

marick commented Jan 13, 2017

Given Module.elm containing this:

-- ...
nameFilterLens =
  { get = .nameFilter
  , set = \ p w -> { w | nameFilter = p }
  }

... and Update.elm containing this:

import Model as Model exposing (Model)

useLens : Model -> String
useLens model =
  Model.nameFilterLens.get model      --- <<< THIS LINE FAILS TO COMPILE

... I get this compiler message:

790 $ elm-make Update.elm
-- NAMING ERROR ----------------------------------------------------- Update.elm

Cannot find variable `Model.nameFilterLens.get`.

7|   Model.nameFilterLens.get model
           ^^^^^^^^^^^^^^^^^^
No module called `Model.nameFilterLens` has been imported. 

I was hoping that, since nameFilterLens is not capitalized, it wouldn't be taken as being part of a module name.

Full source is attached, with .elm extension changed to .txt to make Github happy.

Elm version is elm-make 0.18 (Elm Platform 0.18.0). OSX El Capitan 10.11.6

Model.txt
Update.txt

@process-bot
Copy link

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.

@jvoigtlaender
Copy link
Contributor

Duplicate of #1549, isn't it?

@marick
Copy link
Author

marick commented Jan 14, 2017

Yes, I think. Sorry. Should I close?

@jvoigtlaender
Copy link
Contributor

Yes, I think so.

@marick marick closed this as completed Jan 17, 2017
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

3 participants