[Chapel Merge] Add additional protection against non-param indexi

Branch: refs/heads/main
Revision: 9d8088e
Author: bradcray
Link: Add additional protection against non-param indexing into heterogeneous tuples by bradcray · Pull Request #18776 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18776 from bradcray/error-on-het-tuple-non-param-indexing

Add additional protection against non-param indexing into heterogeneous tuples

[reviewed by @mppf]

The test added here resulted in an internal rather than user-facing
error, I believe due to the fact that it was following a speculative
resolution path to determine the type of an expression and
squashing user errors along the way which would have flagged this
expression as being illegal. Here, I took the simple approach of
replicating the normal module-level user-facing error message in place
of the assert that the tuple was homogeneous which was being tripped
prior to this change.

Resolves #18775.

Modified Files:
A test/types/tuple/errors/indexHetTuple.chpl

A test/types/tuple/errors/indexHetTuple.good
M compiler/AST/primitive.cpp

Compare: https://github.com/chapel-lang/chapel/compare/a99ff581b294...9d8088e09b44