[Chapel Merge] Dyno: resolve bug in de/serialize generation, and other fixes

Branch: refs/heads/main
Revision: 2261e5ec26694117acd8c309549d096d9ba79b16
Author: benharsh
Link: Dyno: resolve bug in de/serialize generation, and other fixes by benharsh · Pull Request #26631 · chapel-lang/chapel · GitHub
Log Message:
Dyno: resolve bug in de/serialize generation, and other fixes (#26631)

This PR fixes a trivial off-by-one bug with the generation of
de/serialize formals. While poking further at IO calls, I observed some
other issues with resolution and made some fixes:

  • add a workaround for case when extern function return type is not
    resolved
  • Improve 'canPass' to handle passing borrowed class as an actual,
    which can occur in isSubtype
  • Improves compiler-handled casting to and from unmanaged/borrowed
    any-classes

This PR also adds some tests to lock in this behavior.

[reviewed-by @DanilaFe]

Compare: Comparing 0ad286b7577e34dd62deaf69ebf827f1430a562e...fcfa248e22372388d8357292aa6bba80af60a8a7 · chapel-lang/chapel · GitHub

Diff:
M frontend/lib/resolution/can-pass.cpp
M frontend/lib/resolution/default-functions.cpp
M frontend/lib/resolution/resolution-queries.cpp
M frontend/lib/resolution/return-type-inference.cpp
M frontend/test/resolution/testCast.cpp
M frontend/test/resolution/testSubtypePrimitives.cpp
https://github.com/chapel-lang/chapel/pull/26631.diff