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
Passing a class instance to an explicit-ref formal in an overridden method causes a type mismatch in the back-end C compiler.
This behavior occurs when the argument is a local instance or a field.
Only occurs with CHPL_COMM!=none. In other words, with --local it compiles fine.
Steps to Reproduce
Source Code:
class SuperPrinter {
//for faulty behavior this formal must have an explicit ref intentprocprint(ref data) {
writeln("SuperPrinter: ", data.x);
}
}
class SubPrinter : SuperPrinter {
procprint(ref data) {
writeln("Subprinter: ", data.x);
}
}
class Foo { var x =10; }
proc main() {
var printer: SuperPrinter;
printer =new SubPrinter();
var data =new Foo();
printer.print(data);
}
Compile command: chpl foo.chpl
Configuration Information
Output of chpl --version:
chpl Version 1.16.0 pre-release (64add955ac)
Output of $CHPL_HOME/util/printchplenv --anonymize:
Summary of Problem
Passing a class instance to an explicit-ref formal in an overridden method causes a type mismatch in the back-end C compiler.
--local
it compiles fine.Steps to Reproduce
Source Code:
Compile command:
chpl foo.chpl
Configuration Information
chpl --version
:$CHPL_HOME/util/printchplenv --anonymize
:gcc --version
orclang --version
:The text was updated successfully, but these errors were encountered: