Skip to content

TypeChecker::conformsToProtocol() => ModuleDecl::checkConformance() #70937

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 2 commits into from
Jan 17, 2024

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jan 16, 2024

TypeChecker::conformsToProtocol() is now gone. There are two entry points on ModuleDecl:

  • ModuleDecl::lookupConformance() returns a conformance if one exists without checking conditional requirements. You can pass in a type containing type parameters.
  • ModuleDecl::checkConformance() also checks conditional requirements. You must pass in a type that does not contain type parameters (archetypes are OK).

Note that the two methods differ in the default value for the allowMissing parameter: the first one has it as false, and the second one as true. I don't know if this is an accident or on purpose but I left it alone to avoid breaking code.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov force-pushed the rename-conformance-lookup branch from 7ef1d20 to 14d1fcb Compare January 16, 2024 22:09
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis left a comment

Choose a reason for hiding this comment

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

Nice to see some progress on moving stuff out of the TypeChecker namespace!

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