mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Small NFC cleanup for LookupResultBuilder::add()
This commit is contained in:
@@ -129,6 +129,12 @@ namespace {
|
|||||||
|
|
||||||
assert(isa<ProtocolDecl>(foundDC));
|
assert(isa<ProtocolDecl>(foundDC));
|
||||||
|
|
||||||
|
if (!Options.contains(NameLookupFlags::PerformConformanceCheck))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If we found something within the protocol itself, and our
|
||||||
|
// search began somewhere that is not in a protocol or extension
|
||||||
|
// thereof, remap this declaration to the witness.
|
||||||
auto conformingType = foundInType;
|
auto conformingType = foundInType;
|
||||||
|
|
||||||
// When performing a lookup on a subclass existential, we might
|
// When performing a lookup on a subclass existential, we might
|
||||||
@@ -143,10 +149,6 @@ namespace {
|
|||||||
conformingType = layout.superclass;
|
conformingType = layout.superclass;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we found something within the protocol itself, and our
|
|
||||||
// search began somewhere that is not in a protocol or extension
|
|
||||||
// thereof, remap this declaration to the witness.
|
|
||||||
if (Options.contains(NameLookupFlags::PerformConformanceCheck)) {
|
|
||||||
// Dig out the protocol conformance.
|
// Dig out the protocol conformance.
|
||||||
auto conformance = TC.conformsToProtocol(conformingType, foundProto, DC,
|
auto conformance = TC.conformsToProtocol(conformingType, foundProto, DC,
|
||||||
conformanceOptions);
|
conformanceOptions);
|
||||||
@@ -184,9 +186,6 @@ namespace {
|
|||||||
// the requirement, so just drop the lookup result here.
|
// the requirement, so just drop the lookup result here.
|
||||||
if (witness && !isa<ProtocolDecl>(witness->getDeclContext()))
|
if (witness && !isa<ProtocolDecl>(witness->getDeclContext()))
|
||||||
addResult(witness);
|
addResult(witness);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user