addProblem(problem);
return false;
}
configScope.addItemAfterNormalization(node);
DefinitionBase constDef = node.getDefinition();
configScope.getASScope().addDefinition(constDef);
if (constDef instanceof ConstantDefinition)
{
ConstantDefinition def = (ConstantDefinition)constDef;
Object value = def.resolveValue(backingProject);
if (value == ConfigConstNode.UNKNOWN_VALUE)
{
// Get the real source node for the problem.
// If there isn't one, then don't make a problem - assume
// someone else already found the cause and logged it.
IASNode problemLocationNode = node.getAssignedValueNode();
if (problemLocationNode != null)
{
ICompilerProblem problem = new NonConstantConfigInitProblem(
problemLocationNode);
addProblem(problem);
}
}
}
// Check for redeclaration
// Config vars don't care about MultiDefinitionType.MANY vs. AMBIGUOUS
// and it's not possible for them to shadow params, so we only have to check if
// the multi type is not NONE
if (SemanticUtils.getMultiDefinitionType(constDef, backingProject) != SemanticUtils.MultiDefinitionType.NONE)
{
addProblem(new ConflictingNameInNamespaceProblem(node, constDef.getBaseName(), node.getNamespace()));
return false;
}
return true;
}