AST: Remove implicit conversion from Witness to ConcreteDeclRef

This commit is contained in:
Slava Pestov
2017-10-06 22:32:40 -07:00
parent d4976893e6
commit 05d81081e1
3 changed files with 2 additions and 9 deletions

View File

@@ -150,13 +150,6 @@ public:
/// Determines whether there is a witness at all.
explicit operator bool() const { return !storage.isNull(); }
/// Implicit conversion to the \c ConcreteDeclRef, which is used by a
/// number of clients.
///
/// FIXME: We probably want this to go away eventually, because clients using
/// it will all need to be cognizant of the synthetic environment.
operator ConcreteDeclRef() const { return getDeclRef(); }
/// Determine whether this witness requires any substitutions.
bool requiresSubstitution() const { return storage.is<StoredWitness *>(); }

View File

@@ -1131,7 +1131,7 @@ ConformanceLookupTable::getSatisfiedProtocolRequirementsForMember(
auto normal = conf->getRootNormalConformance();
normal->forEachValueWitness(resolver, [&](ValueDecl *req,
ConcreteDeclRef witness) {
Witness witness) {
if (witness.getDecl() == member)
reqs.push_back(req);
});

View File

@@ -1642,7 +1642,7 @@ void Serializer::writeDefaultWitnessTable(const ProtocolDecl *proto,
unsigned abbrCode = abbrCodes[DefaultWitnessTableLayout::Code];
for (auto member : proto->getMembers()) {
if (auto *value = dyn_cast<ValueDecl>(member)) {
ConcreteDeclRef witness = proto->getDefaultWitness(value);
auto witness = proto->getDefaultWitness(value);
if (!witness)
continue;