329 references to TypeUtils
System.Core (329)
Microsoft\Scripting\Actions\BindingRestrictions.cs (1)
258return other != null && TypeUtils.AreEquivalent(other._type, _type) && other._expression == _expression;
Microsoft\Scripting\Actions\CallSite.cs (2)
115if (TypeUtils.CanCache(delegateType)) { 731if (TypeUtils.AreReferenceAssignable(type, arg.Type)) {
Microsoft\Scripting\Actions\DynamicMetaObjectBinder.cs (2)
95!TypeUtils.AreReferenceAssignable(returnLabel.Type, expectedResult)) { 118!TypeUtils.AreReferenceAssignable(expectedResult, body.Type)) {
Microsoft\Scripting\Actions\DynamicObject.cs (1)
741if (TypeUtils.AreEquivalent(Expression.Type, typeof(DynamicObject))) {
Microsoft\Scripting\Actions\ExpandoObject.cs (1)
887if (TypeUtils.AreEquivalent(Expression.Type, LimitType)) {
Microsoft\Scripting\Ast\BinaryExpression.cs (106)
316if (TypeUtils.IsNullableType(_left.Type)) { 319!TypeUtils.AreEquivalent(method.GetParametersCached()[0].ParameterType.GetNonRefType(), _left.Type); 329return IsLifted && TypeUtils.IsNullableType(Type); 342Debug.Assert(method == null && TypeUtils.AreEquivalent(type, left.Type)); 346Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce); 367TypeUtils.AreEquivalent(right, left) && 368TypeUtils.IsNullableType(left) && 370TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(left)); 421MethodInfo opTrueFalse = TypeUtils.GetBooleanOperator(Method.DeclaringType, opName); 580TypeUtils.ValidateType(left.Type); 581TypeUtils.ValidateType(right.Type); 582if (!TypeUtils.AreReferenceAssignable(left.Type, right.Type)) { 598if (TypeUtils.IsNullableType(left.Type) && TypeUtils.IsNullableType(right.Type)) { 599Type nnLeftType = TypeUtils.GetNonNullableType(left.Type); 600Type nnRightType = TypeUtils.GetNonNullableType(right.Type); 602if (method != null && method.ReturnType.IsValueType && !TypeUtils.IsNullableType(method.ReturnType)) { 604return new MethodBinaryExpression(binaryType, left, right, TypeUtils.GetNullableType(method.ReturnType), method); 627if (TypeUtils.IsNullableType(left.Type) && TypeUtils.IsNullableType(right.Type) && 628ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(left.Type)) && 629ParameterIsAssignable(pms[1], TypeUtils.GetNonNullableType(right.Type)) && 630method.ReturnType.IsValueType && !TypeUtils.IsNullableType(method.ReturnType)) { 632return new MethodBinaryExpression(binaryType, left, right, TypeUtils.GetNullableType(method.ReturnType), method); 644if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type)) { 671if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type)) { 687Type nnLeftType = TypeUtils.GetNonNullableType(leftType); 688Type nnRightType = TypeUtils.GetNonNullableType(rightType); 691if (method == null && !TypeUtils.AreEquivalent(leftType, rightType)) { 703return TypeUtils.IsNullableType(right) && 704TypeUtils.IsNullableType(left) && 714return TypeUtils.AreReferenceAssignable(pType, argType); 719if (TypeUtils.IsNullableType(paramType) && !TypeUtils.IsNullableType(operandType)) { 748if (IsNullConstant(left) && !IsNullConstant(right) && TypeUtils.IsNullableType(right.Type)) { 751if (IsNullConstant(right) && !IsNullConstant(left) && TypeUtils.IsNullableType(left.Type)) { 775if (!(TypeUtils.IsNullableType(left) && ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(left)))) 779if (!(TypeUtils.IsNullableType(right) && ParameterIsAssignable(pms[1], TypeUtils.GetNonNullableType(right)))) 789left = TypeUtils.GetNonNullableType(left); 790right = TypeUtils.GetNonNullableType(left); 792MethodInfo opTrue = TypeUtils.GetBooleanOperator(method.DeclaringType, "op_True"); 793MethodInfo opFalse = TypeUtils.GetBooleanOperator(method.DeclaringType, "op_False"); 808if (!(TypeUtils.IsNullableType(left) && ParameterIsAssignable(pmsOpTrue[0], TypeUtils.GetNonNullableType(left)))) 814return TypeUtils.AreEquivalent(left, right) && 815TypeUtils.IsNullableType(right) && 816TypeUtils.AreEquivalent(pms[1].ParameterType, TypeUtils.GetNonNullableType(right)); 985if (TypeUtils.HasReferenceEquality(left.Type, right.Type)) { 1032if (TypeUtils.HasReferenceEquality(left.Type, right.Type)) { 1040if (left.Type == right.Type && (TypeUtils.IsNumeric(left.Type) || 1042TypeUtils.IsBool(left.Type) || 1043TypeUtils.GetNonNullableType(left.Type).IsEnum)) { 1044if (TypeUtils.IsNullableType(left.Type) && liftToNull) { 1055if (TypeUtils.HasBuiltInEqualityOperator(left.Type, right.Type) || IsNullComparison(left, right)) { 1056if (TypeUtils.IsNullableType(left.Type) && liftToNull) { 1195if (left.Type == right.Type && TypeUtils.IsNumeric(left.Type)) { 1196if (TypeUtils.IsNullableType(left.Type) && liftToNull) { 1245returnType = (TypeUtils.IsNullableType(left.Type) && TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(left.Type))) ? left.Type : method.ReturnType; 1251returnType = (TypeUtils.IsNullableType(left.Type) && TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(left.Type))) ? left.Type : method.ReturnType; 1291returnType = (TypeUtils.IsNullableType(left.Type) && method.ReturnType == TypeUtils.GetNonNullableType(left.Type)) ? left.Type : method.ReturnType; 1297returnType = (TypeUtils.IsNullableType(left.Type) && method.ReturnType == TypeUtils.GetNonNullableType(left.Type)) ? left.Type : method.ReturnType; 1334if (left.Type.IsValueType && !TypeUtils.IsNullableType(left.Type)) { 1353if (!TypeUtils.AreEquivalent(method.ReturnType, right.Type)) { 1358if (!ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(left.Type)) && 1367Type leftStripped = TypeUtils.GetNonNullableType(left); 1368if (left.IsValueType && !TypeUtils.IsNullableType(left)) { 1370} else if (TypeUtils.IsNullableType(left) && TypeUtils.IsImplicitlyConvertible(right, leftStripped)) { 1372} else if (TypeUtils.IsImplicitlyConvertible(right, left)) { 1374} else if (TypeUtils.IsImplicitlyConvertible(leftStripped, right)) { 1412if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1462if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1483if (!TypeUtils.AreEquivalent(mi.ReturnType, left.Type)) { 1488if (!TypeUtils.AreEquivalent(pms[0].ParameterType, method.ReturnType)) { 1538if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1575if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1608if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1657if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1710if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1747if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1780if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1829if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1866if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1915if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1952if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2001if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2054if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2091if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2100return TypeUtils.IsInteger(left) 2101&& TypeUtils.GetNonNullableType(right) == typeof(int); 2313if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2362if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2399if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2448if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2484if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2532if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) {
Microsoft\Scripting\Ast\BlockExpression.cs (2)
780if (!TypeUtils.AreReferenceAssignable(type, last.Type)) { 785if (!TypeUtils.AreEquivalent(type, last.Type)) {
Microsoft\Scripting\Ast\CatchBlock.cs (1)
165ContractUtils.Requires(variable == null || TypeUtils.AreEquivalent(variable.Type, type), "variable");
Microsoft\Scripting\Ast\ConditionalExpression.cs (3)
164if (!TypeUtils.AreEquivalent(ifTrue.Type, ifFalse.Type)) { 196if (!TypeUtils.AreReferenceAssignable(type, ifTrue.Type) || 197!TypeUtils.AreReferenceAssignable(type, ifFalse.Type)) {
Microsoft\Scripting\Ast\ConstantExpression.cs (1)
129if (value == null && type.IsValueType && !TypeUtils.IsNullableType(type)) {
Microsoft\Scripting\Ast\DynamicExpression.cs (1)
1099TypeUtils.ValidateType(type);
Microsoft\Scripting\Ast\Expression.cs (1)
201if (!TypeUtils.AreReferenceAssignable(Type, newNode.Type)) throw Error.ReducedNotCompatible();
Microsoft\Scripting\Ast\ExpressionVisitor.cs (1)
670if (TypeUtils.AreEquivalent(before, after)) {
Microsoft\Scripting\Ast\GotoExpression.cs (1)
367if (!TypeUtils.AreReferenceAssignable(expectedType, value.Type)) {
Microsoft\Scripting\Ast\IndexExpression.cs (3)
317if (!TypeUtils.AreReferenceAssignable(parms[i].ParameterType, args[i].Type)) { 429TypeUtils.ValidateType(pType); 431if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) {
Microsoft\Scripting\Ast\InvocationExpression.cs (1)
195Type exprType = TypeUtils.FindGenericType(typeof(Expression<>), expression.Type);
Microsoft\Scripting\Ast\LabelTarget.cs (1)
98TypeUtils.ValidateType(type);
Microsoft\Scripting\Ast\LambdaExpression.cs (4)
269if (TypeUtils.CanCache(delegateType)) { 532if (TypeUtils.CanCache(delegateType)) { 556if (!TypeUtils.AreReferenceAssignable(pex.Type, pType)) { 567if (mi.ReturnType != typeof(void) && !TypeUtils.AreReferenceAssignable(mi.ReturnType, body.Type)) {
Microsoft\Scripting\Ast\MemberExpression.cs (2)
156if (!TypeUtils.AreReferenceAssignable(field.DeclaringType, expression.Type)) { 272if (!TypeUtils.IsValidInstanceType(property, expression.Type)) {
Microsoft\Scripting\Ast\MethodCallExpression.cs (6)
829if (!TypeUtils.IsValidInstanceType(method, instanceType)) { 894TypeUtils.ValidateType(pType); 895if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) { 923if (TypeUtils.IsSameOrSubclass(quoteable, parameterType) && 985if (!TypeUtils.AreReferenceAssignable(pType, argType) && 986!(TypeUtils.IsSameOrSubclass(typeof(LambdaExpression), pType) && pType.IsAssignableFrom(arg.GetType()))) {
Microsoft\Scripting\Ast\NewArrayExpression.cs (2)
160if (!TypeUtils.AreReferenceAssignable(type, expr.Type)) { 220if (!TypeUtils.IsInteger(expr.Type)) {
Microsoft\Scripting\Ast\NewExpression.cs (4)
168TypeUtils.ValidateType(constructor.DeclaringType); 244if (!TypeUtils.AreEquivalent(member.DeclaringType, constructor.DeclaringType)) { 249if (!TypeUtils.AreReferenceAssignable(memberType, arg.Type)) { 259if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) {
Microsoft\Scripting\Ast\SwitchExpression.cs (4)
109!TypeUtils.AreEquivalent(_switchValue.Type, _comparison.GetParametersCached()[0].ParameterType.GetNonRefType()); 256if (!TypeUtils.AreEquivalent(firstTestValue.Type, c.TestValues[i].Type)) { 293if (!TypeUtils.AreReferenceAssignable(resultType, @case.Type)) { 298if (!TypeUtils.AreEquivalent(resultType, @case.Type)) {
Microsoft\Scripting\Ast\TryExpression.cs (3)
206if (!TypeUtils.AreReferenceAssignable(type, tryBody.Type)) { 210if (!TypeUtils.AreReferenceAssignable(type, cb.Body.Type)) { 226if (cb.Body == null || !TypeUtils.AreEquivalent(cb.Body.Type, type)) {
Microsoft\Scripting\Ast\TypeBinaryExpression.cs (1)
114if (!TypeUtils.AreReferenceAssignable(typeof(object), expression.Type)) {
Microsoft\Scripting\Ast\TypeUtils.cs (8)
236Type nnSourceType = TypeUtils.GetNonNullableType(source); 237Type nnDestType = TypeUtils.GetNonNullableType(dest); 442Type nnExprType = TypeUtils.GetNonNullableType(convertFrom); 443Type nnConvType = TypeUtils.GetNonNullableType(convertToType); 456if (!TypeUtils.AreEquivalent(nnExprType, convertFrom) || 457!TypeUtils.AreEquivalent(nnConvType, convertToType)) { 474if (!TypeUtils.AreEquivalent(mi.ReturnType, typeTo)) { 478if (!TypeUtils.AreEquivalent(pis[0].ParameterType, typeFrom)) {
Microsoft\Scripting\Ast\UnaryExpression.cs (43)
92bool operandIsNullable = TypeUtils.IsNullableType(_operand.Type); 93bool resultIsNullable = TypeUtils.IsNullableType(this.Type); 95return (operandIsNullable && !TypeUtils.AreEquivalent(_method.GetParametersCached()[0].ParameterType, _operand.Type)) || 96(resultIsNullable && !TypeUtils.AreEquivalent(_method.ReturnType, this.Type)); 108return IsLifted && TypeUtils.IsNullableType(this.Type); 376Type nnOperandType = TypeUtils.GetNonNullableType(operandType); 383if (TypeUtils.IsNullableType(operandType)) { 386if (method != null && method.ReturnType.IsValueType && !TypeUtils.IsNullableType(method.ReturnType)) { 387return new UnaryExpression(unaryType, operand, TypeUtils.GetNullableType(method.ReturnType), method); 404if (TypeUtils.IsNullableType(operand.Type) && 405ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(operand.Type)) && 406method.ReturnType.IsValueType && !TypeUtils.IsNullableType(method.ReturnType)) { 407return new UnaryExpression(unaryType, operand, TypeUtils.GetNullableType(method.ReturnType), method); 422MethodInfo method = TypeUtils.GetUserDefinedCoercionMethod(expression.Type, convertToType, false); 437if (ParameterIsAssignable(pms[0], operand.Type) && TypeUtils.AreEquivalent(method.ReturnType, convertToType)) { 441if ((TypeUtils.IsNullableType(operand.Type) || TypeUtils.IsNullableType(convertToType)) && 442ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(operand.Type)) && 443TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(convertToType))) { 472if (TypeUtils.IsArithmetic(expression.Type) && !TypeUtils.IsUnsignedInt(expression.Type)) { 503if (TypeUtils.IsArithmetic(expression.Type)) { 534if (TypeUtils.IsArithmetic(expression.Type) && !TypeUtils.IsUnsignedInt(expression.Type)) { 565if (TypeUtils.IsIntegerOrBool(expression.Type)) { 595if (TypeUtils.IsBool(expression.Type)) { 621if (TypeUtils.IsBool(expression.Type)) { 647if (TypeUtils.IsInteger(expression.Type)) { 664TypeUtils.ValidateType(type); 666if (type.IsValueType && !TypeUtils.IsNullableType(type)) { 685TypeUtils.ValidateType(type); 714TypeUtils.ValidateType(type); 717if (TypeUtils.HasIdentityPrimitiveOrNullableConversion(expression.Type, type) || 718TypeUtils.HasReferenceConversion(expression.Type, type)) { 751TypeUtils.ValidateType(type); 754if (TypeUtils.HasIdentityPrimitiveOrNullableConversion(expression.Type, type)) { 757if (TypeUtils.HasReferenceConversion(expression.Type, type)) { 832TypeUtils.ValidateType(type); 859if (TypeUtils.IsArithmetic(expression.Type)) { 885if (TypeUtils.IsArithmetic(expression.Type)) { 984if (TypeUtils.IsArithmetic(expression.Type)) { 998if (!TypeUtils.AreReferenceAssignable(expression.Type, result.Type)) {
Microsoft\Scripting\Compiler\DelegateHelpers.Generated.cs (1)
196if (TypeUtils.CanCache(lookingUp)) {
Microsoft\Scripting\Compiler\ILGen.cs (25)
597if (TypeUtils.AreEquivalent(typeFrom, typeTo)) { 605bool isTypeFromNullable = TypeUtils.IsNullableType(typeFrom); 606bool isTypeToNullable = TypeUtils.IsNullableType(typeTo); 608Type nnExprType = TypeUtils.GetNonNullableType(typeFrom); 609Type nnType = TypeUtils.GetNonNullableType(typeTo); 617TypeUtils.IsLegalExplicitVariantDelegateConversion(typeFrom, typeTo)) 622} else if (!(TypeUtils.IsConvertible(typeFrom) && TypeUtils.IsConvertible(typeTo)) // primitive runtime conversion 655bool isFromUnsigned = TypeUtils.IsUnsigned(typeFrom); 656bool isFromFloatingPoint = TypeUtils.IsFloatingPoint(typeFrom); 773Debug.Assert(TypeUtils.IsNullableType(typeFrom)); 774Debug.Assert(TypeUtils.IsNullableType(typeTo)); 789Type nnTypeFrom = TypeUtils.GetNonNullableType(typeFrom); 790Type nnTypeTo = TypeUtils.GetNonNullableType(typeTo); 808Debug.Assert(!TypeUtils.IsNullableType(typeFrom)); 809Debug.Assert(TypeUtils.IsNullableType(typeTo)); 812Type nnTypeTo = TypeUtils.GetNonNullableType(typeTo); 822Debug.Assert(TypeUtils.IsNullableType(typeFrom)); 823Debug.Assert(!TypeUtils.IsNullableType(typeTo)); 832Debug.Assert(TypeUtils.IsNullableType(typeFrom)); 833Debug.Assert(!TypeUtils.IsNullableType(typeTo)); 840Type nnTypeFrom = TypeUtils.GetNonNullableType(typeFrom); 846Debug.Assert(TypeUtils.IsNullableType(typeFrom)); 854bool isTypeFromNullable = TypeUtils.IsNullableType(typeFrom); 855bool isTypeToNullable = TypeUtils.IsNullableType(typeTo);
Microsoft\Scripting\Compiler\LambdaCompiler.Address.cs (9)
81if (TypeUtils.AreEquivalent(type, node.Type)) { 85if (TypeUtils.IsNullableType(rightType)) { 92Type indexType = TypeUtils.GetNonNullableType(rightType); 103if (TypeUtils.AreEquivalent(type, node.Type)) { 116if (TypeUtils.AreEquivalent(type, node.Type)) { 182if (!TypeUtils.AreEquivalent(type, node.Type) || node.Indexer != null) { 199Debug.Assert(type.IsValueType && !TypeUtils.IsNullableType(type)); 207Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 224if (TypeUtils.AreEquivalent(type, node.Type)) {
Microsoft\Scripting\Compiler\LambdaCompiler.Binary.cs (39)
58if (ConstantCheck.IsNull(b.Left) && !ConstantCheck.IsNull(b.Right) && TypeUtils.IsNullableType(b.Right.Type)) { 62if (ConstantCheck.IsNull(b.Right) && !ConstantCheck.IsNull(b.Left) && TypeUtils.IsNullableType(b.Left.Type)) { 82Debug.Assert(TypeUtils.IsNullableType(e.Type)); 102ParameterExpression p1 = Expression.Variable(TypeUtils.GetNonNullableType(b.Left.Type), null); 103ParameterExpression p2 = Expression.Variable(TypeUtils.GetNonNullableType(b.Right.Type), null); 107resultType = TypeUtils.GetNullableType(mc.Type); 122resultType = TypeUtils.GetNullableType(mc.Type); 137bool leftIsNullable = TypeUtils.IsNullableType(leftType); 138bool rightIsNullable = TypeUtils.IsNullableType(rightType); 162Debug.Assert(!TypeUtils.IsNullableType(leftType)); 163Debug.Assert(!TypeUtils.IsNullableType(rightType)); 177if (TypeUtils.IsFloatingPoint(leftType)) { 179} else if (TypeUtils.IsUnsigned(leftType)) { 189if (TypeUtils.IsFloatingPoint(leftType)) { 191} else if (TypeUtils.IsUnsigned(leftType)) { 201if (TypeUtils.IsFloatingPoint(leftType)) { 203} else if (TypeUtils.IsUnsigned(leftType)) { 210if (TypeUtils.IsUnsigned(leftType)) { 217if (TypeUtils.IsUnsigned(leftType)) { 232if (TypeUtils.IsUnsigned(leftType)) { 241if (TypeUtils.IsUnsigned(leftType)) { 254if (TypeUtils.IsUnsigned(leftType)) { 263if (TypeUtils.IsUnsigned(leftType)) { 288if (TypeUtils.IsUnsigned(leftType)) { 337Debug.Assert(TypeUtils.IsNullableType(leftType) || TypeUtils.IsNullableType(rightType)); 383Debug.Assert(TypeUtils.IsNullableType(leftType)); 466TypeUtils.GetNonNullableType(leftType), 467TypeUtils.GetNonNullableType(rightType), 468TypeUtils.GetNonNullableType(resultType), 476if (!TypeUtils.AreEquivalent(resultType, TypeUtils.GetNonNullableType(resultType))) { 477_ilg.EmitConvertToType(TypeUtils.GetNonNullableType(resultType), resultType, true); 493bool leftIsNullable = TypeUtils.IsNullableType(leftType); 494bool rightIsNullable = TypeUtils.IsNullableType(rightType); 540EmitBinaryOperator(op, TypeUtils.GetNonNullableType(leftType), TypeUtils.GetNonNullableType(rightType), TypeUtils.GetNonNullableType(resultType), false); 543ConstructorInfo ci = resultType.GetConstructor(new Type[] { TypeUtils.GetNonNullableType(resultType) });
Microsoft\Scripting\Compiler\LambdaCompiler.ControlFlow.cs (1)
239_labelInfo.Add(label, new LabelInfo(_ilg, label, TypeUtils.AreReferenceAssignable(lambda.ReturnType, label.Type)));
Microsoft\Scripting\Compiler\LambdaCompiler.Expressions.cs (17)
136if (!TypeUtils.AreEquivalent(node.Type, type)) { 138Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 930if (!TypeUtils.AreReferenceAssignable(variables[i].Type, TypeUtils.GetNonNullableType(arguments[i].Type))) { 938Debug.Assert(TypeUtils.AreEquivalent(TypeUtils.GetNonNullableType(resultType), TypeUtils.GetNonNullableType(mc.Type))); 952if (TypeUtils.IsNullableType(arg.Type)) { 977if (TypeUtils.IsNullableType(resultType) && !TypeUtils.AreEquivalent(resultType, mc.Type)) { 983if (TypeUtils.AreEquivalent(resultType, TypeUtils.GetNullableType(mc.Type))) { 1010if (TypeUtils.AreEquivalent(resultType, TypeUtils.GetNullableType(mc.Type))) { 1028if (TypeUtils.IsNullableType(arg.Type)) { 1068if (TypeUtils.IsNullableType(resultType) && !TypeUtils.AreEquivalent(resultType, mc.Type)) {
Microsoft\Scripting\Compiler\LambdaCompiler.Logical.cs (13)
98if (TypeUtils.IsNullableType(b.Left.Type)) { 122Type nnLeftType = TypeUtils.GetNonNullableType(b.Left.Type); 142} else if (!TypeUtils.AreEquivalent(b.Type, nnLeftType)) { 155if (!TypeUtils.AreEquivalent(b.Right.Type, b.Type)) { 203if (!TypeUtils.AreEquivalent(b.Right.Type, b.Type)) { 211if (!TypeUtils.AreEquivalent(b.Left.Type, b.Type)) { 283MethodInfo opFalse = TypeUtils.GetBooleanOperator(b.Method.DeclaringType, "op_False"); 410MethodInfo opTrue = TypeUtils.GetBooleanOperator(b.Method.DeclaringType, "op_True"); 532if (TypeUtils.IsNullableType(node.Right.Type)) { 541if (TypeUtils.IsNullableType(node.Left.Type)) { 549} else if (TypeUtils.IsNullableType(node.Left.Type) || TypeUtils.IsNullableType(node.Right.Type)) { 573if (TypeUtils.AreReferenceAssignable(convert.Type, convert.Operand.Type)) {
Microsoft\Scripting\Compiler\LambdaCompiler.Statements.cs (4)
195Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 221result = TypeUtils.GetNullableType(result); 253IsUnsigned = TypeUtils.IsUnsigned(Type); 329!TypeUtils.AreEquivalent(type, node.Cases[0].TestValues[0].Type)) {
Microsoft\Scripting\Compiler\LambdaCompiler.Unary.cs (11)
81} else if (node.NodeType == ExpressionType.NegateChecked && TypeUtils.IsInteger(node.Operand.Type)) { 98bool operandIsNullable = TypeUtils.IsNullableType(operandType); 125Type nnOperandType = TypeUtils.GetNonNullableType(operandType); 146Debug.Assert(TypeUtils.AreEquivalent(operandType, resultType)); 160Type nnOperandType = TypeUtils.GetNonNullableType(resultType); 182if (TypeUtils.IsNullableType(resultType)) { 224if (TypeUtils.IsNullableType(resultType)) { 272Debug.Assert(node.Type.IsValueType && !TypeUtils.IsNullableType(node.Type)); 324if (TypeUtils.AreEquivalent(node.Operand.Type, node.Type)) { 337ParameterExpression v = Expression.Variable(TypeUtils.GetNonNullableType(node.Operand.Type), null); 340Type resultType = TypeUtils.GetNullableType(mc.Type);
Microsoft\Scripting\Compiler\StackSpiller.cs (1)
152TypeUtils.AreReferenceAssignable(node.Type, result.Node.Type),
Microsoft\Scripting\Utils\TypeExtensions.cs (2)
53if (t != null && TypeUtils.CanCache(t)) { 106if (!TypeUtils.AreReferenceAssignable(ps[i].ParameterType, argTypes[i])) {