private Type TryResolveCommonType(QueryExpression left, QueryExpression right) { var leftType = ResolveFixedType(left); if (TypeHelper.CanContainNull(leftType)) { return(leftType); } if (right is NullConstantExpression) { return(typeof(Nullable <>).MakeGenericType(leftType)); } var rightType = TryResolveFixedType(right); if (rightType != null && TypeHelper.CanContainNull(rightType)) { return(rightType); } return(leftType); }