chapel icon indicating copy to clipboard operation
chapel copied to clipboard

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

Open mppf opened this issue 6 months ago • 0 comments

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 avatar Aug 23 '24 14:08 mppf