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