External Issue: Internal error when assigning lambdas

18413, "twesterhout", "Internal error when assigning lambdas", "2021-09-13T20:07:00Z"

Summary of Problem

The compiler crashes with internal error:

error.chpl:5: internal error: AST-EXP-0409 chpl version 1.24.1

Steps to Reproduce

Source Code:

var isHammingWeightFixed: bool = true;

var projFn = if isHammingWeightFixed
  then lambda(x) { return x; }
  else lambda(x) { return x; };

Compile command:

chpl -o error error.chpl

Configuration Information

  • Output of chpl --version: 1.24.1
  • Output of $CHPL_HOME/util/printchplenv --anonymize:
CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: unknown
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
  CHPL_COMM_SUBSTRATE: smp *
  CHPL_GASNET_SEGMENT: fast
CHPL_TASKS: qthreads
CHPL_LAUNCHER: smp
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: bundled
CHPL_HWLOC: bundled
CHPL_REGEXP: re2
CHPL_LLVM: none
CHPL_AUX_FILESYS: none
  • Back-end compiler and version, e.g. gcc --version or clang --version: gcc 10.3.0
  • (For Cray systems only) Output of module list: