[Chapel Merge] compiler/next: implement canParamCoerce

Branch: refs/heads/main
Revision: da888fd
Author: mppf
Link: Unavailable
Log Message:

Merge pull request #18660 from mppf/next-can-dispatch2

compiler/next: implement canParamCoerce

This PR implements more detail in resolution-rules.cpp including canParamCoerce. The implementation of canParamCoerce is a port of the canParamCoerce code from the production compiler over to the new type representation. canParamCoerce indicates when a conversion can occur for a param value. It does not include all implicit conversions since some of them require an action at runtime (and so wouldn't produce a param result from a param input).

Along the way, this PR:

  • adds NilType.h and comments on a few types
  • simplifies QualifiedType by checking that param_ can only be set for kind_ = PARAM
  • adds helpers to Type for checking for common groupings of types
  • adds testing for canPass
  • adjusts the sketch code in resolution-queries.cpp to call the new canPass code

Reviewed by @dlongnecke-cray - thanks!

  • [x] full local testing

    Modified Files:
    A compiler/next/include/chpl/resolution/can-pass.h
    A compiler/next/include/chpl/types/NilType.h
    A compiler/next/lib/resolution/can-pass.cpp
    A compiler/next/lib/types/NilType.cpp
    A compiler/next/test/resolution/testCanPass.cpp
    R compiler/next/lib/resolution/resolution-rules.cpp
    R compiler/next/lib/resolution/resolution-rules.h
    M compiler/next/include/chpl/types/IntType.h
    M compiler/next/include/chpl/types/ParamClassesList.h
    M compiler/next/include/chpl/types/QualifiedType.h
    M compiler/next/include/chpl/types/Type.h
    M compiler/next/include/chpl/types/all-types.h
    M compiler/next/lib/resolution/CMakeLists.txt
    M compiler/next/lib/resolution/Makefile.include
    M compiler/next/lib/resolution/resolution-queries.cpp
    M compiler/next/lib/types/CMakeLists.txt
    M compiler/next/lib/types/Makefile.include
    M compiler/next/test/resolution/CMakeLists.txt
    M compiler/next/test/resolution/testPoi.cpp

    Compare: Comparing 67d14e823711...da888fd2655e · chapel-lang/chapel · GitHub