Overrides of methods with variadic arguments are never called. Parent's method is invoked, instead.
Source Code:
class Parent {
proc foo(elts: int ... ?nElts) {
writeln("Parent");
for e in elts do writeln(e);
}
}
class Child: Parent {
proc foo(elts: int ... ?nElts) {
writeln("Child");
for e in elts do writeln(e);
}
}
var p: Parent;
p = new Child();
p.foo(1); // prints out "Parent"
Compile command:
chpl foo.chpl
Execution command:
./foo
Associated Future Test(s):
Not yet.
chpl --version:chpl Version 1.15.0.5260a416af
ping @lydia-duncan
Thanks for reporting!
@mppf and I agree this is a gating issue due to blocking #7768 and #8488, with no great work-arounds available.
Thanks, everybody.
In fact, I realized that the problem is really the overriding variadic methods. It is making things difficult to abstract.
If possible, add this in to do list. I really appreciate.
This issue should now be fixed in master as of https://github.com/chapel-lang/chapel/pull/9018. Thanks for reporting it!