Chapel: Overriding methods with variadic arguments

Created on 3 Aug 2017  路  5Comments  路  Source: chapel-lang/chapel

Summary of Problem

Overrides of methods with variadic arguments are never called. Parent's method is invoked, instead.

Steps to Reproduce

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.

Configuration Information

  • Output of chpl --version:
chpl Version 1.15.0.5260a416af
Compiler gating issue Bug user issue

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings