External Issue: error defining array type in UnitTest function

20939, "lucaferranti", "error defining array type in UnitTest function", "2022-10-29T13:25:50Z"

Summary of Problem

The following works nicely

type D = [0..1] int;

however if I wrap that definition inside a function test for UnitTest

use UnitTest;

proc testNotWorking(test: borrowed Test) throws {
  type D = [0..1] int;
}

UnitTest.main();

When compiling with chpl tmp.chpl I get the error

tmp.chpl:4: In function 'testNotWorking':
tmp.chpl:5: error: Iterators not allowed in first class functions
tmp.chpl:4: In function 'testNotWorking':
tmp.chpl:5: error: Iterators not allowed in first class functions

Associated Future Test(s):

Configuration Information

  • Output of chpl --version:
chpl version 1.28.0
  built with LLVM version 12.0.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: linux64
CHPL_TARGET_COMPILER: llvm
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: none
CHPL_LLVM: system
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version:
gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Is this expected/intended?