void DoResolveInstanceExpression(ResolveContext ec)
{
//
// Argument is another delegate
//
if (delegate_instance_expression != null)
{
return;
}
if (method_group.IsStatic)
{
delegate_instance_expression = null;
return;
}
Expression instance = method_group.InstanceExpression;
if (instance != null && instance != EmptyExpression.Null)
{
delegate_instance_expression = instance;
Type instance_type = delegate_instance_expression.Type;
if (TypeManager.IsValueType(instance_type) || TypeManager.IsGenericParameter(instance_type))
{
delegate_instance_expression = new BoxedCast(
delegate_instance_expression, TypeManager.object_type);
}
}
else
{
delegate_instance_expression = ec.GetThis(loc);
}
}