20010, "brandon-neth", "Compilation fails for class definition within procedure", "2022-06-15T16:56:33Z"
Summary of Problem
Compilation fails with an internal error when a procedure contains a class definition, but only when the procedure has arguments.
This issue shows using version 1.26.0, but it also fails using the main branch version.
Steps to Reproduce
Source Code:
proc broken(ref param1) {
class InnerClass1 {}
var obj0 = new InnerClass1();
}
proc not_broken() {
class InnerClass1 {}
var obj0 = new InnerClass1();
}
proc also_broken(param1) {
class InnerClass1 {}
var obj0 = new InnerClass1();
}
proc main() {
var arg1 = 0;
//broken(arg1); //uncommenting this line breaks
not_broken();
//also_broken(arg1); //this one also breaks
}
Compile command:
chpl minimal.chpl
Execution command:
None, breaks on compile
Configuration Information
- Output of
chpl --version
:
chpl version 1.26.0
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: fifo *
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: cstdlib *
CHPL_ATOMICS: cstdlib
CHPL_GMP: none *
CHPL_HWLOC: none
CHPL_RE2: none *
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none
- Back-end compiler and version, e.g.
gcc --version
orclang --version
:
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix