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

Fixed type checking for type definitions inside an @implementation

parent 10f94d67
......@@ -135,18 +135,24 @@ void CheckUndefinedSymbols::buildTypeMap(Class *klass)
addType(klass->name());
for (unsigned i = 0; i < klass->memberCount(); ++i) {
Symbol *member = klass->memberAt(i);
if (Class *klass = member->asClass()) {
buildTypeMap(klass);
} else if (Enum *e = member->asEnum()) {
addType(e->name());
} else if (ForwardClassDeclaration *fwd = member->asForwardClassDeclaration()) {
addType(fwd->name());
} else if (Declaration *decl = member->asDeclaration()) {
if (decl->isTypedef())
addType(decl->name());
}
buildMemberTypeMap(klass->memberAt(i));
}
}
void CheckUndefinedSymbols::buildMemberTypeMap(Symbol *member)
{
if (member == 0)
return;
if (Class *klass = member->asClass()) {
buildTypeMap(klass);
} else if (Enum *e = member->asEnum()) {
addType(e->name());
} else if (ForwardClassDeclaration *fwd = member->asForwardClassDeclaration()) {
addType(fwd->name());
} else if (Declaration *decl = member->asDeclaration()) {
if (decl->isTypedef())
addType(decl->name());
}
}
......@@ -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