Fix a crash involving extensions.

Swift SVN r1411
This commit is contained in:
Eli Friedman
2012-04-13 00:48:53 +00:00
parent 7823cd48eb
commit 1569d73cb2

View File

@@ -310,8 +310,10 @@ static Expr *BindNameToIVar(UnresolvedDeclRefExpr *UDRE, FuncDecl *CurFD,
if (CurFD->isStatic()) {
if (ProtocolType *Proto = ExtendedType->getAs<ProtocolType>())
StaticAlias = Proto->TheDecl;
else if (OneOfType *OneOf = ExtendedType->getAs<OneOfType>())
StaticAlias = OneOf->getDecl();
else
StaticAlias = ExtendedType->castTo<OneOfType>()->getDecl();
return 0;
ExtendedType = MetaTypeType::get(StaticAlias);
}