Skip to content

ConformanceChecker: Minor diagnostics QoI improvements #41074

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 9 commits into from
Mar 28, 2022

Conversation

AnthonyLatsis
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis commented Jan 28, 2022

This fixes a few issues with ensureRequirementsAreSatisfied:

  • We forgot to diagnose a conformance failure on all requirement check recovery paths (decoupling checkGenericArguments and requirement failure diagnosis allows for emitting the conformance failure before we diagnose the requirement failure).
  • The location for the failed requirement specification note was off.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

I like the idea of splitting off diagnostics from checkGenericArguments()!

/// Return the result of checking the given generic parameter substitutions
/// against the given requirements.
CheckGenericArgumentsResult
checkGenericArgumentsInformative(ModuleDecl *module,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something more like checkAndDiagnoseGenericArguments()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then how about checkGenericArgumentsAndDiagnose, or checkGenericArgumentsForDiagnostics? I think these versions make for a slightly better hint that the function returns data for diagnostics rather than performing them in place.

Copy link
Collaborator Author

@AnthonyLatsis AnthonyLatsis Feb 16, 2022

Choose a reason for hiding this comment

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

I went with checkGenericArgumentsAndDiagnose checkGenericArgumentsForDiagnostics.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis
Copy link
Collaborator Author

@slavapestov Addressed all your comments; could you have another look? Thanks in advance.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@slavapestov ping

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@slavapestov ping

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

…irement check fails in 'ensureRequirementsAreSatisfied'
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

@slavapestov Thanks!

@AnthonyLatsis AnthonyLatsis merged commit 2d6e5b8 into swiftlang:main Mar 28, 2022
@AnthonyLatsis AnthonyLatsis deleted the miss-conf-error branch March 28, 2022 23:03
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