20373, "jhh67", "internal error when using named argument", "2022-08-03T20:39:42Z"
Summary of Problem
I got the following error
examples/baz.chpl:12: In method 'encode':
examples/baz.chpl:13: internal error: RES-ADD-LLS-0805 chpl version 1.28.0 pre-release (0085fba89a)
Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
and we're sorry for the hassle. We would appreciate your reporting this bug --
please see https://chapel-lang.org/bugs.html for instructions. In the meantime,
the filename + line number above may be useful in working around the issue.
examples/baz.chpl:18: called as Foo.encode(key: nothing, value: int(64))
note: generic instantiations are underlined in the above callstack
Steps to Reproduce
Source Code:
class Encoder {
// Encodes something, with optional key
proc encode(ch:Foo, key:?t = none, x) : void throws {writeln("base");}
}
class DefaultEncoder: Encoder {
override proc encode(ch:Foo, key:?t = none, x) : void throws { writeln("default");}
}
record Foo {
var encoder: owned Encoder = new DefaultEncoder();
proc encode(key:?t = none, value) {
this.encoder.encode(this, key, value);
}
}
var foo = new Foo();
foo.encode(value=42);
Compile command: chpl baz.chpl
Execution command: ./baz
Associated Future Test(s):
Configuration Information
Output of chpl --version:
chpl version 1.28.0 pre-release (0085fba89a)
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
Output of $CHPL_HOME/util/printchplenv --anonymize: