-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Lookup the conformance of an archetype in the right substitution map when computing necessary bindings of abstract cnditional requirements #32277
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2749,9 +2749,12 @@ static void addAbstractConditionalRequirements( | |
auto *proto = | ||
req.getSecondType()->castTo<ProtocolType>()->getDecl(); | ||
auto ty = req.getFirstType()->getCanonicalType(); | ||
if (!isa<ArchetypeType>(ty)) | ||
auto archetype = dyn_cast<ArchetypeType>(ty); | ||
if (!archetype) | ||
continue; | ||
auto conformance = subMap.lookupConformance(ty, proto); | ||
auto *genericEnv = archetype->getGenericEnvironment(); | ||
auto conformance = | ||
genericEnv->getForwardingSubstitutionMap().lookupConformance(ty, proto); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this ever not just an abstract conformance? Look at how the forwarding substitution map is constructed... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I replaced the check by an assert. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you see if |
||
if (!conformance.isAbstract()) | ||
continue; | ||
requirements.insert({ty, conformance.getAbstract()}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: extra space