[Chapel Merge] Fix bugs in map composition operators when `parSaf

Branch: refs/heads/master
Revision: 53e1fb0
Author: dlongnecke-cray
Log Message:

Merge pull request #17542 from dlongnecke-cray/map-test-composition-ops

Fix bugs in map composition operators when parSafe=true (#17542)

The pull #17413 fixed several bugs in the composition operators for
the set type. This PR fixes similar bugs in the map type.

Add a test which covers every composition operator, compound
assignment operator, and every combination of parSafe value over
the map type. Use the test to fix several bugs in the map
type, including:

  • Loosen the typing of composition operators for the map type
    so that the parSafe value of the LHS and RHS maps do not
    need to match
  • Ditto for the assignment operator
  • Replace several instances of direct indexing with calls to
    add() or getValue() as appropriate
  • Add a "no doc" cast operator to make the compiler happy
  • In init=, respect a partially instantiated left-hand-side (e.g. map(int))

Also address a performance TODO for the & operator.

Reviewed by @daviditen. Thanks!


  • [x] ALL on linux64 when COMM=none
  • [x] ALL on linux64 when COMM=gasnet

Signed-off-by: David Longnecker dlongnecke-cray@users.noreply.github.com

Modified Files:
A test/library/standard/Map/mapCompositionParSafe.chpl

A test/library/standard/Map/mapCompositionParSafe.good
A test/library/standard/Map/mapInitTypeMismatchError.chpl
A test/library/standard/Map/mapInitTypeMismatchError.good
M modules/standard/Map.chpl

Compare: https://github.com/chapel-lang/chapel/compare/3b119f6423a7...53e1fb02bd01