Skip to content

Commit 2db6293

Browse files
committed
Sema: Support for abstract conformance in findNamedWitnessImpl()
1 parent db9380f commit 2db6293

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Sema/CSApply.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,14 @@ ConcreteDeclRef findNamedWitnessImpl(
166166

167167
// For a type with dependent conformance, just return the requirement from
168168
// the protocol. There are no protocol conformance tables.
169-
if (!conformance->isConcrete())
170-
return requirement;
169+
if (!conformance->isConcrete()) {
170+
auto subMap = SubstitutionMap::getProtocolSubstitutions(proto, type,
171+
*conformance);
172+
SmallVector<Substitution, 2> subs;
173+
proto->getGenericSignature()->getSubstitutions(subMap, subs);
174+
return ConcreteDeclRef(tc.Context, requirement, subs);
175+
}
176+
171177
auto concrete = conformance->getConcrete();
172178
return concrete->getWitnessDeclRef(requirement, &tc);
173179
}

0 commit comments

Comments
 (0)