{
problem = new ConflictingNameInNamespaceProblem(iNode, varName, getNamespaceStringFromDef(varDef));
}
else
{
IVariableNode varNode = (IVariableNode)iNode;
IASNode varNameNode = varNode.getNameExpressionNode();
if (ambiguity == MultiDefinitionType.MULTIPLE)
problem = new DuplicateVariableDefinitionProblem(varNameNode, varName);
else if (ambiguity == MultiDefinitionType.SHADOWS_PARAM)
problem = new VariableDefinitionDuplicatesParameterProblem(varNameNode, varName);
}
assert problem != null;
if (problem != null)
addProblem(problem);
}
if (SemanticUtils.hasBaseClassDefinition(iNode, project) )
{
addProblem(new ConflictingInheritedNameInNamespaceProblem(iNode, varDef.getBaseName(), getNamespaceStringFromDef(varDef) ));
}
// Now look to see if the variable name is also a package name
ASScope cs = (ASScope)varDef.getContainingScope();
if (cs.isPackageName(varDef.getBaseName()))
{
IVariableNode varNode = (IVariableNode)iNode;
IASNode varNameNode = varNode.getNameExpressionNode();
addProblem(new DefinitionShadowedByPackageNameProblem(varNameNode));
}
}