chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

Enum doesn't print correctly #18937

Open aconsroe-hpe opened 2 years ago

aconsroe-hpe commented 2 years ago

Summary of Problem

Enum values with the same given value don't print correctly.

Steps to Reproduce

Source Code:

enum foo1 {bar = 0};
writeln(foo1.bar);

enum foo2 {Bar = 0};
writeln(foo2.Bar);

enum foo3 {bar = 0, Bar = 0};
writeln(foo3.bar);
writeln(foo3.Bar);

Compile command: chpl multipleenums.chpl

Execution command: ./multipleenums Output

bar
Bar
bar
bar

I expected the last line to be Bar

Associated Future Test(s):

Configuration Information

chpl version 1.26.0 pre-release (7c41c0d4a7)
  built with LLVM version 11.0.1
Copyright 2020-2021 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
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: fifo *
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: system *
CHPL_HWLOC: none
CHPL_RE2: bundled
CHPL_LLVM: system *
CHPL_AUX_FILESYS: none
clang version 11.0.1 (https://github.com/llvm/llvm-project.git 43ff75f2c3feef64f9d73328230d34dac8832a91)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /mnt/storage/llvm/bin
bradcray commented 2 years ago

I believe this is already fixed in #18708 which has yet to be merged. That's fallen out of my active working set because I didn't want to merge it without a fix for the performance hit that it results in (and definitely didn't want to merge it before 1.25.1).