30 overrides of Type
System.Core (29)
Microsoft\Scripting\Ast\BinaryExpression.cs (4)
465public sealed override Type Type { 480public sealed override Type Type { 508public sealed override Type Type { 545public sealed override Type Type {
Microsoft\Scripting\Ast\BlockExpression.cs (1)
88public override Type Type {
Microsoft\Scripting\Ast\ConditionalExpression.cs (1)
68public override Type Type {
Microsoft\Scripting\Ast\ConstantExpression.cs (1)
57public override Type Type {
Microsoft\Scripting\Ast\DebugInfoExpression.cs (1)
50public sealed override Type Type {
Microsoft\Scripting\Ast\DefaultExpression.cs (1)
41public sealed override Type Type {
Microsoft\Scripting\Ast\DynamicExpression.cs (1)
96public override Type Type {
Microsoft\Scripting\Ast\GotoExpression.cs (1)
74public sealed override Type Type {
Microsoft\Scripting\Ast\IndexExpression.cs (1)
72public sealed override Type Type {
Microsoft\Scripting\Ast\InvocationExpression.cs (1)
53public sealed override Type Type {
Microsoft\Scripting\Ast\LabelExpression.cs (1)
46public sealed override Type Type {
Microsoft\Scripting\Ast\LambdaExpression.cs (1)
75public sealed override Type Type {
Microsoft\Scripting\Ast\ListInitExpression.cs (1)
64public sealed override Type Type {
Microsoft\Scripting\Ast\LoopExpression.cs (1)
50public sealed override Type Type {
Microsoft\Scripting\Ast\MemberExpression.cs (2)
116public sealed override Type Type { 132public sealed override Type Type {
Microsoft\Scripting\Ast\MemberInitExpression.cs (1)
47public sealed override Type Type {
Microsoft\Scripting\Ast\MethodCallExpression.cs (1)
63public sealed override Type Type {
Microsoft\Scripting\Ast\NewArrayExpression.cs (1)
60public sealed override Type Type {
Microsoft\Scripting\Ast\NewExpression.cs (1)
55public override Type Type {
Microsoft\Scripting\Ast\ParameterExpression.cs (1)
88public override Type Type {
Microsoft\Scripting\Ast\RuntimeVariablesExpression.cs (1)
47public sealed override Type Type {
Microsoft\Scripting\Ast\SwitchExpression.cs (1)
57public sealed override Type Type {
Microsoft\Scripting\Ast\TryExpression.cs (1)
63public sealed override Type Type {
Microsoft\Scripting\Ast\TypeBinaryExpression.cs (1)
50public sealed override Type Type {
Microsoft\Scripting\Ast\UnaryExpression.cs (1)
55public sealed override Type Type {
System.Data.Entity (1)
System\Data\Objects\ELinq\Funcletizer.cs (1)
676public override Type Type
1070 references to Type
System.Activities (42)
Microsoft\VisualBasic\Activities\VisualBasicDesignerHelper.cs (1)
491EnsureTypeReferenced(memberExpression.Type, false, typeReferences);
Microsoft\VisualBasic\Activities\VisualBasicHelper.cs (2)
466Fx.Assert(finalBody.Type == lambdaReturnType, "Compiler generated ExpressionTree return type doesn't match the target return type"); 573Fx.Assert(finalBody.Type == lambdaReturnType, "Compiler generated ExpressionTree return type doesn't match the target return type");
System\Activities\Expressions\ExpressionServices.cs (13)
58Type operandType = unaryExpressionBody.Operand.Type; 65Type leftType = binaryExpressionBody.Left.Type; 66Type rightType = binaryExpressionBody.Right.Type; 76Type memberType = memberExpressionBody.Expression == null ? memberExpressionBody.Member.DeclaringType : memberExpressionBody.Expression.Type; 179Type memberType = memberExpressionBody.Expression == null ? memberExpressionBody.Member.DeclaringType : memberExpressionBody.Expression.Type; 185Type leftType = binaryExpressionBody.Left.Type; 186Type rightType = binaryExpressionBody.Right.Type; 254MethodInfo specializedHandle = TryConvertIndexerReferenceHandle.MakeGenericMethod(methodCallExpressionBody.Object.Type, typeof(TResult)); 688if (memberExpression != null && TypeHelper.AreTypesCompatible(memberExpression.Type, typeof(RuntimeArgument))) 1317error = TryConvertArgumentExpressionHandle.MakeGenericMethod(methodCallExpression.Object.Type).Invoke(null, parameters) as string; 1333if (invocationExpression.Expression == null || invocationExpression.Expression.Type == null) 1349string error = TryConvertArgumentExpressionHandle.MakeGenericMethod(invocationExpression.Expression.Type).Invoke(null, parameters) as string; 1472string error = TryConvertArgumentExpressionHandle.MakeGenericMethod(expression.Type).Invoke(null, parameters) as string;
System\Activities\Expressions\OperatorPermissionHelper.cs (1)
44return Expression.Block(expression.Type, demandExpression, expression);
System\Activities\ExpressionUtilities.cs (25)
75if (targetType != null && body.Type != targetType) 245delegateParameterTypes[parameterCount] = expression.Type; 250MethodInfo typedMethod = createLocationFactoryGenericMethod.MakeGenericMethod(expression.Type); 528if (argument.Type.IsValueType) 1404publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(argumentExpression.Type, originalExpression, e)); 1425publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(argumentExpression.Type, originalExpression, SR.SubexpressionResultWasNull(argumentExpression.Type))); 1432publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(argumentExpression.Type, originalExpression, SR.SubexpressionResultWasNotVisible(argumentExpression.Type))); 1453if (contextExpression.Type == activityContextType) 1479if (contextExpression.Type == activityContextType) 1513if (contextExpression.Type == activityContextType) 1539if (contextExpression.Type == activityContextType) 1641publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(locationReferenceExpression.Type, originalExpression, e)); 1648publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(locationReferenceExpression.Type, originalExpression, SR.SubexpressionResultWasNull(locationReferenceExpression.Type))); 1653publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(locationReferenceExpression.Type, originalExpression, SR.SubexpressionResultWasNotVisible(locationReferenceExpression.Type))); 1677if (TypeHelper.AreTypesCompatible(parameterExpression.Type, typeof(Argument))) 1681publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(parameterExpression.Type, originalExpression, SR.SubexpressionResultWasNotVisible(parameterExpression.Type))); 1685else if (TypeHelper.AreTypesCompatible(parameterExpression.Type, typeof(LocationReference))) 1689publicAccessor.ActivityMetadata.AddValidationError(SR.ErrorExtractingValuesForLambdaRewrite(parameterExpression.Type, originalExpression, SR.SubexpressionResultWasNotVisible(parameterExpression.Type))); 1715if (TypeHelper.AreTypesCompatible(locationReference.Type, locationReferenceType))
System.Core (606)
Microsoft\Scripting\Actions\BindingRestrictions.cs (1)
117ContractUtils.Requires(expression.Type == typeof(bool), "expression");
Microsoft\Scripting\Actions\CallSite.cs (1)
731if (TypeUtils.AreReferenceAssignable(type, arg.Type)) {
Microsoft\Scripting\Actions\DynamicMetaObject.cs (2)
116Type ct = Expression.Type; 138return RuntimeType ?? Expression.Type;
Microsoft\Scripting\Actions\DynamicMetaObjectBinder.cs (4)
118!TypeUtils.AreReferenceAssignable(expectedResult, body.Type)) { 125throw Error.DynamicObjectResultNotAssignable(body.Type, target.Value.GetType(), this, expectedResult); 127throw Error.DynamicBinderResultNotAssignable(body.Type, this, expectedResult); 225/// <param name="type">The <see cref="Expression.Type">Type</see> property of the resulting expression; any type is allowed.</param>
Microsoft\Scripting\Actions\DynamicObject.cs (2)
398args[i].Type 741if (TypeUtils.AreEquivalent(Expression.Type, typeof(DynamicObject))) {
Microsoft\Scripting\Actions\ExpandoObject.cs (2)
849binder.GetUpdateExpression(ifTestSucceeds.Type) 887if (TypeUtils.AreEquivalent(Expression.Type, LimitType)) {
Microsoft\Scripting\Ast\BinaryExpression.cs (233)
221ParameterExpression temp1 = Variable(member.Expression.Type, "temp1"); 233ParameterExpression temp2 = Variable(e2.Type, "temp2"); 266var tempObj = Expression.Variable(index.Object.Type, "tempObj"); 272var tempArg = Expression.Variable(arg.Type, "tempArg" + tempArgs.Count); 287var tempValue = Expression.Variable(op.Type, "tempValue"); 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); 360Type left = _left.Type; 361Type right = _right.Type; 376Type left = _left.Type; 377Type right = _right.Type; 418var left = Parameter(_left.Type, "left"); 419var right = Parameter(Right.Type, "right"); 443Type 445Constant(null, Type) 449Constant(null, Type) 481get { return Left.Type; } 509get { return Right.Type; } 580TypeUtils.ValidateType(left.Type); 581TypeUtils.ValidateType(right.Type); 582if (!TypeUtils.AreReferenceAssignable(left.Type, right.Type)) { 583throw Error.ExpressionTypeDoesNotMatchAssignment(right.Type, left.Type); 593MethodInfo method = GetUserDefinedBinaryOperator(binaryType, left.Type, right.Type, name); 598if (TypeUtils.IsNullableType(left.Type) && TypeUtils.IsNullableType(right.Type)) { 599Type nnLeftType = TypeUtils.GetNonNullableType(left.Type); 600Type nnRightType = TypeUtils.GetNonNullableType(right.Type); 620if (ParameterIsAssignable(pms[0], left.Type) && ParameterIsAssignable(pms[1], right.Type)) { 621ValidateParamswithOperandsOrThrow(pms[0].ParameterType, left.Type, binaryType, method.Name); 622ValidateParamswithOperandsOrThrow(pms[1].ParameterType, right.Type, binaryType, method.Name); 627if (TypeUtils.IsNullableType(left.Type) && TypeUtils.IsNullableType(right.Type) && 628ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(left.Type)) && 629ParameterIsAssignable(pms[1], TypeUtils.GetNonNullableType(right.Type)) && 644if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type)) { 650b = new OpAssignMethodConversionBinaryExpression(b.NodeType, b.Left, b.Right, b.Left.Type, b.Method, conversion); 660ValidateParamswithOperandsOrThrow(pis[0].ParameterType, left.Type, binaryType, name); 661ValidateParamswithOperandsOrThrow(pis[1].ParameterType, right.Type, binaryType, name); 664throw Error.BinaryOperatorNotDefined(binaryType, left.Type, right.Type); 671if (!TypeUtils.AreReferenceAssignable(left.Type, b.Type)) { 677b = new OpAssignMethodConversionBinaryExpression(b.NodeType, b.Left, b.Right, b.Left.Type, b.Method, conversion); 748if (IsNullConstant(left) && !IsNullConstant(right) && TypeUtils.IsNullableType(right.Type)) { 751if (IsNullConstant(right) && !IsNullConstant(left) && TypeUtils.IsNullableType(left.Type)) { 985if (TypeUtils.HasReferenceEquality(left.Type, right.Type)) { 988throw Error.ReferenceEqualityNotDefined(left.Type, right.Type); 1032if (TypeUtils.HasReferenceEquality(left.Type, right.Type)) { 1035throw Error.ReferenceEqualityNotDefined(left.Type, right.Type); 1040if (left.Type == right.Type && (TypeUtils.IsNumeric(left.Type) || 1041left.Type == typeof(object) || 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) { 1062throw Error.BinaryOperatorNotDefined(binaryType, left.Type, right.Type); 1195if (left.Type == right.Type && TypeUtils.IsNumeric(left.Type)) { 1196if (TypeUtils.IsNullableType(left.Type) && liftToNull) { 1235if (left.Type == right.Type) { 1236if (left.Type == typeof(bool)) { 1238} else if (left.Type == typeof(bool?)) { 1239return new SimpleBinaryExpression(ExpressionType.AndAlso, left, right, left.Type); 1242method = GetUserDefinedBinaryOperator(ExpressionType.AndAlso, left.Type, right.Type, "op_BitwiseAnd"); 1244ValidateUserDefinedConditionalLogicOperator(ExpressionType.AndAlso, left.Type, right.Type, method); 1245returnType = (TypeUtils.IsNullableType(left.Type) && TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(left.Type))) ? left.Type : method.ReturnType; 1248throw Error.BinaryOperatorNotDefined(ExpressionType.AndAlso, left.Type, right.Type); 1250ValidateUserDefinedConditionalLogicOperator(ExpressionType.AndAlso, left.Type, right.Type, method); 1251returnType = (TypeUtils.IsNullableType(left.Type) && TypeUtils.AreEquivalent(method.ReturnType, TypeUtils.GetNonNullableType(left.Type))) ? left.Type : method.ReturnType; 1281if (left.Type == right.Type) { 1282if (left.Type == typeof(bool)) { 1284} else if (left.Type == typeof(bool?)) { 1285return new SimpleBinaryExpression(ExpressionType.OrElse, left, right, left.Type); 1288method = GetUserDefinedBinaryOperator(ExpressionType.OrElse, left.Type, right.Type, "op_BitwiseOr"); 1290ValidateUserDefinedConditionalLogicOperator(ExpressionType.OrElse, left.Type, right.Type, method); 1291returnType = (TypeUtils.IsNullableType(left.Type) && method.ReturnType == TypeUtils.GetNonNullableType(left.Type)) ? left.Type : method.ReturnType; 1294throw Error.BinaryOperatorNotDefined(ExpressionType.OrElse, left.Type, right.Type); 1296ValidateUserDefinedConditionalLogicOperator(ExpressionType.OrElse, left.Type, right.Type, method); 1297returnType = (TypeUtils.IsNullableType(left.Type) && method.ReturnType == TypeUtils.GetNonNullableType(left.Type)) ? left.Type : method.ReturnType; 1330Type resultType = ValidateCoalesceArgTypes(left.Type, right.Type); 1334if (left.Type.IsValueType && !TypeUtils.IsNullableType(left.Type)) { 1353if (!TypeUtils.AreEquivalent(method.ReturnType, right.Type)) { 1358if (!ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(left.Type)) && 1359!ParameterIsAssignable(pms[0], left.Type)) { 1412if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1413return new SimpleBinaryExpression(ExpressionType.Add, left, right, left.Type); 1462if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1467return new SimpleBinaryExpression(ExpressionType.AddAssign, left, right, left.Type); 1483if (!TypeUtils.AreEquivalent(mi.ReturnType, left.Type)) { 1538if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1543return new SimpleBinaryExpression(ExpressionType.AddAssignChecked, left, right, left.Type); 1575if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1576return new SimpleBinaryExpression(ExpressionType.AddChecked, left, right, left.Type); 1608if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1609return new SimpleBinaryExpression(ExpressionType.Subtract, left, right, left.Type); 1657if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1662return new SimpleBinaryExpression(ExpressionType.SubtractAssign, left, right, left.Type); 1710if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1715return new SimpleBinaryExpression(ExpressionType.SubtractAssignChecked, left, right, left.Type); 1747if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1748return new SimpleBinaryExpression(ExpressionType.SubtractChecked, left, right, left.Type); 1780if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1781return new SimpleBinaryExpression(ExpressionType.Divide, left, right, left.Type); 1829if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1834return new SimpleBinaryExpression(ExpressionType.DivideAssign, left, right, left.Type); 1866if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1867return new SimpleBinaryExpression(ExpressionType.Modulo, left, right, left.Type); 1915if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1920return new SimpleBinaryExpression(ExpressionType.ModuloAssign, left, right, left.Type); 1952if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 1953return new SimpleBinaryExpression(ExpressionType.Multiply, left, right, left.Type); 2001if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2006return new SimpleBinaryExpression(ExpressionType.MultiplyAssign, left, right, left.Type); 2054if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2059return new SimpleBinaryExpression(ExpressionType.MultiplyAssignChecked, left, right, left.Type); 2091if (left.Type == right.Type && TypeUtils.IsArithmetic(left.Type)) { 2092return new SimpleBinaryExpression(ExpressionType.MultiplyChecked, left, right, left.Type); 2137if (IsSimpleShift(left.Type, right.Type)) { 2138Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2187if (IsSimpleShift(left.Type, right.Type)) { 2192Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2225if (IsSimpleShift(left.Type, right.Type)) { 2226Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2275if (IsSimpleShift(left.Type, right.Type)) { 2280Type resultType = GetResultTypeOfShift(left.Type, right.Type); 2313if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2314return new SimpleBinaryExpression(ExpressionType.And, left, right, left.Type); 2362if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2367return new SimpleBinaryExpression(ExpressionType.AndAssign, left, right, left.Type); 2399if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2400return new SimpleBinaryExpression(ExpressionType.Or, left, right, left.Type); 2448if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2453return new SimpleBinaryExpression(ExpressionType.OrAssign, left, right, left.Type); 2484if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2485return new SimpleBinaryExpression(ExpressionType.ExclusiveOr, left, right, left.Type); 2532if (left.Type == right.Type && TypeUtils.IsIntegerOrBool(left.Type)) { 2537return new SimpleBinaryExpression(ExpressionType.ExclusiveOrAssign, left, right, left.Type); 2571throw Error.BinaryOperatorNotDefined(ExpressionType.Power, left.Type, right.Type); 2621throw Error.BinaryOperatorNotDefined(ExpressionType.PowerAssign, left.Type, right.Type); 2641if (index.Type != typeof(int)) { 2645Type arrayType = array.Type;
Microsoft\Scripting\Ast\BlockExpression.cs (4)
89get { return GetExpression(ExpressionCount - 1).Type; } 757return Block(expressionList.Last().Type, variables, expressionList); 780if (!TypeUtils.AreReferenceAssignable(type, last.Type)) { 785if (!TypeUtils.AreEquivalent(type, last.Type)) {
Microsoft\Scripting\Ast\CatchBlock.cs (5)
108/// The <see cref="Type"/> of object to be caught can be specified but no reference to the object 111/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 133/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 157/// <param name="type">The <see cref="Type"/> of <see cref="Exception"/> this <see cref="CatchBlock"/> will handle.</param> 172if (filter.Type != typeof(bool)) throw Error.ArgumentMustBeBoolean();
Microsoft\Scripting\Ast\ConditionalExpression.cs (12)
46if (ifTrue.Type != type || ifFalse.Type != type) { 48} if (ifFalse is DefaultExpression && ifFalse.Type == typeof(void)) { 69get { return IfTrue.Type; } 161if (test.Type != typeof(bool)) { 164if (!TypeUtils.AreEquivalent(ifTrue.Type, ifFalse.Type)) { 168return ConditionalExpression.Make(test, ifTrue, ifFalse, ifTrue.Type); 178/// <param name="type">A <see cref="Type"/> to set the <see cref="P:Expression.Type"/> property equal to.</param> 191if (test.Type != typeof(bool)) { 196if (!TypeUtils.AreReferenceAssignable(type, ifTrue.Type) || 197!TypeUtils.AreReferenceAssignable(type, ifFalse.Type)) {
Microsoft\Scripting\Ast\DebugViewWriter.cs (1)
951if (node.Type != node.GetExpression(node.ExpressionCount - 1).Type) {
Microsoft\Scripting\Ast\DynamicExpression.cs (11)
896arg0.Type, 934arg1.Type, 936arg0.Type, 977arg2.Type, 979arg1.Type, 981arg0.Type, 1025arg3.Type, 1027arg2.Type, 1029arg1.Type, 1031arg0.Type, 1097var type = arg.Type;
Microsoft\Scripting\Ast\Expression.cs (4)
73/// <param name="type">The <see cref="Type"/> of the <see cref="Expression"/>.</param> 113/// The <see cref="Type"/> of the value represented by this <see cref="Expression"/>. 201if (!TypeUtils.AreReferenceAssignable(Type, newNode.Type)) throw Error.ReducedNotCompatible();
Microsoft\Scripting\Ast\Expression.DebuggerProxy.cs (2)
49public Type Type { get { return _node.Type; } } 282public Type Type { get { return _node.Type; } }
Microsoft\Scripting\Ast\ExpressionStringBuilder.cs (8)
283if (node.Type == typeof(bool) || node.Type == typeof(bool?)) { 290if (node.Type == typeof(bool) || node.Type == typeof(bool?)) { 297if (node.Type == typeof(bool) || node.Type == typeof(bool?)) { 304if (node.Type == typeof(bool) || node.Type == typeof(bool?)) {
Microsoft\Scripting\Ast\ExpressionVisitor.cs (6)
638ValidateChildType(before.Operand.Type, after.Operand.Type, "VisitUnary"); 650ValidateChildType(before.Left.Type, after.Left.Type, "VisitBinary"); 651ValidateChildType(before.Right.Type, after.Right.Type, "VisitBinary");
Microsoft\Scripting\Ast\GotoExpression.cs (2)
367if (!TypeUtils.AreReferenceAssignable(expectedType, value.Type)) { 370throw Error.ExpressionTypeDoesNotMatchLabel(value.Type, expectedType);
Microsoft\Scripting\Ast\IndexExpression.cs (11)
51Debug.Assert(instance != null && instance.Type.IsArray); 52Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 77return _instance.Type.GetElementType(); 184Type arrayType = array.Type; 196if (e.Type != typeof(int)) { 217PropertyInfo pi = FindInstanceProperty(instance.Type, propertyName, arguments); 248foreach (var t in arguments.Select(arg => arg.Type)) { 317if (!TypeUtils.AreReferenceAssignable(parms[i].ParameterType, args[i].Type)) { 410ValidateCallInstanceType(instance.Type, method); 431if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) { 433throw Error.ExpressionTypeDoesNotMatchMethodParameter(arg.Type, pType, method);
Microsoft\Scripting\Ast\InvocationExpression.cs (4)
193Type delegateType = expression.Type; 194if (!expression.Type.IsSubclassOf(typeof(MulticastDelegate))) { 195Type exprType = TypeUtils.FindGenericType(typeof(Expression<>), expression.Type); 197throw Error.ExpressionTypeNotInvocable(expression.Type);
Microsoft\Scripting\Ast\LambdaExpression.cs (14)
403/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 415/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 426/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 438/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 482typeArgs[paramCount] = body.Type; 495/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 507/// <param name="delegateType">A <see cref="Type"/> representing the delegate signature for the lambda.</param> 567if (mi.ReturnType != typeof(void) && !TypeUtils.AreReferenceAssignable(mi.ReturnType, body.Type)) { 569throw Error.ExpressionTypeDoesNotMatchReturn(body.Type, mi.ReturnType); 591/// Creates a <see cref="Type"/> object that represents a generic System.Func delegate type that has specific type arguments. 607/// Creates a <see cref="Type"/> object that represents a generic System.Func delegate type that has specific type arguments. 622/// Creates a <see cref="Type"/> object that represents a generic System.Action delegate type that has specific type arguments. 637/// Creates a <see cref="Type"/> object that represents a generic System.Action delegate type that has specific type arguments. 651/// Gets a <see cref="Type"/> object that represents a generic System.Func or System.Action delegate type that has specific type arguments.
Microsoft\Scripting\Ast\MemberAssignment.cs (1)
75if (!memberType.IsAssignableFrom(expression.Type)) {
Microsoft\Scripting\Ast\MemberExpression.cs (17)
156if (!TypeUtils.AreReferenceAssignable(field.DeclaringType, expression.Type)) { 157throw Error.FieldInfoNotDefinedForType(field.DeclaringType, field.Name, expression.Type); 173FieldInfo fi = expression.Type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 175fi = expression.Type.GetField(fieldName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 178throw Error.InstanceFieldNotDefinedForType(fieldName, expression.Type); 188/// <param name="type">The <see cref="Type"/> containing the field.</param> 220PropertyInfo pi = expression.Type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 222pi = expression.Type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 225throw Error.InstancePropertyNotDefinedForType(propertyName, expression.Type); 234/// <param name="type">The <see cref="Type"/> containing the property.</param> 272if (!TypeUtils.IsValidInstanceType(property, expression.Type)) { 273throw Error.PropertyNotDefinedForType(property, expression.Type); 332PropertyInfo pi = expression.Type.GetProperty(propertyOrFieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 335FieldInfo fi = expression.Type.GetField(propertyOrFieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 338pi = expression.Type.GetProperty(propertyOrFieldName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 341fi = expression.Type.GetField(propertyOrFieldName, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); 345throw Error.NotAMemberOfType(propertyOrFieldName, expression.Type);
Microsoft\Scripting\Ast\MemberInitExpression.cs (2)
100var objVar = Expression.Variable(objExpression.Type, null); 112var listVar = Expression.Variable(listExpression.Type, null);
Microsoft\Scripting\Ast\MethodCallExpression.cs (10)
759return Expression.Call(instance, FindMethod(instance.Type, methodName, typeArguments, arguments, flags), arguments); 824ValidateCallInstanceType(instance.Type, method); 895if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) { 900throw Error.ExpressionTypeDoesNotMatchConstructorParameter(arg.Type, pType); 902throw Error.ExpressionTypeDoesNotMatchParameter(arg.Type, pType); 905throw Error.ExpressionTypeDoesNotMatchMethodParameter(arg.Type, pType, method); 980Type argType = arg.Type; 1029Type arrayType = array.Type; 1041if (e.Type != typeof(int)) { 1046MethodInfo mi = array.Type.GetMethod("Get", BindingFlags.Public | BindingFlags.Instance);
Microsoft\Scripting\Ast\NewArrayExpression.cs (5)
160if (!TypeUtils.AreReferenceAssignable(type, expr.Type)) { 162throw Error.ExpressionTypeCannotInitializeArrayType(expr.Type, type); 190/// <param name="type">A <see cref="Type"/> that represents the element type of the array.</param> 201/// <param name="type">A <see cref="Type"/> that represents the element type of the array.</param> 220if (!TypeUtils.IsInteger(expr.Type)) {
Microsoft\Scripting\Ast\NewExpression.cs (5)
207/// <param name="type">A <see cref="Type"/> that has a constructor that takes no arguments. </param> 249if (!TypeUtils.AreReferenceAssignable(memberType, arg.Type)) { 251throw Error.ArgumentTypeDoesNotMatchMember(arg.Type, memberType); 259if (!TypeUtils.AreReferenceAssignable(pType, arg.Type)) { 261throw Error.ExpressionTypeDoesNotMatchConstructorParameter(arg.Type, pType);
Microsoft\Scripting\Ast\SwitchExpression.cs (12)
107if (_switchValue.Type.IsNullableType()) { 109!TypeUtils.AreEquivalent(_switchValue.Type, _comparison.GetParametersCached()[0].ParameterType.GetNonRefType()); 202if (switchValue.Type == typeof(void)) throw Error.ArgumentCannotBeOfTypeVoid(); 209Type resultType = type ?? caseList[0].Body.Type; 221if (!ParameterIsAssignable(leftParam, switchValue.Type)) { 222liftedCall = ParameterIsAssignable(leftParam, switchValue.Type.GetNonNullableType()); 224throw Error.SwitchValueTypeDoesNotMatchComparisonMethodParameter(switchValue.Type, leftParam.ParameterType); 235Type rightOperandType = c.TestValues[i].Type; 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 (7)
198return new TryExpression(type ?? body.Type, body, @finally, fault, @catch); 206if (!TypeUtils.AreReferenceAssignable(type, tryBody.Type)) { 210if (!TypeUtils.AreReferenceAssignable(type, cb.Body.Type)) { 215} else if (tryBody == null || tryBody.Type == typeof(void)) { 218if (cb.Body != null && cb.Body.Type != typeof(void)) { 224type = tryBody.Type; 226if (cb.Body == null || !TypeUtils.AreEquivalent(cb.Body.Type, type)) {
Microsoft\Scripting\Ast\TypeBinaryExpression.cs (6)
80Type cType = Expression.Type; 97return Expression.NotEqual(Expression, Expression.Constant(null, Expression.Type)); 99return Expression.ReferenceNotEqual(Expression, Expression.Constant(null, Expression.Type)); 114if (!TypeUtils.AreReferenceAssignable(typeof(object), expression.Type)) { 193/// <param name="type">A <see cref="Type"/> to set the <see cref="TypeBinaryExpression.TypeOperand"/> property equal to.</param> 207/// <param name="type">A <see cref="Type"/> to set the <see cref="TypeBinaryExpression.TypeOperand"/> property equal to.</param>
Microsoft\Scripting\Ast\UnaryExpression.cs (55)
92bool operandIsNullable = TypeUtils.IsNullableType(_operand.Type); 95return (operandIsNullable && !TypeUtils.AreEquivalent(_method.GetParametersCached()[0].ParameterType, _operand.Type)) || 167return new UnaryExpression(functional, operand, operand.Type, _method); 182var temp = Parameter(_operand.Type, null); 197var temp1 = Parameter(member.Expression.Type, null); 219var temp2 = Parameter(member.Type, null); 251temps[i] = Parameter(index.Object.Type, null); 256args[i - 1] = temps[i] = Parameter(arg.Type, null); 298/// <param name="type">The <see cref="Type"></see> that specifies the type to be converted to (pass null if not applicable).</param> 311/// <param name="type">The <see cref="Type"></see> that specifies the type to be converted to (pass null if not applicable).</param> 367ValidateParamswithOperandsOrThrow(u.Method.GetParametersCached()[0].ParameterType, operand.Type, unaryType, name); 370throw Error.UnaryOperatorNotDefined(unaryType, operand.Type); 374Type operandType = operand.Type; 399if (ParameterIsAssignable(pms[0], operand.Type)) { 400ValidateParamswithOperandsOrThrow(pms[0].ParameterType, operand.Type, unaryType, method.Name); 404if (TypeUtils.IsNullableType(operand.Type) && 405ParameterIsAssignable(pms[0], TypeUtils.GetNonNullableType(operand.Type)) && 418throw Error.CoercionOperatorNotDefined(expression.Type, convertToType); 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)) && 472if (TypeUtils.IsArithmetic(expression.Type) && !TypeUtils.IsUnsignedInt(expression.Type)) { 473return new UnaryExpression(ExpressionType.Negate, expression, expression.Type, null); 503if (TypeUtils.IsArithmetic(expression.Type)) { 504return new UnaryExpression(ExpressionType.UnaryPlus, expression, expression.Type, null); 534if (TypeUtils.IsArithmetic(expression.Type) && !TypeUtils.IsUnsignedInt(expression.Type)) { 535return new UnaryExpression(ExpressionType.NegateChecked, expression, expression.Type, null); 565if (TypeUtils.IsIntegerOrBool(expression.Type)) { 566return new UnaryExpression(ExpressionType.Not, expression, expression.Type, null); 595if (TypeUtils.IsBool(expression.Type)) { 596return new UnaryExpression(ExpressionType.IsFalse, expression, expression.Type, null); 621if (TypeUtils.IsBool(expression.Type)) { 622return new UnaryExpression(ExpressionType.IsTrue, expression, expression.Type, null); 647if (TypeUtils.IsInteger(expression.Type)) { 648return new UnaryExpression(ExpressionType.OnesComplement, expression, expression.Type, null); 681if (!expression.Type.IsInterface && expression.Type != typeof(object)) { 717if (TypeUtils.HasIdentityPrimitiveOrNullableConversion(expression.Type, type) || 718TypeUtils.HasReferenceConversion(expression.Type, type)) { 754if (TypeUtils.HasIdentityPrimitiveOrNullableConversion(expression.Type, type)) { 757if (TypeUtils.HasReferenceConversion(expression.Type, type)) { 774if (!array.Type.IsArray || !typeof(Array).IsAssignableFrom(array.Type)) { 777if (array.Type.GetArrayRank() != 1) { 836if (value.Type.IsValueType) throw Error.ArgumentMustNotHaveValueType(); 859if (TypeUtils.IsArithmetic(expression.Type)) { 860return new UnaryExpression(ExpressionType.Increment, expression, expression.Type, null); 885if (TypeUtils.IsArithmetic(expression.Type)) { 886return new UnaryExpression(ExpressionType.Decrement, expression, expression.Type, null); 984if (TypeUtils.IsArithmetic(expression.Type)) { 985return new UnaryExpression(kind, expression, expression.Type, null); 998if (!TypeUtils.AreReferenceAssignable(expression.Type, result.Type)) {
Microsoft\Scripting\Compiler\ConstantCheck.cs (1)
64Type operandType = operand.Type;
Microsoft\Scripting\Compiler\DelegateHelpers.Generated.cs (4)
59paramTypes[i + 1] = args[i].Type; 106curTypeInfo = NextTypeInfo(types[i].Type, curTypeInfo); 137Type paramType = mo.Expression.Type; 156Type paramType = mo.Expression.Type;
Microsoft\Scripting\Compiler\LambdaCompiler.Address.cs (15)
81if (TypeUtils.AreEquivalent(type, node.Type)) { 84Type rightType = node.Right.Type; 96_ilg.Emit(OpCodes.Ldelema, node.Type); 116if (TypeUtils.AreEquivalent(type, node.Type)) { 120EmitInstance(node.Expression, objectType = node.Expression.Type); 170node.Object.Type.IsArray && 171node.Method == node.Object.Type.GetMethod("Get", BindingFlags.Public | BindingFlags.Instance)) { 173MethodInfo mi = node.Object.Type.GetMethod("Address", BindingFlags.Public | BindingFlags.Instance); 192var address = node.Object.Type.GetMethod("Address", BindingFlags.Public | BindingFlags.Instance); 207Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 224if (TypeUtils.AreEquivalent(type, node.Type)) { 252EmitInstance(node.Expression, instanceType = node.Expression.Type); 264var valueLocal = GetLocal(node.Type); 290EmitInstance(node.Object, instanceType = node.Object.Type); 302var argLocal = GetLocal(arg.Type);
Microsoft\Scripting\Compiler\LambdaCompiler.Binary.cs (13)
53(b.Type == typeof(bool) || b.Type == typeof(bool?))) { 57Debug.Assert(!b.IsLiftedToNull || b.Type == typeof(bool?)); 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)) { 77EmitBinaryOperator(b.NodeType, b.Left.Type, b.Right.Type, b.Type, b.IsLiftedToNull); 82Debug.Assert(TypeUtils.IsNullableType(e.Type)); 90EmitAddress(e, e.Type); 91_ilg.EmitHasValue(e.Type); 102ParameterExpression p1 = Expression.Variable(TypeUtils.GetNonNullableType(b.Left.Type), null); 103ParameterExpression p2 = Expression.Variable(TypeUtils.GetNonNullableType(b.Right.Type), null);
Microsoft\Scripting\Compiler\LambdaCompiler.ControlFlow.cs (3)
132if (node.Type != typeof(void) && (flags & CompilationFlags.EmitAsVoidType) == 0) { 133_ilg.EmitDefault(node.Type); 194if (node.Type != typeof(void)) {
Microsoft\Scripting\Compiler\LambdaCompiler.Expressions.cs (30)
118if (node.Type == typeof(void)) { 136if (!TypeUtils.AreEquivalent(node.Type, type)) { 138Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 180if (typeof(LambdaExpression).IsAssignableFrom(expr.Type)) { 182expr = Expression.Call(expr, expr.Type.GetMethod("Compile", new Type[0])); 184expr = Expression.Call(expr, expr.Type.GetMethod("Invoke"), node.Arguments); 224EmitInstance(node.Object, objectType = node.Object.Type); 244EmitInstance(index.Object, objectType = index.Object.Type); 260_ilg.Emit(OpCodes.Stloc, temp = GetLocal(node.Type)); 279_ilg.Emit(OpCodes.Call, node.Object.Type.GetMethod("Get", BindingFlags.Public | BindingFlags.Instance)); 293_ilg.Emit(OpCodes.Call, node.Object.Type.GetMethod("Set", BindingFlags.Public | BindingFlags.Instance)); 322EmitInstance(obj, objectType = obj.Type); 326if (obj != null && obj.Type.IsValueType) { 359_ilg.EmitCall(callOp, mi, args.Map(a => a.Type)); 540Type type = node.Expression.Type; 655EmitInstance(lvalue.Expression, objectType = lvalue.Expression.Type); 666_ilg.Emit(OpCodes.Stloc, temp = GetLocal(node.Type)); 692EmitInstance(node.Expression, instanceType = node.Expression.Type); 743_ilg.EmitConvertToType(x.Type, typeof(int), true); 930if (!TypeUtils.AreReferenceAssignable(variables[i].Type, TypeUtils.GetNonNullableType(arguments[i].Type))) { 952if (TypeUtils.IsNullableType(arg.Type)) { 954EmitAddress(arg, arg.Type); 956_ilg.EmitHasValue(arg.Type); 960_ilg.EmitGetValueOrDefault(arg.Type); 965if (!arg.Type.IsValueType) { 1028if (TypeUtils.IsNullableType(arg.Type)) { 1029EmitAddress(arg, arg.Type); 1031_ilg.EmitHasValue(arg.Type); 1041_ilg.EmitGetValueOrDefault(arg.Type); 1044if (!arg.Type.IsValueType) {
Microsoft\Scripting\Compiler\LambdaCompiler.Logical.cs (45)
38Debug.Assert(node.Test.Type == typeof(bool)); 98if (TypeUtils.IsNullableType(b.Left.Type)) { 100} else if (b.Left.Type.IsValueType) { 113LocalBuilder loc = GetLocal(b.Left.Type); 119_ilg.EmitHasValue(b.Left.Type); 122Type nnLeftType = TypeUtils.GetNonNullableType(b.Left.Type); 126Debug.Assert(p.Type.IsAssignableFrom(b.Left.Type) || 133if (!p.Type.IsAssignableFrom(b.Left.Type)) { 135_ilg.EmitGetValueOrDefault(b.Left.Type); 142} else if (!TypeUtils.AreEquivalent(b.Type, nnLeftType)) { 144_ilg.EmitGetValueOrDefault(b.Left.Type); 145_ilg.EmitConvertToType(nnLeftType, b.Type, true); 148_ilg.EmitGetValueOrDefault(b.Left.Type); 155if (!TypeUtils.AreEquivalent(b.Right.Type, b.Type)) { 156_ilg.EmitConvertToType(b.Right.Type, b.Type, true); 163LocalBuilder loc = GetLocal(b.Left.Type); 203if (!TypeUtils.AreEquivalent(b.Right.Type, b.Type)) { 204if (b.Right.Type.IsValueType) { 205_ilg.Emit(OpCodes.Box, b.Right.Type); 207_ilg.Emit(OpCodes.Castclass, b.Type); 211if (!TypeUtils.AreEquivalent(b.Left.Type, b.Type)) { 212Debug.Assert(!b.Left.Type.IsValueType); 213_ilg.Emit(OpCodes.Castclass, b.Type); 289LocalBuilder locLeft = GetLocal(b.Left.Type); 294LocalBuilder locRight = GetLocal(b.Right.Type); 325} else if (b.Left.Type == typeof(bool?)) { 416LocalBuilder locLeft = GetLocal(b.Left.Type); 421LocalBuilder locRight = GetLocal(b.Right.Type); 441} else if (b.Left.Type == typeof(bool?)) { 481if (node.Type == typeof(bool)) { 532if (TypeUtils.IsNullableType(node.Right.Type)) { 533EmitAddress(node.Right, node.Right.Type); 534_ilg.EmitHasValue(node.Right.Type); 536Debug.Assert(!node.Right.Type.IsValueType); 541if (TypeUtils.IsNullableType(node.Left.Type)) { 542EmitAddress(node.Left, node.Left.Type); 543_ilg.EmitHasValue(node.Left.Type); 545Debug.Assert(!node.Left.Type.IsValueType); 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 (9)
177var switchValue = Expression.Parameter(node.SwitchValue.Type, "switchValue"); 195Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 215return node.Cases[0].TestValues[0].Type; 252Type = Node.SwitchValue.Type; 327Type type = node.SwitchValue.Type; 329!TypeUtils.AreEquivalent(type, node.Cases[0].TestValues[0].Type)) { 377LocalBuilder value = GetLocal(node.SwitchValue.Type); 604Expression.Equal(dictField, Expression.Constant(null, dictField.Type)), 715Type tryType = expr.Type;
Microsoft\Scripting\Compiler\LambdaCompiler.Unary.cs (10)
81} else if (node.NodeType == ExpressionType.NegateChecked && TypeUtils.IsInteger(node.Operand.Type)) { 83LocalBuilder loc = GetLocal(node.Operand.Type); 86_ilg.EmitConvertToType(typeof(int), node.Operand.Type, false); 89EmitBinaryOperator(ExpressionType.SubtractChecked, node.Operand.Type, node.Operand.Type, node.Type, false); 92EmitUnaryOperator(node.NodeType, node.Operand.Type, node.Type); 301if (node.IsLifted && (!node.Type.IsValueType || !node.Operand.Type.IsValueType)) { 324if (TypeUtils.AreEquivalent(node.Operand.Type, node.Type)) { 329_ilg.EmitConvertToType(node.Operand.Type, node.Type, node.NodeType == ExpressionType.ConvertChecked); 337ParameterExpression v = Expression.Variable(TypeUtils.GetNonNullableType(node.Operand.Type), null);
Microsoft\Scripting\Compiler\StackSpiller.Bindings.cs (5)
96if (target.Type.IsValueType && _binding.Member is System.Reflection.PropertyInfo) { 102ParameterExpression memberTemp = _spiller.MakeTemp(member.Type); 166if (target.Type.IsValueType && _binding.Member is System.Reflection.PropertyInfo) { 172ParameterExpression memberTemp = _spiller.MakeTemp(member.Type); 221ParameterExpression memberTemp = _spiller.MakeTemp(member.Type);
Microsoft\Scripting\Compiler\StackSpiller.cs (9)
152TypeUtils.AreReferenceAssignable(node.Type, result.Node.Type), 228node.Type, 263node.Type, 617ParameterExpression tempNew = MakeTemp(rewrittenNew.Type); 668ParameterExpression tempNew = MakeTemp(rewrittenNew.Type); 981if (instance != null && instance.Type.IsValueType && Type.GetTypeCode(instance.Type) == TypeCode.Object) { 982throw Error.TryNotSupportedForValueTypeInstances(instance.Type);
Microsoft\Scripting\Compiler\StackSpiller.Temps.cs (1)
272ParameterExpression temp = MakeTemp(expression.Type);
System\Linq\SequenceQuery.cs (12)
80Type iqType = TypeHelper.FindGenericType(typeof(IQueryable<>), expression.Type); 89if (!typeof(IQueryable<S>).IsAssignableFrom(expression.Type)){ 104Type execType = typeof(EnumerableExecutor<>).MakeGenericType(expression.Type); 112if (!typeof(S).IsAssignableFrom(expression.Type)) 151Type execType = typeof(EnumerableExecutor<>).MakeGenericType(expression.Type); 200if ((m.Method.IsStatic || m.Method.DeclaringType.IsAssignableFrom(obj.Type)) 249if (type.IsAssignableFrom(expr.Type)) 255if (!type.IsAssignableFrom(expr.Type) && type.IsArray && expr.NodeType == ExpressionType.NewArrayInit) { 256Type strippedType = StripExpression(expr.Type); 362if (!parameterType.IsAssignableFrom(arg.Type)) { 366if (!parameterType.IsAssignableFrom(arg.Type) && 367!parameterType.IsAssignableFrom(StripExpression(arg.Type))) {
System.Data.Entity (88)
System\Data\Common\Internal\Materialization\CoordinatorFactory.cs (1)
209if (typeof(IEntityWrapper).IsAssignableFrom(element.Type))
System\Data\Common\Internal\Materialization\CoordinatorScratchpad.cs (6)
274result = Expression.Constant(Translator.Compile(body.Type, body)); 400&& typeof(DbDataReader).IsAssignableFrom(test.Object.Type) 403if (ifFalse != null && (ifFalse.Object != null && typeof(DbDataReader).IsAssignableFrom(ifFalse.Object.Type) || IsUserExpressionMethod(ifFalse.Method))) 426if (typeof(DbDataReader).IsAssignableFrom(m.Type)) 514if (m.Object != null && typeof(DbDataReader).IsAssignableFrom(m.Object.Type)) 527return this.CreateInitializationArgumentReplacement(original, original.Type);
System\Data\Common\Internal\Materialization\Translator.cs (23)
92if (!typeof(IEntityWrapper).IsAssignableFrom(ReturnedExpression.Type)) 518Type delegateReturnType = body.Type; 713if (input.Type != type && !typeof(IEntityWrapper).IsAssignableFrom(input.Type)) 715if (type.IsAssignableFrom(input.Type)) 724MethodInfo checkedConvertMethod = Translator_CheckedConvert.MakeGenericMethod(input.Type, type); 851Debug.Assert(left.Type == right.Type, "equals with different types"); 852if (typeof(byte[]) == left.Type) 1119Expression result = Expression.Call(Shaper_Parameter, Shaper_SetState.MakeGenericMethod(value.Type), Expression.Constant(stateSlotNumber), value); 1129Expression result = Expression.Call(Shaper_Parameter, Shaper_SetStatePassthrough.MakeGenericMethod(value.Type), Expression.Constant(stateSlotNumber), value); 1182result = Expression.Condition(nullSentinelCheck, Emit_NullConstant(result.Type), result); 1453Expression discriminatorConstant = Expression.Constant(typeChoice.Key, discriminatorReader.Type); 1459if (discriminatorReader.Type == typeof(string)) 1555nullConstant = Emit_NullConstant(result.Type); 1564nullConstant = Emit_WrappedNullConstant(result.Type); 1569nullConstant = Emit_NullConstant(result.Type); 1746Type elementType = spannedResultReader.Type.GetGenericArguments()[0]; 1753if (typeof(EntityKey) == spannedResultReader.Type) 1762MethodInfo handleFullSpanElementMethod = Shaper_HandleFullSpanElement.MakeGenericMethod(arg.RequestedType, spannedResultReader.Type); 1908if (!arg.RequestedType.IsAssignableFrom(result.Type)) 2001Emit_Shaper_GetState(keyStateSlotNumber, keyReader.Type), 2019Expression.Constant(discriminatorValue, discriminator.Type),
System\Data\Objects\ELinq\Funcletizer.cs (11)
229if (!ClrProviderManifest.Instance.TryGetPrimitiveType(TypeSystem.GetNonNullableType(expression.Type), 240return (typeof(byte[]) == expression.Type); 373if (_funcletizer.TryGetTypeUsageForTerminal(exp.Type, out queryParameterType)) 420return EntityUtil.NotSupported(Strings.CompiledELinq_UnsupportedParameterTypes(expression.Type.FullName)); 426if (parameterExp.Type.Equals(expression.Type)) 434return EntityUtil.NotSupported(Strings.CompiledELinq_UnsupportedNamedParameterUseAsType(parameterExp.Name, expression.Type.FullName)); 474&& typeof(IQueryable).IsAssignableFrom(ue.Operand.Type)) 491result = InlineObjectQuery(inlineQuery, expression.Type); 505: Expression.Constant(value, expression.Type); 615_type = funcletizedExpression.Type; 717constantExpression = Expression.Constant(memberVal, expression.Type);
System\Data\Objects\ELinq\InitializerFacet.cs (5)
309return Expression.Call(UserExpressionMarker.MakeGenericMethod(newProjection.Type), newProjection); 315return _newExpression.Arguments.Select(arg => arg.Type); 403TypeSystem.GetDefaultValue(value.Type), value.Type)); 411return Expression.Call(UserExpressionMarker.MakeGenericMethod(newProjection.Type), newProjection);
System\Data\Objects\ELinq\LinqExpressionNormalizer.cs (5)
101input.Type == typeof(object)) 114while (ExpressionType.Convert == input.NodeType && typeof(object) == input.Type) 409if (lambda.Body.NodeType == ExpressionType.Coalesce && lambda.Body.Type == typeof(bool)) 453MethodInfo relationalOperatorPlaceholderMethod = s_relationalOperatorPlaceholderMethod.MakeGenericMethod(left.Type, right.Type);
System\Data\Objects\ELinq\MethodCallTranslator.cs (16)
348Type argumentType = convertExpression.Operand.Type; 434Debug.Assert(call.Object != null && call.Arguments.Count == 1 && call.Arguments[0] != null && call.Arguments[0].Type.Equals(typeof(string)), "Invalid Include arguments?"); 470Debug.Assert(call.Object != null && call.Arguments.Count == 1 && call.Arguments[0] != null && call.Arguments[0].Type.Equals(typeof(MergeOption)), "Invalid MergeAs arguments?"); 506Debug.Assert(call.Object != null && call.Arguments.Count == 1 && call.Arguments[0] != null && call.Arguments[0].Type.Equals(typeof(Span)), "Invalid IncludeSpan arguments?"); 709if (expression.Type.IsAssignableFrom(operand.Type)) 1612var joinCondition = parent.CreateEqualsExpression(outerKeySelector, innerKeySelector, EqualsPattern.PositiveNullEqualityNonComposable, outerLambda.Body.Type, innerLambda.Body.Type); 2245Type sourceArgumentType = TypeSystem.GetElementType(sourceExpression.Type); 2254return TranslateContainsHelper(parent, value, arguments, EqualsPattern.Store, sourceArgumentType, valueExpression.Type); 2263constantCqt = TranslateContainsHelper(parent, value, constantArguments, EqualsPattern.PositiveNullEqualityNonComposable, sourceArgumentType, valueExpression.Type); 2271otherCqt = TranslateContainsHelper(parent, value, otherArguments, EqualsPattern.PositiveNullEqualityComposable, sourceArgumentType, valueExpression.Type); 2286return sourceBinding.Filter(parent.CreateEqualsExpression(sourceBinding.Variable, value, pattern, sourceArgumentType, valueExpression.Type)).Exists(); 2722Type fromClrType = TypeSystem.GetElementType(call.Arguments[0].Type); 2880parent.CreateEqualsExpression(outerSelector, innerSelector, EqualsPattern.PositiveNullEqualityNonComposable, outerLambda.Body.Type, innerLambda.Body.Type));
System\Data\Objects\ELinq\ObjectQueryProvider.cs (4)
66if (!typeof(IQueryable<S>).IsAssignableFrom(expression.Type)) 103if (!typeof(IQueryable).IsAssignableFrom(expression.Type)) 110Type elementType = TypeSystem.GetElementType(expression.Type); 128ObjectQuery query = CreateQuery(expression, expression.Type);
System\Data\Objects\ELinq\Translator.cs (8)
668return parent.CreateIsNullExpression(argument, call.Expression.Type).Not(); 934DbExpression isNull = parent.CreateIsNullExpression(left, linq.Left.Type); 1028return parent.CreateEqualsExpression(cqtLeft, cqtRight, pattern, linqLeft.Type, linqRight.Type); 1038return parent.CreateIsNullExpression(inputCqt, input.Type); 1083TypeUsage toType = parent.GetIsOrAsTargetType(fromType, ExpressionType.TypeIs, linq.TypeOperand, linq.Expression.Type); 1269Type fromClrType = unary.Operand.Type; 1281TypeUsage toType = parent.GetIsOrAsTargetType(fromType, ExpressionType.TypeAs, unary.Type, unary.Operand.Type);
System\Data\Objects\ELinq\TypeSystem.cs (1)
93if (expression.Type != requiredType)
System\Data\SqlClient\SqlTypesAssembly.cs (8)
79PropertyInfo prop = exp.Type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public); 80Debug.Assert(prop != null, "Type '" + exp.Type.FullName + "' does not declare a public instance property with the name '" + propertyName + "'"); 535if (toConvert.Type == typeof(byte[])) 539else if (toConvert.Type == typeof(string)) 552Debug.Assert(toConvert.Type == typeof(System.Xml.XmlReader), "Argument to static constructor method was not byte[], string or XmlReader?"); 553if (toConvert.Type == typeof(System.Xml.XmlReader)) 566ConstructorInfo byteArrayCtor = sqlBytesType.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, new Type[] { toConvert.Type }, null); 598ConstructorInfo readerCtor = sqlXmlType.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, new Type[] { toConvert.Type }, null);
System.Data.Linq (90)
ChangeDirector.cs (5)
85if (cmd.Type == typeof(int)) { 138if (cmd.Type == typeof(int)) { 239return Expression.Call(typeof(DataManipulation), "Insert", new Type[] { item.Type.InheritanceRoot.Type, resultSelector.Body.Type }, Expression.Constant(item.Current), resultSelector); 336return Expression.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type, resultSelector.Body.Type }, Expression.Constant(tracked.Current), check, resultSelector); 339return Expression.Call(typeof(DataManipulation), "Update", new Type[] { rowTypeRoot.Type, resultSelector.Body.Type }, Expression.Constant(tracked.Current), resultSelector);
CompiledQuery.cs (1)
243return typeof(ITable).IsAssignableFrom(query.Body.Type);
DataContext.cs (3)
1150Type eType = System.Data.Linq.SqlClient.TypeSystem.GetElementType(expression.Type); 1152if (!qType.IsAssignableFrom(expression.Type)) { 1164if (!typeof(IQueryable<TResult>).IsAssignableFrom(expression.Type)) {
DataQuery.cs (3)
37Type eType = System.Data.Linq.SqlClient.TypeSystem.GetElementType(expression.Type); 39if (!qType.IsAssignableFrom(expression.Type)) 48if (!typeof(IQueryable<S>).IsAssignableFrom(expression.Type))
DataServices.cs (4)
257Type elementType = System.Data.Linq.SqlClient.TypeSystem.GetElementType(query.Type); 266return Expression.Call(typeof(Queryable), "Select", new Type[] { elementType, selector.Body.Type }, query, selector); 508Type elementType = System.Data.Linq.SqlClient.TypeSystem.GetElementType(query.Type); 559memex.Expression.NodeType != ExpressionType.Parameter || memex.Expression.Type != type.Type) {
DataShape.cs (1)
259if (!typeof(IEnumerable).IsAssignableFrom(subquery.Body.Type)) {
SqlClient\Query\Funcletizer.cs (6)
49return (e.NodeType == ExpressionType.Convert) ? Expression.Convert(local, e.Type) : Expression.ConvertChecked(local, e.Type); 119if (typeof(ITable).IsAssignableFrom(expression.Type) || 120typeof(DataContext).IsAssignableFrom(expression.Type)) { 128this.isRemote |= (m.Expression != null && typeof(ITable).IsAssignableFrom(m.Expression.Type)); 210if (exp.Type == typeof(TimeSpan))
SqlClient\Query\QueryConverter.cs (54)
100if (typeof(ITable).IsAssignableFrom(node.Type)) { 164if (node.Type == typeof(TimeSpan)) 406SqlSubSelect ms = sql.SubSelect(SqlNodeType.Multiset, select, exp.Type); 422return new SqlSelect(sql.SubSelect(SqlNodeType.Multiset, pselect, selector.Body.Type), alias, this.dominatingExpression); 595Type sourceType = TypeSystem.GetElementType(sequence.Type); 670b.Type, sql.TypeProvider.From(b.Type), 823TypeSystem.GetNonNullableType(qn.Type) == qn.Arguments[0].Type) { 1280if (u.Operand.Type == typeof(bool) || u.Operand.Type == typeof(bool?)) { 1301return sql.MethodCall(b.Type, b.Method, null, new SqlExpression[] { left, right }, dominatingExpression); 1309result = sql.Binary(SqlNodeType.Add, left, right, b.Type); 1313result = sql.Binary(SqlNodeType.Sub, left, right, b.Type); 1317result = sql.Binary(SqlNodeType.Mul, left, right, b.Type); 1320result = sql.Binary(SqlNodeType.Div, left, right, b.Type); 1323result = sql.Binary(SqlNodeType.Mod, left, right, b.Type); 1326if (b.Left.Type == typeof(bool) || b.Left.Type == typeof(bool?)) { 1327result = sql.Binary(SqlNodeType.And, left, right, b.Type); 1330result = sql.Binary(SqlNodeType.BitAnd, left, right, b.Type); 1334result = sql.Binary(SqlNodeType.And, left, right, b.Type); 1337if (b.Left.Type == typeof(bool) || b.Left.Type == typeof(bool?)) { 1338result = sql.Binary(SqlNodeType.Or, left, right, b.Type); 1341result = sql.Binary(SqlNodeType.BitOr, left, right, b.Type); 1345result = sql.Binary(SqlNodeType.Or, left, right, b.Type); 1348result = sql.Binary(SqlNodeType.LT, left, right, b.Type); 1351result = sql.Binary(SqlNodeType.LE, left, right, b.Type); 1354result = sql.Binary(SqlNodeType.GT, left, right, b.Type); 1357result = sql.Binary(SqlNodeType.GE, left, right, b.Type); 1360result = sql.Binary(SqlNodeType.EQ, left, right, b.Type); 1363result = sql.Binary(SqlNodeType.NE, left, right, b.Type); 1366result = sql.Binary(SqlNodeType.BitXor, left, right, b.Type); 1369result = this.MakeCoalesce(left, right, b.Type); 1426Type type = TypeSystem.GetElementType(source1.Type); 1450Type type = TypeSystem.GetElementType(source1.Type); 1485if (IsGrouping(expression.Body.Type)) { 1488if (!this.typeProvider.From(expression.Body.Type).IsOrderable) { 1489throw Error.TypeCannotBeOrdered(expression.Body.Type); 1508if (IsGrouping(expression.Body.Type)) { 1511if (!this.typeProvider.From(expression.Body.Type).IsOrderable) { 1512throw Error.TypeCannotBeOrdered(expression.Body.Type); 1655if (lambda != null && !TypeSystem.IsSimpleType(lambda.Body.Type)) { 1656throw Error.CannotAggregateType(lambda.Body.Type); 1662if (select.Selection.SqlType.IsRuntimeOnlyType && !IsGrouping(sequence.Type) && !isCount && lambda == null) { 1777Type elemType = TypeSystem.GetElementType(sequence.Type); 1793ParameterExpression p = Expression.Parameter(value.Type, "p"); 1867if (ma.Member.Name == "Count" && TypeSystem.IsSequenceType(ma.Expression.Type)) { 1933&& TypeSystem.GetElementType(mc.Method.DeclaringType).IsAssignableFrom(mc.Arguments[0].Type) 2384SqlSubSelect elem = sql.SubSelect(subType, select, sequence.Type); 2395MetaTable metaTable = this.services.Model.GetTable(item.Type); 2560MetaTable metaTable = this.services.Model.GetTable(item.Type); 2617seq = Expression.Call(typeof(Enumerable), "Select", new Type[] { rowType, resultSelector.Body.Type }, seq, resultSelector); 2644MetaTable metaTable = this.services.Model.GetTable(item.Type);
SqlClient\Query\Translator.cs (8)
165Type elementType = TypeSystem.GetElementType(source.Type); 176if (keyValue.Type != memberExpression.Type) 177keyValue = Expression.Convert(keyValue, memberExpression.Type); 231if (exp.Type != m.Expression.Type && m.Member.Name == "Count" && TypeSystem.IsSequenceType(exp.Type)) { 232return Expression.Call(typeof(Enumerable), "Count", new Type[] {TypeSystem.GetElementType(exp.Type)}, exp);
SqlClient\SqlProvider.cs (5)
1333if (query.Type == typeof(void)) { 1336else if (query.Type == typeof(IMultipleResults)) { 1340bool isSequence = typeof(IEnumerable).IsAssignableFrom(query.Type); 1341ProviderType pt = this.typeProvider.From(query.Type); 1398return query.Type;
System.Data.Services (100)
System\Data\Services\ExpandSegment.cs (3)
202if (lambda.Body.Type != typeof(bool) && lambda.Body.Type != typeof(bool?)) 205Strings.ExpandSegment_FilterBodyShouldReturnBool(lambda.Body.Type), "filter");
System\Data\Services\OpenTypes\OpenTypeMethods.cs (1)
716return expression.Type.IsValueType ? Expression.Convert(expression, typeof(object)) : expression;
System\Data\Services\Parsing\RequestQueryParser.cs (63)
51Type selectorType = selectorLambda.Body.Type; 260if (expr.Type != typeof(bool)) 301Debug.Assert(lastMatch.Type == typeof(bool), "Skip token should generate boolean expression."); 367else if (expr.Type == typeof(bool?)) 774int c = CompareConversions(args[i].Type, first.Current, second.Current); 893if (left.Type == typeof(byte[])) 912if (left.Type == typeof(byte[])) 1148if (expr.Type == typeof(bool) || expr.Type == typeof(Nullable<bool>)) 1155throw ParseError(Strings.RequestQueryParser_NotDoesNotSupportType(expr.Type)); 1223return expression != WebUtil.NullLiteral && expression.Type == typeof(object) && IsOpenExpression(expression); 1282while (input.NodeType == ExpressionType.Convert && input.Type == typeof(object)) 1298return left.Type.GetMethod(methodName, new Type[] { left.Type, right.Type }); 1338WebUtil.GetTypeName(left.Type), 1339WebUtil.GetTypeName(right.Type), 1454if (WebUtil.TypeAllowsNull(left.Type)) 1456if (!WebUtil.TypeAllowsNull(right.Type)) 1458right = Expression.Convert(right, typeof(Nullable<>).MakeGenericType(right.Type)); 1461else if (WebUtil.TypeAllowsNull(right.Type)) 1463left = Expression.Convert(left, typeof(Nullable<>).MakeGenericType(left.Type)); 1483return GenerateNotEqual(left, Expression.Constant(null, left.Type)); 1488GenerateNotEqual(left, Expression.Constant(null, left.Type)), 1490GenerateEqual(right, Expression.Constant(null, right.Type)), 1502return GenerateNotEqual(right, Expression.Constant(null, right.Type)); 1507GenerateNotEqual(right, Expression.Constant(null, left.Type)), 1509GenerateEqual(left, Expression.Constant(null, right.Type)), 1531if (equality && !left.Type.IsValueType && !right.Type.IsValueType) 1533if (left.Type != right.Type) 1537left = Expression.Constant(null, right.Type); 1541right = Expression.Constant(null, left.Type); 1543else if (left.Type.IsAssignableFrom(right.Type)) 1545right = Expression.Convert(right, left.Type); 1547else if (right.Type.IsAssignableFrom(left.Type)) 1549left = Expression.Convert(left, right.Type); 1567if (!WebUtil.TypeAllowsNull(left.Type)) 1569left = Expression.Convert(left, typeof(Nullable<>).MakeGenericType(left.Type)); 1571else if (!WebUtil.TypeAllowsNull(right.Type)) 1573right = Expression.Convert(right, typeof(Nullable<>).MakeGenericType(right.Type)); 1579Debug.Assert(!IsEnumType(left.Type), "!IsEnumType(left.Type)"); 1580Debug.Assert(!IsEnumType(right.Type), "!IsEnumType(right.Type)"); 1590if (left.Type == typeof(string)) 1595if (left.Type == typeof(bool)) 1599else if (left.Type == typeof(bool?)) 1604if (left.Type == typeof(Guid)) 1609if (left.Type == typeof(Guid?)) 1935if (typeExpression.Type == typeof(Type)) 1980Debug.Assert(candidateTypeArgument.Type == typeof(string), "First argument to 'cast' should have been a string"); 2036Type type = instance.Type; 2272if (!this.nullPropagationRequired || element == this.it || !WebUtil.TypeAllowsNull(element.Type)) 2286Expression test = Expression.Equal(element, Expression.Constant(null, element.Type)); 2288if (!WebUtil.TypeAllowsNull(falseIf.Type)) 2290falseIf = Expression.Convert(falseIf, typeof(Nullable<>).MakeGenericType(falseIf.Type)); 2293Expression trueIf = Expression.Constant(null, falseIf.Type); 2310throw ParseError(Strings.RequestQueryParser_IncompatibleOperand(operationName, WebUtil.GetTypeName(args[0].Type), errorPos)); 2470if (expr.Type == type) 2542if (IsCompatibleWith(expr.Type, type)) 2553if (WebUtil.IsNullableType(expr.Type) && type.IsValueType)
System\Data\Services\Providers\BasicExpandProvider.cs (31)
215Type elementType = ReflectionServiceProvider.GetIEnumerableElement(expression.Type); 239.MakeGenericMethod(query.ElementType, orderer.Body.Type) 266Type elementType = ReflectionServiceProvider.GetIEnumerableElement(expression.Type); 281.MakeGenericMethod(query.ElementType, orderer.Body.Type) 1253Debug.Assert(resourceType.InstanceType.IsAssignableFrom(source.Type), "Trying to access a property on expression of a wrong type."); 1283if (!WebUtil.TypeAllowsNull(expression.Type)) 1285expression = Expression.Convert(expression, WebUtil.GetTypeAllowingNull(expression.Type)); 1289Expression.Equal(source, Expression.Constant(null, source.Type)), 1290Expression.Constant(null, expression.Type), 1294Debug.Assert(property.Type.IsAssignableFrom(expression.Type), "The returned expression is not of the type of the property being accessed."); 1314Debug.Assert(expression.Type == typeof(object), "Open properties should always return 'object' type."); 1344expression.Type : 1345ReflectionServiceProvider.GetIEnumerableElement(expression.Type); 1395expression.Type : 1396ReflectionServiceProvider.GetIEnumerableElement(expression.Type); 1417Type[] typeArguments = new Type[] { parameter.Type, body.Type }; 1472WebUtil.TypeAllowsNull(propertyAccess.Type), 1489Expression.Equal(source, Expression.Constant(null, source.Type)), 1490Expression.Constant(null, propertyAccess.Type), 1593if (!WebUtil.TypeAllowsNull(propertyAccess.Type)) 1638if (this.ExpandProvider.castToObject && propertyAccess.Type != typeof(object)) 1672Expression.Constant(null, source.Type)), 1702Debug.Assert(typeIsExpression.Type == typeof(bool), "The type test expression should be of type bool."); 1706Debug.Assert(expression.Type == projectedWrapperType, "The projection expression is of a wrong type."); 1715Debug.Assert(WebUtil.TypeAllowsNull(expression.Type), "We should only project types which are nullable."); 1717Expression.Equal(source, Expression.Constant(null, source.Type)), 1718Expression.Constant(null, expression.Type), 1736Type expressionElementType = ReflectionServiceProvider.GetIEnumerableElement(expression.Type); 1757new Type[] { expressionElementType, updatedOrderingBody.Type }, 1806skipTokenTypes[i + 1] = ((LambdaExpression)this.OrderingInfo.OrderingExpressions[i].Expression).Body.Type;
System\Data\Services\RequestQueryProcessor.cs (2)
240Expression conditionFalse = Expression.Constant(null, conditionTrue.Type); 1221skipTokenTypes[i + 1] = ((LambdaExpression)ordering.Expression).Body.Type;
System.Data.Services.Client (73)
System\Data\Services\Client\ALinq\DataServiceExpressionVisitor.cs (3)
62rse = new ResourceSetExpression(rse.Type, source, rse.MemberExpression, rse.ResourceType, rse.ExpandPaths, rse.CountOption, rse.CustomQueryOptions, rse.Projection); 79npse = new NavigationPropertySingletonExpression(npse.Type, source, npse.MemberExpression, npse.MemberExpression.Type, npse.ExpandPaths, npse.CountOption, npse.CustomQueryOptions, npse.Projection);
System\Data\Services\Client\ALinq\DataServiceQueryProvider.cs (2)
49Type et = TypeSystem.GetElementType(expression.Type); 82return mi.MakeGenericMethod(expression.Type).Invoke(this, new object[] { expression });
System\Data\Services\Client\ALinq\Evaluator.cs (1)
175Type constantType = e.Type;
System\Data\Services\Client\ALinq\ExpressionNormalizer.cs (9)
170if ((visited.NodeType == ExpressionType.Convert || visited.NodeType == ExpressionType.TypeAs) && visited.Type.IsAssignableFrom(visited.Operand.Type)) 173if (!ClientConvert.IsKnownNullableType(visited.Operand.Type) && !ClientConvert.IsKnownNullableType(visited.Type) || visited.Operand.Type == visited.Type) 176if(!(ClientType.CheckElementTypeIsEntity(visited.Operand.Type) && ProjectionAnalyzer.IsCollectionProducingExpression(visited.Operand))) 195if (input.NodeType == ExpressionType.Constant && input.Type == typeof(object)) 208while (ExpressionType.Convert == input.NodeType && typeof(object) == input.Type) 489if (lambda.Body.NodeType == ExpressionType.Coalesce && lambda.Body.Type == typeof(bool)) 535MethodInfo relationalOperatorPlaceholderMethod = s_relationalOperatorPlaceholderMethod.MakeGenericMethod(left.Type, right.Type);
System\Data\Services\Client\ALinq\InputReferenceExpression.cs (1)
64Debug.Assert(newTarget.ResourceType.Equals(this.Type), "Cannot reference a resource set with a different resource type");
System\Data\Services\Client\ALinq\ProjectionAnalyzer.cs (27)
51if (ClientType.CheckElementTypeIsEntity(le.Body.Type)) 56re.Projection = new ProjectionQueryOptionExpression(le.Body.Type, le, new List<string>()); 82bool knownEntityType = ClientType.CheckElementTypeIsEntity(e.Body.Type); 153if (TypeSystem.FindIEnumerable(e.Type) != null) 155Type elementType = TypeSystem.GetElementType(e.Type); 158if (typeof(List<>).MakeGenericType(elementType).IsAssignableFrom(e.Type) || 159(dscType != null && dscType.IsAssignableFrom(e.Type))) 179if (me != null && ClientType.Create(me.Expression.Type, false).IsEntityType) 225resource.Projection = new ProjectionQueryOptionExpression(lambda.Body.Type, lambda, pb.ProjectionPaths.ToList()); 334bool sourceIsEntity = ClientType.CheckElementTypeIsEntity(lastExpression.Type); 356Type sourceType = Nullable.GetUnderlyingType(u.Operand.Type) ?? u.Operand.Type; 401if (!ClientType.CheckElementTypeIsEntity(m.Expression.Type) || IsCollectionProducingExpression(m.Expression)) 534var nepa = new NonEntityProjectionAnalyzer(pb, e.Type); 564if (ClientType.CheckElementTypeIsEntity(u.Operand.Type)) 575if (ClientType.CheckElementTypeIsEntity(b.Left.Type) || ClientType.CheckElementTypeIsEntity(b.Right.Type) 586if (ClientType.CheckElementTypeIsEntity(b.Expression.Type) || IsCollectionProducingExpression(b.Expression)) 603if (ClientType.CheckElementTypeIsEntity(c.Test.Type) || ClientType.CheckElementTypeIsEntity(c.IfTrue.Type) || ClientType.CheckElementTypeIsEntity(c.IfFalse.Type) 629if (ClientConvert.IsKnownNullableType(m.Expression.Type)) 635if (!ClientType.CheckElementTypeIsEntity(m.Expression.Type) || IsCollectionProducingExpression(m.Expression)) 667if ((m.Object != null ? ClientType.CheckElementTypeIsEntity(m.Object.Type) : false) 668|| m.Arguments.Any(a => ClientType.CheckElementTypeIsEntity(a.Type))) 678if (ClientType.CheckElementTypeIsEntity(iv.Expression.Type) || IsCollectionProducingExpression(iv.Expression) 679|| iv.Arguments.Any(a => ClientType.CheckElementTypeIsEntity(a.Type) || IsCollectionProducingExpression(a)))
System\Data\Services\Client\ALinq\ProjectionRewriter.cs (2)
70Type delegateType = typeof(Func<,>).MakeGenericType(new Type[] { newLambdaParameter.Type, lambda.Body.Type }); 87if (m.Type == this.newLambdaParameter.Type)
System\Data\Services\Client\ALinq\ResourceBinder.cs (12)
395var properties = PatternRules.GetKeyProperties(target.CreateReference().Type); 527ResourceExpression resultSelectorSource = CreateResourceSetExpression(mce.Method.ReturnType, source, collectorReference, TypeSystem.GetElementType(collectorReference.Type)); 671Type resourceType = TypeSystem.GetElementType(navPropRef.Type); 948NavigationPropertySingletonExpression newResource = new NavigationPropertySingletonExpression(type, source, memberExpression, memberExpression.Type, source.ExpandPaths.ToList(), source.CountOption, source.CustomQueryOptions.ToDictionary(kvp => kvp.Key, kvp => kvp.Value), null); 962/// <param name="expectedResultType">The result type - <see cref="Expression.Type"/> - that the new resource set expression should have.</param> 1041return new ResourceSetExpression(rse.Type, rse.Source, rse.MemberExpression, rse.ResourceType, null, CountOption.None, null, null); 1356return expression.Type.IsAssignableFrom(expression.Operand.Type); 1907return (TypeSystem.FindIEnumerable(e.Type) != null) && 1908e.Type != typeof(char[]) && 1909e.Type != typeof(byte[]); 2049be.Left.Type == typeof(string) && 2050be.Right.Type == typeof(string);
System\Data\Services\Client\ALinq\SkipQueryOptionExpression.cs (1)
66return new SkipQueryOptionExpression(this.Type, Expression.Constant(thisValue + previousValue, typeof(int)));
System\Data\Services\Client\ProjectionPath.cs (1)
57this.Add(new ProjectionPathSegment(this, ((MemberExpression)member).Member.Name, member.Type));
System\Data\Services\Client\ProjectionPathBuilder.cs (1)
143Type projectionType = lambda.Body.Type;
System\Data\Services\Client\ProjectionPlanCompiler.cs (13)
101result.ProjectedType = projection.Body.Type; 146if (!nullCheck.Match || !ClientType.CheckElementTypeIsEntity(nullCheck.AssignExpression.Type)) 199if (ClientConvert.IsKnownNullableType(baseSourceExpression.Type)) 366if (body.Type.IsValueType) 505Expression iftrue = Expression.Constant(null, assignForProjection.Type); 767expression.Type); 800Expression baseTypeExpression = Expression.Constant(baseSourceExpression.Type, typeof(Type)); 802ProjectionPathSegment nestedSegment = new ProjectionPathSegment(nestedPath, m.Member.Name, m.Type); 804result = this.CallValueForPathWithType(result, baseTypeExpression, nestedPath, m.Type); 815memberSegment = new ProjectionPathSegment(baseAnnotation.Segment.StartPath, m.Member.Name, m.Type); 821m.Type); 908typeof(DataServiceContext).IsAssignableFrom(result.Arguments[0].Type) && 1115Type enumeratedType = source.Type.GetGenericArguments()[0];
System.Web (1)
UI\WebControls\QueryExtensions.cs (1)
51new Type[] { source.ElementType, property.Type },
System.Web.DynamicData (4)
DynamicData\QueryableFilterUserControl.cs (3)
150if (Nullable.GetUnderlyingType(propertyExpression.Type) != null && value != null) { 151propertyExpression = Expression.Convert(propertyExpression, Misc.RemoveNullableFromType(propertyExpression.Type)); 153value = Misc.ChangeType(value, propertyExpression.Type);
DynamicData\Util\Misc.cs (1)
250var expression = Expression.Call(typeof(Queryable), ordering, new Type[] { query.ElementType, lambda.Body.Type }, query.Expression, lambda);
System.Web.Entity (1)
System\Data\WebControls\OrderByBuilder.cs (1)
202expression = Expression.Call(typeof(Queryable), methodName, new Type[] { source.ElementType, memberExpression.Type },
System.Web.Extensions (65)
UI\WebControls\Dynamic.cs (56)
47new Type[] { source.ElementType, lambda.Body.Type }, 68new Type[] { source.ElementType, o.Selector.Type }, 103new Type[] { source.ElementType, keyLambda.Body.Type, elementLambda.Body.Type }, 202typeArgs[paramCount] = body.Type; 766if (isEquality && !left.Type.IsValueType && !right.Type.IsValueType) { 767if (left.Type != right.Type) { 768if (left.Type.IsAssignableFrom(right.Type)) { 769right = Expression.Convert(right, left.Type); 771else if (right.Type.IsAssignableFrom(left.Type)) { 772left = Expression.Convert(left, right.Type); 779else if (IsEnumType(left.Type) || IsEnumType(right.Type)) { 780if (left.Type != right.Type) { 782if ((e = PromoteExpression(right, left.Type, true)) != null) { 785else if ((e = PromoteExpression(left, right.Type, true)) != null) { 833if (left.Type == typeof(string) || right.Type == typeof(string)) 1059if (test.Type != typeof(bool)) 1061if (expr1.Type != expr2.Type) { 1062Expression expr1as2 = expr2 != nullLiteral ? PromoteExpression(expr1, expr2.Type, true) : null; 1063Expression expr2as1 = expr1 != nullLiteral ? PromoteExpression(expr2, expr1.Type, true) : null; 1071string type1 = expr1 != nullLiteral ? expr1.Type.Name : "null"; 1072string type2 = expr2 != nullLiteral ? expr2.Type.Name : "null"; 1102properties.Add(new DynamicProperty(propName, expr.Type)); 1154Type exprType = expr.Type; 1172if (instance != null) type = instance.Type; 1239typeArgs = new Type[] { elementType, args[0].Type }; 1279if (expr.Type.IsArray) { 1280if (expr.Type.GetArrayRank() != 1 || args.Length != 1) 1291switch (FindIndexer(expr.Type, args, out mb)) { 1294GetTypeName(expr.Type)); 1299GetTypeName(expr.Type)); 1369opName, GetTypeName(args[0].Type)); 1384opName, GetTypeName(left.Type), GetTypeName(right.Type)); 1493if (expr.Type == type) return expr; 1524if (IsCompatibleWith(expr.Type, type)) { 1707int c = CompareConversions(args[i].Type, 1741if (left.Type == typeof(string)) { 1751if (left.Type == typeof(string)) { 1761if (left.Type == typeof(string)) { 1771if (left.Type == typeof(string)) { 1781if (left.Type == typeof(string) && right.Type == typeof(string)) { 1792if (left.Type.IsValueType) left = Expression.Convert(left, typeof(object)); 1793if (right.Type.IsValueType) right = Expression.Convert(right, typeof(object)); 1801return left.Type.GetMethod(methodName, new[] { left.Type, right.Type });
UI\WebControls\Expressions\ExpressionHelper.cs (2)
9Type realType = GetUnderlyingType(exp.Type); 10if (realType == exp.Type) {
UI\WebControls\Expressions\OrderByExpression.cs (1)
78propertyExpression.Type);
UI\WebControls\Expressions\PropertyExpression.cs (2)
24object value = ExpressionHelper.BuildObjectValue(pair.Value, property.Type); 27Expression valueExpression = Expression.Constant(value, property.Type);
UI\WebControls\Expressions\RangeExpression.cs (2)
99ConstantExpression constantValue = Expression.Constant(ExpressionHelper.BuildObjectValue(value, propertyExpression.Type)); 114ConstantExpression constantValue = Expression.Constant(ExpressionHelper.BuildObjectValue(value, propertyExpression.Type));
UI\WebControls\Expressions\SearchExpression.cs (2)
84return Expression.Call(property, SearchType.ToString(), Type.EmptyTypes, Expression.Constant(query, property.Type)); 86return Expression.Call(property, SearchType.ToString(), Type.EmptyTypes, Expression.Constant(query, property.Type), Expression.Constant(ComparisonType));