Skip to content

Dyno: promote methods#27579

Merged
DanilaFe merged 5 commits intochapel-lang:mainfrom
DanilaFe:promote-methods
Aug 5, 2025
Merged

Dyno: promote methods#27579
DanilaFe merged 5 commits intochapel-lang:mainfrom
DanilaFe:promote-methods

Conversation

@DanilaFe
Copy link
Contributor

@DanilaFe DanilaFe commented Jul 31, 2025

Closes https://github.com/Cray/chapel-private/issues/7401.

Specifically, this PR properly handles calls to methods that are the scalar type" of another type. E.g., this makes it possible to invoke a method on each element of an array or records/classes. Sample code from #7401:

record R {
  proc helper() {
    return 5;
  }
}

proc main() {
  var A : [1..10] R;
  var B = A.helper();
}

Testing

  • dyno tests
  • code in cray/chapel-private#7401 works
  • types/atomic/sungeun/atomic_vars compiles with --dyno-resolve-only -comp-only
  • paratest --dyno-resolve-only
  • paratest

Reviewed by @benharsh -- thanks!

Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Vaguely, this prevents infinite recursion (see comment in commit). More
specifically, the recursion is also addressed by an `isQueryRunning`,
but `isQuerryRunning` literally poisons memoized queries, so
this workaround effectively avoids computing / caching its result.

Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
// This dependency is technically broken anyway by uses of isQueryRunning,
// but I'm keeping this workaround since isQueryRunning technically violates
// the "no side effects" rule of queries, so the fewer queries end up
// invoking it, the better. -D.F.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@DanilaFe DanilaFe merged commit 73d5e2c into chapel-lang:main Aug 5, 2025
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants