mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Fix warning about missing return in SubstitutionMap::getProtocolSubstitutions()
The branch without the return is actually unreachable, so let's add an assert.
This commit is contained in:
@@ -229,15 +229,14 @@ SubstitutionMap::getProtocolSubstitutions(ProtocolDecl *protocol,
|
||||
auto protocolSelfType = protocol->getSelfInterfaceType();
|
||||
return protocol->getGenericSignature()->getSubstitutionMap(
|
||||
[&](SubstitutableType *type) -> Type {
|
||||
if (type->isEqual(protocolSelfType))
|
||||
return selfType;
|
||||
assert(type->isEqual(protocolSelfType));
|
||||
return selfType;
|
||||
},
|
||||
[&](CanType origType, Type replacementType, ProtocolType *protoType)
|
||||
-> ProtocolConformanceRef {
|
||||
if (origType->isEqual(protocolSelfType) &&
|
||||
protoType->getDecl() == protocol)
|
||||
return conformance;
|
||||
llvm_unreachable("Should not get any other conformance queries here");
|
||||
assert(origType->isEqual(protocolSelfType) &&
|
||||
protoType->getDecl() == protocol);
|
||||
return conformance;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user