Skip to content

Commit 22b49d2

Browse files
authored
[Verifier] ObjC protocols may have unavailable requirements. (#6862)
...which don't need to have witnesses. I can't seem to come up with a reduced test case for this one, but it does fix a verifier failure in the larger project that triggered this. rdar://problem/29744313
1 parent 0ab904c commit 22b49d2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,9 +1992,15 @@ struct ASTNodeBase {};
19921992
if (auto *FD = dyn_cast<FuncDecl>(member))
19931993
if (FD->isAccessor())
19941994
continue;
1995-
1995+
1996+
19961997
if (auto req = dyn_cast<ValueDecl>(member)) {
19971998
if (!normal->hasWitness(req)) {
1999+
if (req->getAttrs().isUnavailable(Ctx) &&
2000+
proto->isObjC()) {
2001+
continue;
2002+
}
2003+
19982004
dumpRef(decl);
19992005
Out << " is missing witness for "
20002006
<< conformance->getProtocol()->getName().str()

0 commit comments

Comments
 (0)