public override bool EnterBinaryExpression(BinaryExpression node)
{
if (BinaryOperatorType.Assign != node.Operator)
return true;
if (NodeType.ReferenceExpression != node.Left.NodeType)
return true;
if (node.Left.Entity != null)
return true;
// Auto local declaration:
// assign to unknown reference implies local
// declaration
ReferenceExpression reference = (ReferenceExpression)node.Left;
IEntity entity = TryToResolveName(reference.Name);
if (null == entity || TypeSystemServices.IsBuiltin(entity) || IsInaccessible(entity))
{
ProcessAutoLocalDeclaration(node, reference);
return false;
}
return true;
}