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

Can't directly access nested records from another module #543

Closed
Ryan1729 opened this Issue Mar 30, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@Ryan1729

Ryan1729 commented Mar 30, 2016

Given the following files:

Main.elm

module Main (..) where

import Graphics.Element exposing (..)
import A


main : Element
main =
  show A.b.c

A.elm

module A (..) where


b =
  { c = "123" }

I get the following error


Detected errors in 1 module.
-- NAMING ERROR ------------------------------------------------------- Main.elm

Cannot find variable `A.b.c`.

9│   show A.b.c
            ^^^
The qualifier `A.b` is not in scope. Maybe you want one of the following?

    A.c

Changing it to A.b shows the whole record { c = "123" } as expected.
If I give A.b another name, say d = A.b then d.b gives the expected output, so I can use that as a workaround but not being able to access the record's value was unexpected.

Running 0.16.0 through elm reactor.

@Ryan1729 Ryan1729 changed the title from Can't access nested records from another module to Can't directly access nested records from another module Mar 30, 2016

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 30, 2016

Contributor

Thanks for the report. It's not a core issue, but an elm-compiler issue. And it's already tracked there: elm/compiler#520

So I'm closing this issue here.

Contributor

jvoigtlaender commented Mar 30, 2016

Thanks for the report. It's not a core issue, but an elm-compiler issue. And it's already tracked there: elm/compiler#520

So I'm closing this issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment