New Issue: internal error when using named argument

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:
CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: clang
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none *
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: none *
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version:
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • (For Cray systems only) Output of module list: