Skip to content

Commit 05b8720

Browse files
committed
AST: Change isInvalid() on an accessor to delegate to the storage
This helps avoid a request cycle from the isInvalid() call inside performAbstractFuncDeclDiagnostics().
1 parent 9d4062a commit 05b8720

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/AST/Decl.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,15 @@ bool Decl::isInvalid() const {
434434
case DeclKind::Constructor:
435435
case DeclKind::Destructor:
436436
case DeclKind::Func:
437-
case DeclKind::Accessor:
438437
case DeclKind::EnumElement:
439438
return cast<ValueDecl>(this)->getInterfaceType()->hasError();
439+
440+
case DeclKind::Accessor: {
441+
auto *AD = cast<AccessorDecl>(this);
442+
if (AD->hasInterfaceType() && AD->getInterfaceType()->hasError())
443+
return true;
444+
return AD->getStorage()->isInvalid();
445+
}
440446
}
441447

442448
llvm_unreachable("Unknown decl kind");

0 commit comments

Comments
 (0)