Skip to content

Commit 74f851d

Browse files
committed
Sema: Remove a bit of dead code
1 parent ba34ee1 commit 74f851d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@ Type TypeResolution::resolveTypeInContext(TypeDecl *typeDecl,
536536
typeDecl->getDeclContext()->getSelfProtocolDecl()) {
537537
// When looking up a nominal type declaration inside of a
538538
// protocol extension, always use the nominal type and
539-
// not the protocol 'Self' type.
540-
if (!foundDC->getDeclaredInterfaceType())
541-
return ErrorType::get(ctx);
542-
539+
// not the protocol 'Self' type. This is invalid and will
540+
// be diagnosed anyway, but we want to avoid an invariant
541+
// violation from trying to construct a nominal type with
542+
// a generic parameter as its parent type.
543543
selfType = foundDC->getDeclaredInterfaceType();
544544
} else {
545545
// Otherwise, we want the protocol 'Self' type for

0 commit comments

Comments
 (0)