Forwarding const methods does not work. Trying to do so generates the message:
foo.chpl:11: In function 'main':
foo.chpl:13: error: unresolved call 'Foo.whatever()'
foo.chpl:6: note: this candidate did not match: Bar.const whatever()
foo.chpl:13: note: because method call receiver with type 'Foo'
foo.chpl:6: note: is passed to formal 'const this: borrowed Bar'
Defining an overriding method on the outer type only works if you exclude the inner
type's method when forwarding, but it does work then. Still, it seems like const
methods should get brought in in such a way that they work.
Steps to Reproduce
Source Code:
record Foo {
forwarding var b: shared Bar?;
}
class Bar {
proc const whatever() {
return 16;
}
}
proc main() {
var f = new Foo();
writeln(f.whatever());
}