System\Linq\Expressions\BinaryExpression.cs (24)
294!TypeUtils.AreEquivalent(method.GetParametersCached()[0].ParameterType.GetNonRefType(), Left.Type);
318Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce);
343TypeUtils.AreEquivalent(right, left) &&
346TypeUtils.AreEquivalent(method.ReturnType, left.GetNonNullableType());
400MethodInfo? opTrueFalse = TypeUtils.GetBooleanOperator(Method!.DeclaringType!, opName);
591TypeUtils.ValidateType(left.Type, nameof(left), allowByRef: true, allowPointer: true);
592TypeUtils.ValidateType(right.Type, nameof(right), allowByRef: true, allowPointer: true);
593if (!TypeUtils.AreReferenceAssignable(left.Type, right.Type))
668if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type))
701if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type))
725if (method == null && !TypeUtils.AreEquivalent(leftType, rightType))
750return TypeUtils.AreReferenceAssignable(pType, argType);
832MethodInfo? opTrue = TypeUtils.GetBooleanOperator(declaringType, "op_True");
833MethodInfo? opFalse = TypeUtils.GetBooleanOperator(declaringType, "op_False");
858return TypeUtils.AreEquivalent(left, right) &&
860TypeUtils.AreEquivalent(pms[1].ParameterType, right.GetNonNullableType());
992if (TypeUtils.HasReferenceEquality(left.Type, right.Type))
1044if (TypeUtils.HasReferenceEquality(left.Type, right.Type))
1074if (TypeUtils.HasBuiltInEqualityOperator(left.Type, right.Type) || IsNullComparison(left, right))
1288returnType = (left.Type.IsNullableType() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType;
1294returnType = (left.Type.IsNullableType() && TypeUtils.AreEquivalent(method.ReturnType, left.Type.GetNonNullableType())) ? left.Type : method.ReturnType;
1409if (!TypeUtils.AreEquivalent(method.ReturnType, right.Type))
1557if (!TypeUtils.AreEquivalent(mi.ReturnType, left.Type))
1563if (!TypeUtils.AreEquivalent(pms[0].ParameterType, method.ReturnType))
System\Linq\Expressions\NewExpression.cs (6)
146TypeUtils.ValidateType(constructor.DeclaringType!, nameof(constructor), allowByRef: true, allowPointer: true);
171TypeUtils.ValidateType(constructor.DeclaringType!, nameof(constructor), allowByRef: true, allowPointer: true);
205TypeUtils.ValidateType(type, nameof(type));
241if (!TypeUtils.AreEquivalent(member.DeclaringType, constructor.DeclaringType))
247if (!TypeUtils.AreReferenceAssignable(memberType, arg.Type))
260if (!TypeUtils.AreReferenceAssignable(pType, arg.Type))
System\Linq\Expressions\UnaryExpression.cs (12)
66return (operandIsNullable && !TypeUtils.AreEquivalent(Method.GetParametersCached()[0].ParameterType, Operand.Type)) ||
67(resultIsNullable && !TypeUtils.AreEquivalent(Method.ReturnType, this.Type));
415MethodInfo? method = TypeUtils.GetUserDefinedCoercionMethod(expression.Type, convertToType);
435if (ParameterIsAssignable(pms[0], operand.Type) && TypeUtils.AreEquivalent(method.ReturnType, convertToType))
442(TypeUtils.AreEquivalent(method.ReturnType, convertToType.GetNonNullableType()) ||
443TypeUtils.AreEquivalent(method.ReturnType, convertToType)))
694TypeUtils.ValidateType(type, nameof(type));
718TypeUtils.ValidateType(type, nameof(type));
749TypeUtils.ValidateType(type, nameof(type));
789TypeUtils.ValidateType(type, nameof(type));
883TypeUtils.ValidateType(type, nameof(type));
1073if (!TypeUtils.AreReferenceAssignable(expression.Type, result.Type))