[Chapel Merge] Minor adjustments to canParamCoerce

Branch: refs/heads/main
Revision: 67d14e8
Author: mppf
Link: Minor adjustments to canParamCoerce by mppf · Pull Request #18683 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18683 from mppf/add-missing-imag-conversion

Minor adjustments to canParamCoerce

This PR addresses two minor issues with canParamCoerce in the production
compiler that I noticed while porting it over to compiler/next in #18660.

  • Adds missing imag(32)->imag(64) implicit conversion. The spec clearly
    indicates that this conversion should be present but to date it only
    works for params. See also
    Conversions — Chapel Documentation 1.25

  • Consider param string conversion to be a narrowing conversion. When
    working with a param string, the compiler can implicitly convert it in
    to c_string; and likewise for a param c_string into string. Since this
    relies on the actual argument being a param (i.e. it does not allow
    converting var x:string into a c_string implicitly), count it as a
    narrowing conversion. I expect this to become irrelevant when we
    deprecate c_string.

Reviewed by @e-kayrakli - thanks!