Skip to content

Commit 3626fb0

Browse files
committed
AST: Don't allow SuperclassDeclRequest on deserialized protocol
1 parent c95d9a3 commit 3626fb0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lib/AST/NameLookup.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,16 +3219,8 @@ SuperclassDeclRequest::evaluate(Evaluator &evaluator,
32193219
// Protocols may get their superclass bound from a `where Self : Superclass`
32203220
// clause.
32213221
if (auto *proto = dyn_cast<ProtocolDecl>(subject)) {
3222-
// If the protocol came from a serialized module, compute the superclass via
3223-
// its generic signature.
3224-
if (proto->wasDeserialized()) {
3225-
auto superTy = proto->getGenericSignature()
3226-
->getSuperclassBound(proto->getSelfInterfaceType());
3227-
if (superTy)
3228-
return superTy->getClassOrBoundGenericClass();
3229-
}
3222+
assert(!proto->wasDeserialized());
32303223

3231-
// Otherwise check the where clause.
32323224
auto selfBounds = getSelfBoundsFromWhereClause(proto);
32333225
for (auto inheritedNominal : selfBounds.decls)
32343226
if (auto classDecl = dyn_cast<ClassDecl>(inheritedNominal))

0 commit comments

Comments
 (0)