New Issue: Indexing into an array literal results in surprising behavior

16883, “bradcray”, “Indexing into an array literal results in surprising behavior”, “2020-12-17T21:07:36Z”

Summary of Problem

When indexing into an array literal, like [1, 2, 3][1], we seem to get 1 1 1 as the output rather than 2, as expected. My guess is that this is being interpreted as an index-less loop expression for reasons that aren’t clear to me (e.g., equivalent to [i in [1, 2, 3]] [1]) and seem incorrect.

Steps to Reproduce

Associated Future Test(s):
test/arrays/indexing/arrLitIndexing.chpl #16882

Configuration Information

  • Output of chpl --version: chpl version 1.24.0 pre-release (c3cb383326)