[IDE] Fix a crash trying to get the extended type of an ExtensionDecl with an un-typechecked AST.

Regression test on SourceKit side.

This addresses <rdar://problem/17999105>.

Swift SVN r21161
This commit is contained in:
Sonny Falk
2014-08-13 01:19:22 +00:00
parent 015234940e
commit 372ea11adc

View File

@@ -122,7 +122,7 @@ bool SemaAnnotator::walkToDeclPre(Decl *D) {
NameLen = VD->getName().getLength();
} else if (ExtensionDecl *ED = dyn_cast<ExtensionDecl>(D)) {
if (!ED->isInvalid()) {
if (!ED->isInvalid() && ED->getExtendedType()) {
// FIXME: Handle all of the ref-components in extensions, as well as
// the generic parameter lists.
if (auto nominal = ED->getExtendedType()->getAnyNominal()) {