You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
The language allows nested functions and methods, and also allows field access with implicit this.. However, the combination of these is not working.
At present, it looks like the dyno resolver / scope resolver is handling this correctly, but some later stage of compilation is not handling this pattern.
Is this issue currently blocking your progress?
No, I came across this issue when working on PR #25878.
Steps to Reproduce
Source Code:
module DefinesX {
record X {
var field:real;
var x:real;
}
}
module DefinesY {
record Y {
var field:int;
var y:int;
}
}
module Main {
use DefinesX;
use DefinesY;
procX.outer() {
procY.inner() {
x; // should refer to X.x, via the outer method
field; // should refer to Y.field, via the inner method
}
(new Y()).inner(); // call inner() to make sure it is resolved
x; // should refer to X.x//y; // should not resolve
field; // should refer to X.field
}
procmain() {
(new X()).outer(); // call outer() to make sure it is resolved
}
}
nested-method-implicit-field-access.chpl:19: In method 'outer':
nested-method-implicit-field-access.chpl:21: error: unresolved call 'Y.x'
nested-method-implicit-field-access.chpl:4: note: this candidate did not match: X.x
nested-method-implicit-field-access.chpl:21: note: because method call receiver with type 'Y'
nested-method-implicit-field-access.chpl:4: note: is passed to formal 'ref this: X'
In Chapel 2.1 the error was different:
nested-method-implicit-field-access.chpl:21: error: Illegal use of identifier 'x' from enclosing type
Note: This source location is a guess.
Summary of Problem
Description:
The language allows nested functions and methods, and also allows field access with implicit
this.
. However, the combination of these is not working.At present, it looks like the dyno resolver / scope resolver is handling this correctly, but some later stage of compilation is not handling this pattern.
Is this issue currently blocking your progress?
No, I came across this issue when working on PR #25878.
Steps to Reproduce
Source Code:
In Chapel 2.1 the error was different:
Associated Future Test(s):
test/classes/methods/nested-method-implicit-field-access.chpl
#26089The text was updated successfully, but these errors were encountered: