Skip to content

Stop evaluating trailing requires clause after overload resolution #6997

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

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

ahatanaka
Copy link

Reported as it showed up as a constriants failure after the deferred instantiation patch, we were checking constraints TWICE after overload resolution. The first is during overload resolution, the second is when diagnosing a use.

This patch modifies DiagnoseUseOfDecl to skip the trailing requires clause check in some cases. First, of course, after choosing a candidate after overload resolution.

The second is when evaluating a shadow using constructor, which had its constraints checked when picking a constructor (as this is ALWAYS an overload situation!).

Differential Revision: https://reviews.llvm.org/D135772

Reported as it showed up as a constriants failure after the deferred
instantiation patch, we were checking constraints TWICE after overload
resolution.  The first is during overload resolution, the second is when
diagnosing a use.

This patch modifies DiagnoseUseOfDecl to skip the trailing requires
clause check in some cases. First, of course, after choosing a candidate
after overload resolution.

The second is when evaluating a shadow using constructor, which had its
constraints checked when picking a constructor (as this is ALWAYS an
overload situation!).

Differential Revision: https://reviews.llvm.org/D135772
@ahatanaka ahatanaka requested a review from ravikandhadai June 15, 2023 01:30
@ahatanaka
Copy link
Author

@swift-ci please test

@ravikandhadai ravikandhadai merged commit 52ccec4 into swift/release/5.9 Jun 15, 2023
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.

2 participants