Skip to content

Commit dc27e46

Browse files
committed
Sema: Restored AST verification but loosened the check
The check now passes if the type meets isExistentialType rather than isAnyExistentialType.
1 parent 7985ac0 commit dc27e46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,15 @@ class Verifier : public ASTWalker {
18161816
abort();
18171817
}
18181818

1819+
// The base of a member reference cannot be an existential type.
1820+
if (E->getBase()->getType()->getWithoutSpecifierType()
1821+
->isExistentialType()) {
1822+
Out << "Member reference into an unopened existential type\n";
1823+
E->dump(Out);
1824+
Out << "\n";
1825+
abort();
1826+
}
1827+
18191828
// The only time the base is allowed to be inout is if we are accessing
18201829
// a computed property or if the base is a protocol or existential.
18211830
if (auto *baseIOT = E->getBase()->getType()->getAs<InOutType>()) {

0 commit comments

Comments
 (0)