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 <[email protected]>
@kaizhangNV kaizhangNV requested a review from a team as a code owner November 20, 2025 20:31
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

2 participants