Commit b43f2792 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed type checking for type definitions inside an @implementation

parent 10f94d67
......@@ -135,7 +135,14 @@ void CheckUndefinedSymbols::buildTypeMap(Class *klass)
addType(klass->name());
for (unsigned i = 0; i < klass->memberCount(); ++i) {
Symbol *member = klass->memberAt(i);
buildMemberTypeMap(klass->memberAt(i));
}
}
void CheckUndefinedSymbols::buildMemberTypeMap(Symbol *member)
{
if (member == 0)
return;
if (Class *klass = member->asClass()) {
buildTypeMap(klass);
......@@ -147,7 +154,6 @@ void CheckUndefinedSymbols::buildTypeMap(Class *klass)
if (decl->isTypedef())
addType(decl->name());
}
}
}
void CheckUndefinedSymbols::buildTypeMap(NamespaceBinding *binding, QSet<NamespaceBinding *> *processed)
......@@ -176,10 +182,16 @@ void CheckUndefinedSymbols::buildTypeMap(NamespaceBinding *binding, QSet<Namespa
addType(fKlass->name());
} else if (ObjCClass *klass = member->asObjCClass()) {
addType(klass->name());
for (unsigned i = 0; i < klass->memberCount(); ++i)
buildMemberTypeMap(klass->memberAt(i));
} else if (ObjCForwardProtocolDeclaration *fProto = member->asObjCForwardProtocolDeclaration()) {
addType(fProto->name());
} else if (ObjCProtocol *proto = member->asObjCProtocol()) {
addType(proto->name());
for (unsigned i = 0; i < proto->memberCount(); ++i)
buildMemberTypeMap(proto->memberAt(i));
}
}
}
......
......@@ -57,6 +57,7 @@ protected:
void addType(Name *name);
void buildTypeMap(Class *klass);
void buildMemberTypeMap(Symbol *member);
void buildTypeMap(NamespaceBinding *binding, QSet<NamespaceBinding *> *processed);
FunctionDeclaratorAST *currentFunctionDeclarator() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment