Skip to content

Commit 3cffa85

Browse files
committed
WIP
1 parent eb37ea3 commit 3cffa85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/AST/Availability.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,12 @@ AvailabilityInference::parentDeclForInferredAvailability(const Decl *D) {
182182
return NTD;
183183
}
184184

185-
if (auto *PBD = dyn_cast<PatternBindingDecl>(D))
185+
if (auto *PBD = dyn_cast<PatternBindingDecl>(D)) {
186+
if (PBD->getNumPatternEntries() < 1)
187+
return nullptr;
188+
186189
return PBD->getAnchoringVarDecl(0);
190+
}
187191

188192
if (auto *OTD = dyn_cast<OpaqueTypeDecl>(D))
189193
return OTD->getNamingDecl();

0 commit comments

Comments
 (0)