Skip to content

Commit c9ec7e3

Browse files
committed
Fix crash during type checking when adding members to an extension.
If the extension ended up with ErrorType, we could crash while we continue trying to process its body adding members. Just bail out in this case. rdar://problem/27671033
1 parent a0fca3a commit c9ec7e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/NameLookup.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,9 @@ void NominalTypeDecl::addedMember(Decl *member) {
898898

899899
void ExtensionDecl::addedMember(Decl *member) {
900900
if (NextExtension.getInt()) {
901+
if (getExtendedType()->is<ErrorType>())
902+
return;
903+
901904
auto nominal = getExtendedType()->getAnyNominal();
902905
if (nominal->LookupTable.getPointer()) {
903906
// Make sure we have the complete list of extensions.

0 commit comments

Comments
 (0)