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

Fix circularity issue when checking multiple generic interface constraints. #6121

Merged

Conversation

saipraveenb25
Copy link
Collaborator

@saipraveenb25 saipraveenb25 commented Jan 17, 2025

We need to defer the checking of the super-type of a constraint to after we ascertain that the sub-type is relevant to the current call.

Otherwise, the checking of any constraint in a generic will trigger the checking of all other constraints & can lead to a scenario where the super-type depends on a type whose inheritance info is currently being created.
Since inheritance info is initialized to empty set, this will produce an incorrect isSubtype result & cause an error during checking.

Seems to only occur if more than 1 generic interface constraint is present.

@saipraveenb25 saipraveenb25 requested a review from a team as a code owner January 17, 2025 18:58
@saipraveenb25 saipraveenb25 added the pr: non-breaking PRs without breaking changes label Jan 17, 2025
@csyonghe csyonghe merged commit 9d99976 into shader-slang:master Jan 17, 2025
6 of 7 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.

2 participants