Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open existential on arguments after overload resolution. #4982

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

csyonghe
Copy link
Collaborator

@csyonghe csyonghe commented Sep 2, 2024

Closes #4467.

The problem revealed here is that in ResolveInvoke we are performing openExistential on arguments before resolving overloaded callees. This is needed in order to correctly resolve generic arguments for generic callees. However we can't always us the opened existential value as argument if the parameter is mutable.

So the fix here is to switch back to original argument expr after an overload candidate is picked and we can figure out the corresponding parameter is a mutable one.

@csyonghe csyonghe added the pr: non-breaking PRs without breaking changes label Sep 2, 2024
ArielG-NV
ArielG-NV previously approved these changes Sep 4, 2024
Copy link
Contributor

@ArielG-NV ArielG-NV left a comment

Choose a reason for hiding this comment

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

Code looks good to me, 1 suggestion (clean-up).

source/slang/slang-check-overload.cpp Outdated Show resolved Hide resolved
Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
@csyonghe csyonghe merged commit 599dae5 into shader-slang:master Sep 4, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Properly handle the mismatching "mutating" signature for implementing interfaces
2 participants