Skip to content

Conversation

@kaizhangNV
Copy link
Contributor

Fixes #9060

The issue was that canCoerce() called _coerce() with CoercionSite::General during overload resolution, but the sized-to-unsized array conversion logic only worked when CoercionSite::Argument was used. This caused overload candidates to be incorrectly rejected even though the conversion would work during the actual coercion phase.

Changes

  • Add overload of canCoerce() that accepts CoercionSite parameter
  • Update TryCheckOverloadCandidateTypes to use CoercionSite::Argument
  • Add comprehensive test case for array overload resolution

📝 Generated with Claude Code

The issue was that canCoerce() called _coerce() with CoercionSite::General during
overload resolution, but the sized-to-unsized array conversion logic only worked
when CoercionSite::Argument was used. This caused overload candidates to be
incorrectly rejected even though the conversion would work during the actual
coercion phase.

Changes:
- Add overload of canCoerce() that accepts CoercionSite parameter
- Update TryCheckOverloadCandidateTypes to use CoercionSite::Argument
- Add comprehensive test case for array overload resolution

Fixes #9060

Co-authored-by: pdeayton-nv <pdeayton-nv@users.noreply.github.com>
@kaizhangNV kaizhangNV requested a review from a team as a code owner November 20, 2025 20:31
Copy link
Collaborator

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should implement the cache key fix suggested by @tangent-vector's comment in #9060.

@jkwak-work
Copy link
Collaborator

@kaizhangNV , can you address what Yong and Tess suggested.
And fix the merge conflict?

@kaizhangNV
Copy link
Contributor Author

kaizhangNV commented Dec 6, 2025

I did not own this issue, Peter did. I just click the button to create the PR from Claude.

@kaizhangNV kaizhangNV closed this Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slang unable to find function overload when candidates have an array and RWStructuredBuffer

4 participants