17073, “npadmana”, “Initializing a PrivateSpace array over a non-nilable type fails to compile in 1.23”, “2021-02-02T01:50:59Z”
Summary of Problem
Initializing a PrivateSpace array over a non-nilable type fails to compile in 1.23.
Steps to Reproduce
Source Code:
use PrivateDist;
class A {}
var b = [PrivateSpace] new unmanaged A();
Compile command:
chpl test.chpl
fails with
$CHPL_HOME/modules/dists/PrivateDist.chpl:183: In initializer:
$CHPL_HOME/modules/dists/PrivateDist.chpl:197: error: Cannot default-initialize default: unmanaged A
$CHPL_HOME/modules/dists/PrivateDist.chpl:198: error: use here prevents split-init
note: non-nil class types do not support default initialization
note: Consider using the type unmanaged A? instead
$CHPL_HOME/modules/dists/PrivateDist.chpl:242: called as PrivateArr.init(toPrivatize: [PrivateDom(1,int(64),false)] unmanaged A) from method 'dsiPrivatize'
$CHPL_HOME/modules/internal/ChapelArray.chpl:244: called as [PrivateDom(1,int(64),false)] unmanaged A.dsiPrivatize(privatizeData: int(64))
within internal functions (use --print-callstack-on-error to see)
note: generic instantiations are underlined in the above callstack
Interestingly, this appears to work in 1.22, but not in 1.23.
Configuration Information
20:47 src$ chpl --version
chpl version 1.23.0
built with LLVM version 10.0.1
Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
20:50 src$ printchplenv --anonymize
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu *
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
CHPL_COMM_SUBSTRATE: udp *
CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads *
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_NETWORK_ATOMICS: none
CHPL_GMP: gmp
CHPL_HWLOC: hwloc
CHPL_REGEXP: re2
CHPL_LLVM: system *
CHPL_AUX_FILESYS: none