[IRGen] Adjust keypath component id for overriding witness methods.

This commit is contained in:
Doug Gregor
2018-09-10 10:41:34 -07:00
parent 2246e2bf60
commit c6e9b24425
4 changed files with 20 additions and 0 deletions

View File

@@ -789,6 +789,9 @@ SILDeclRef SILDeclRef::getOverriddenWitnessTableEntry() const {
AbstractFunctionDecl *SILDeclRef::getOverriddenWitnessTableEntry(
AbstractFunctionDecl *func) {
if (!isa<ProtocolDecl>(func->getDeclContext()))
return func;
AbstractFunctionDecl *bestOverridden = nullptr;
SmallVector<AbstractFunctionDecl *, 4> stack;