Skip to content

Sema: Fix crash on circular reference in checkContextualRequirements() #32776

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
Jul 9, 2020

Conversation

slavapestov
Copy link
Contributor

The call to getGenericSignature() might return nullptr if we encounter
a circular reference.

Fixes rdar://problem/64992293.

The call to getGenericSignature() might return nullptr if we encounter
a circular reference.

Fixes <rdar://problem/64992293>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov requested a review from AnthonyLatsis July 9, 2020 03:09
public extension Wrapper where Content == Impl<WrapperParam> {
typealias WrapperParam = SomeProtocol
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Slightly more reduced:

protocol SomeProtocol {}
struct G<T> {}

struct Wrapper<Content: SomeProtocol> {}

extension Wrapper where Content == G<Wrapper.WrapperParam> {
  typealias WrapperParam = Never
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original test case came from a radar. I like to keep those mostly as-is, in case they uncover more bugs in the future.

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