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

[Bug]: problem accessing a nested record from outside the record #25801

Open
mppf opened this issue Aug 23, 2024 · 0 comments
Open

[Bug]: problem accessing a nested record from outside the record #25801

mppf opened this issue Aug 23, 2024 · 0 comments

Comments

@mppf
Copy link
Member

mppf commented Aug 23, 2024

Summary of Problem

Description:
It does not seem possible to access a nested record from outside of a record. I would expect this is possible with e.g. A.B. For example:

record A {
  record B {
  }
}

type t = A.B;
error: unresolved call 'type A.B'
note: because no functions named B found in scope

Here is a related program that shows a workaround that compiles today on production but where the dyno scope resolver does not handle it correctly:

```chapel
module Lib {
  record A {
    record B {
      proc foo() { }
    }
    proc type getB type { return B; } // workaround for A.B not resolving
  }
  proc (A.getB).bar() { }
  proc makeit() {
    type t = A.getB;
    return new t();
  }
}

module Main {
  import Lib.makeit;

  proc main() {
    var x = makeit();
    x.foo();
    x.bar();
  }
}

Is this issue currently blocking your progress?
No, I only ran into this when thinking about the implementation

Associated Future Test(s):
TODO

@mppf mppf added the type: Bug label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant