6 writes to Type
Microsoft.CSharp (6)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Assignment.cs (1)
21
set =>
Type
= (_lhs = value).Type;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprWithType.cs (1)
13
Type
= type;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\LocalVariable.cs (1)
15
Type
= local?.GetType();
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\NamedArgumentSpecification.cs (1)
24
set =>
Type
= (_value = value).Type;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Temporary.cs (1)
12
Type
= expression?.Type;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs (1)
27
set =>
Type
= (_userDefinedCall = value).Type;
240 references to Type
Microsoft.CSharp (240)
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (1)
704
Debug.Assert(pExpr.
Type
is NullType);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (5)
540
CType callingObjectType = callingObject.
Type
;
600
if (Name == SpecialNames.Invoke && callingObject.
Type
.IsDelegateType)
749
if (payload is InvokeBinder && !callingObject.
Type
.IsDelegateType)
897
methprop = ExpressionBinder.GroupToArgsBinder.FindMostDerivedMethod(methprop, callingObject.
Type
);
1171
Debug.Assert(callingObject.
Type
is ArrayType);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpArgInfo.cs (2)
19
type1 = arg1.
Type
;
20
type2 = arg2.
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (22)
358
BindImplicitConversion(expr, expr.
Type
, dest, flags);
372
if (BindImplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
375
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
384
FUNDTYPE ftSrc = expr.
Type
.FundamentalType;
388
expr.
Type
.IsSimpleType && dest.IsSimpleType)
399
if (expr.
Type
is NullType && dest.FundamentalType != FUNDTYPE.FT_REF)
406
throw ErrorHandling.Error(canCast(expr.
Type
, dest, flags) ? ErrorCode.ERR_NoImplicitConvCast : ErrorCode.ERR_NoImplicitConv, new ErrArg(expr.
Type
, ErrArgFlags.Unique), new ErrArg(dest, ErrArgFlags.Unique));
426
if (BindImplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
428
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
460
if (BindExplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
463
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
470
bool simpleConstToSimpleDestination = exprConst != null && expr.
Type
.IsSimpleOrEnum && dest.IsSimpleOrEnum;
474
FUNDTYPE exprType = expr.
Type
.FundamentalType;
488
if (!CanExplicitConversionBeBoundInUncheckedContext(expr, expr.
Type
, dest, flags | CONVERTTYPE.NOUDC))
521
if (expr.
Type
is NullType && dest.FundamentalType != FUNDTYPE.FT_REF)
533
Debug.Assert(expr.
Type
!= null);
534
return ErrorHandling.Error(ErrorCode.ERR_NoExplicitConv, new ErrArg(expr.
Type
, ErrArgFlags.Unique), new ErrArg(dest, ErrArgFlags.Unique));
656
Debug.Assert(exprSrc == null || exprSrc.
Type
== typeSrc);
1151
FUNDTYPE ftSrc = exprSrc.
Type
.FundamentalType;
1161
Expr expr = BindDecimalConstCast(typeDest, exprSrc.
Type
, constSrc);
1190
if (constSrc.
Type
.FundamentalType == FUNDTYPE.FT_U8)
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (3)
200
if (valueSrc.
Type
is NullableType)
205
Debug.Assert(valueSrc.
Type
== _typeSrc.StripNubs());
206
if (!_binder.BindExplicitConversion(valueSrc, valueSrc.
Type
, _typeDest, _needsExprDest, out _exprDest, _flags | CONVERTTYPE.NOUDC))
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (26)
284
allowExplicit ? mustCastCore(op2, op1.
Type
, 0) : mustConvertCore(op2, op1.
Type
);
311
ArrayType pArrayType = pOp1.
Type
as ArrayType;
376
exprSrc.
Type
.FundamentalType == typeDest.FundamentalType &&
377
(!exprSrc.
Type
.IsPredefType(PredefinedType.PT_STRING) || constant.Val.IsNullRef))
405
CType callingObjectType = pObject?.
Type
;
431
Debug.Assert(pResult.
Type
== VoidType.Instance);
520
type = pObjectThrough.
Type
;
539
verifyMethodArgs(result, pObjectThrough?.
Type
);
554
CType typeSrc = arg.
Type
;
660
return ExprFactory.CreateUserDefinedUnaryOperator(ek, call.
Type
, arg, call, pmethBest.mpwi);
668
if (!(arg.
Type
is NullableType) || !canConvert(arg.
Type
.StripNubs(), typeRaw, CONVERTTYPE.NOUDC))
673
Debug.Assert(arg.
Type
is NullableType);
814
Debug.Assert(pOperand1.
Type
!= null);
822
Debug.Assert(pOperand2.
Type
!= null);
823
return ErrorHandling.Error(ErrorCode.ERR_BadBinaryOps, strOp, pOperand1.
Type
, pOperand2.
Type
);
826
return ErrorHandling.Error(ErrorCode.ERR_BadUnaryOp, strOp, pOperand1.
Type
);
849
type = prop.OptionalObjectThrough.
Type
;
1012
CType typeObj = pObject.
Type
;
1079
!pObject.
Type
.IsStructOrEnum
1131
if (indir.
Type
is ParameterModifierType)
1358
Debug.Assert(arg.
Type
!= null);
1360
prgtype[iarg] = arg.
Type
;
1445
FUNDTYPE ftSrc = exprSrc.
Type
.FundamentalType;
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (1)
64
=> expr is ExprConstant constant && expr.
Type
.FundamentalType == FUNDTYPE.FT_REF && constant.Val.IsNullRef;
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (3)
196
ExprUnaryOp unary = CreateUnaryOp(ExpressionKind.Negate, operand.
Type
, operand);
205
CreateBinop(ExpressionKind.Sequence, second.
Type
, first, second);
222
ExprBinOp expr = CreateBinop(ExpressionKind.Save, wrap.
Type
, wrap.OptionalExpression, wrap);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (10)
109
return (pGroup.Flags & EXPRFLAG.EXF_CTOR) != 0 ? pGroup.ParentType : pGroup.OptionalObject?.
Type
;
326
CType pTypeThrough = _pGroup.OptionalObject?.
Type
;
478
prgTypes[i] = pArguments.prgexpr[i].
Type
;
579
FindMostDerivedMethod(pMethProp, pObject?.
Type
);
709
prgTypes[n] = _pArguments.prgexpr[n].
Type
;
1026
if (pType == pArgument.
Type
)
1152
if (_pGroup.OptionalObject?.
Type
!= null &&
1153
_pGroup.OptionalObject.
Type
.IsDelegateType &&
1159
nameErr = ((AggregateType)_pGroup.OptionalObject.
Type
).OwningAggregate.name;
1198
return _pGroup.OptionalObject?.
Type
is AggregateType agg && agg.OwningAggregate.IsDelegate()
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (6)
89
Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.
Type
); // type of source should be correct if source supplied
271
Debug.Assert(_exprSrc == null || _exprSrc.
Type
== _typeSrc);
349
Debug.Assert(exprTmp.
Type
== nubDst);
378
arg1, arg1.
Type
, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC)
380
arg1, arg1.
Type
, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC);
651
_exprSrc.
Type
.IsNumericType &&
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
525
Debug.Assert(obj == null || obj.
Type
!= null);
537
_typeQual = (_flags & MemLookFlags.Ctor) != 0 ? _typeSrc : obj?.
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (3)
42
Debug.Assert(exprSrc != null && exprSrc.
Type
is NullableType);
52
NullableType nubSrc = (NullableType)exprSrc.
Type
;
69
NullableType pNubSourceType = TypeManager.GetNullable(exprSrc.
Type
);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (96)
178
return ExprFactory.CreateUserDefinedBinop(ek, expr.
Type
, info.arg1, info.arg2, expr, pmpwi);
652
? GetEnumBinOpType(ek, nonLiftedArg1.
Type
, nonLiftedArg2.
Type
, out _)
653
: pArgument1.
Type
;
1183
CType type = pArgument.
Type
;
1307
pArgument = ExprFactory.CreateCast(pArgument.
Type
, pArgument);
1326
Debug.Assert(pArgument.
Type
!= null);
1329
CType pArgumentType = pArgument.
Type
;
1379
if (exprVal.
Type
!= null && exprVal.
Type
!= pArgumentType)
1421
Debug.Assert(pArgument.
Type
!= null);
1425
CType pArgumentType = pArgument.
Type
;
1544
Debug.Assert(arg?.
Type
!= null);
1545
if (arg.
Type
is NullType)
1597
Debug.Assert(arg1.
Type
.IsPredefined && arg2.
Type
.IsPredefined && arg1.
Type
.PredefinedType == arg2.
Type
.PredefinedType);
1598
return binder.BindIntOp(ek, flags, arg1, arg2, arg1.
Type
.PredefinedType);
1608
Debug.Assert(arg.
Type
.IsPredefined);
1609
return binder.BindIntOp(ek, flags, arg, null, arg.
Type
.PredefinedType);
1619
Debug.Assert(arg1.
Type
.IsPredefined && arg2.
Type
.IsPredefined && arg1.
Type
.PredefinedType == arg2.
Type
.PredefinedType);
1630
Debug.Assert(arg.
Type
.IsPredefined);
1745
ExprMultiGet exprGet = ExprFactory.CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.
Type
, null);
1758
Expr op = mustCast(exprVal, arg.
Type
, CONVERTTYPE.NOUDC);
1760
ExprMulti exprMulti = ExprFactory.CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.
Type
, arg, op);
1775
ExprMultiGet exprGet = ExprFactory.CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.
Type
, null);
1785
ExprUnaryOp exprRes = ExprFactory.CreateUnaryOp((ek == ExpressionKind.Add) ? ExpressionKind.Inc : ExpressionKind.Dec, arg.
Type
/* type */, exprVal);
1786
mustCast(mustCast(nonLiftedResult, type), arg.
Type
);
1789
ExprMulti exprMulti = ExprFactory.CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.
Type
, arg, exprRes);
1804
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.
Type
.IsPredefType(PredefinedType.PT_DECIMAL));
1847
Debug.Assert(arg.
Type
.IsPredefType(PredefinedType.PT_DECIMAL));
1869
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_STRING) || arg2.
Type
.IsPredefType(PredefinedType.PT_STRING));
1882
Debug.Assert(arg1.
Type
.IsPredefined);
1883
Debug.Assert(arg2.
Type
.IsPredefType(PredefinedType.PT_INT));
1885
PredefinedType ptOp = arg1.
Type
.PredefinedType;
1888
return ExprFactory.CreateBinop(ek, arg1.
Type
, arg1, arg2);
1902
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_BOOL) || arg1.
Type
is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1903
Debug.Assert(arg2.
Type
.IsPredefType(PredefinedType.PT_BOOL) || arg2.
Type
is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1913
Debug.Assert(expr1.
Type
.IsPredefType(PredefinedType.PT_BOOL) || expr1.
Type
is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1914
Debug.Assert(expr2.
Type
.IsPredefType(PredefinedType.PT_BOOL) || expr2.
Type
is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1916
if (expr1.
Type
is NullableType || expr2.
Type
is NullableType)
1926
if (!(nonLiftedArg1.
Type
is NullableType) && !(nonLiftedArg2.
Type
is NullableType))
1957
Debug.Assert(arg.
Type
.IsPredefType(PredefinedType.PT_BOOL));
1984
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_STRING) && arg2.
Type
.IsPredefType(PredefinedType.PT_STRING));
2020
Debug.Assert(arg1.
Type
== arg2.
Type
&& (arg1.
Type
.IsDelegateType || arg1.
Type
.IsPredefType(PredefinedType.PT_DELEGATE)));
2028
RetType = arg1.
Type
;
2034
RetType = arg1.
Type
;
2061
AggregateType typeDst = GetEnumBinOpType(ek, arg1.
Type
, arg2.
Type
, out AggregateType typeEnum);
2078
if (exprRes.
Type
!= typeDst)
2092
CType nonNullableType1 = arg1.
Type
is NullableType arg1NubType ? arg1NubType.UnderlyingType : arg1.
Type
;
2093
CType nonNullableType2 = arg2.
Type
is NullableType arg2NubType ? arg2NubType.UnderlyingType : arg2.
Type
;
2123
if (exprRes.
Type
!= typeDst)
2141
Debug.Assert(((ExprCast)arg).Argument.
Type
.IsEnumType);
2142
CType typeEnum = ((ExprCast)arg).Argument.
Type
;
2245
Debug.Assert(op1 != null && op1.
Type
== typeOp);
2246
Debug.Assert(op2 == null || op2.
Type
== typeOp);
2300
Debug.Assert(op != null && op.
Type
== typeOp);
2307
if (ptOp == PredefinedType.PT_UINT && op.
Type
.FundamentalType == FUNDTYPE.FT_U4)
2329
Debug.Assert(op2 == null || op1.
Type
== op2.
Type
);
2330
Debug.Assert(op1.
Type
.IsPredefType(PredefinedType.PT_FLOAT) || op1.
Type
.IsPredefType(PredefinedType.PT_DOUBLE));
2333
CType typeDest = kind.IsRelational() ? GetPredefindType(PredefinedType.PT_BOOL) : op1.
Type
;
2381
? ErrorHandling.Error(ErrorCode.ERR_AmbigBinaryOps, strOp, op1.
Type
, op2.
Type
)
2382
: ErrorHandling.Error(ErrorCode.ERR_AmbigUnaryOp, strOp, op1.
Type
);
2394
CType typeRet = pCall.
Type
;
2411
SymbolTable.PopulateSymbolTableWithName(SpecialNames.CLR_True, null, pExprWrap.
Type
.AssociatedSystemType);
2412
SymbolTable.PopulateSymbolTableWithName(SpecialNames.CLR_False, null, pExprWrap.
Type
.AssociatedSystemType);
2594
int cats = GetUserDefinedBinopArgumentTypes(arg1.
Type
, arg2.
Type
, rgats);
2653
CheckUnsafe(arg1.
Type
); // added to the binder so we don't bind to pointer ops
2654
CheckUnsafe(arg2.
Type
); // added to the binder so we don't bind to pointer ops
2689
if (!canConvert(arg1.
Type
.StripNubs(), paramsRaw[0], CONVERTTYPE.NOUDC))
2693
if (!canConvert(arg2.
Type
.StripNubs(), paramsRaw[1], CONVERTTYPE.NOUDC))
2723
Debug.Assert(!(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq) || nonLiftedArg1.
Type
== nonLiftedArg2.
Type
);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Assignment.cs (1)
21
set => Type = (_lhs = value).
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs (1)
22
public AggregateType DelegateType =>
Type
as AggregateType;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs (7)
14
Debug.Assert(first?.
Type
!= null);
15
Debug.Assert(second?.
Type
!= null);
16
Debug.Assert(first.
Type
.IsPredefType(PredefinedType.PT_STRING) || second.
Type
.IsPredefType(PredefinedType.PT_STRING));
23
CType type = first.
Type
;
29
Debug.Assert(second.
Type
.IsPredefType(PredefinedType.PT_STRING));
30
return second.
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (11)
20
public bool IsZero => Val.IsZero(
Type
.ConstValKind);
30
switch (
Type
.FundamentalType)
41
Type
.FundamentalType == FUNDTYPE.FT_I1 ||
Type
.FundamentalType == FUNDTYPE.FT_I2
42
||
Type
.FundamentalType == FUNDTYPE.FT_I4 ||
Type
.FundamentalType == FUNDTYPE.FT_U1
43
||
Type
.FundamentalType == FUNDTYPE.FT_U2, "Bad fundType in getI64Value");
54
if (
Type
is NullType)
59
object objval = System.Type.GetTypeCode(
Type
.AssociatedSystemType) switch
78
return
Type
.IsEnumType ? Enum.ToObject(
Type
.AssociatedSystemType, objval) : objval;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\NamedArgumentSpecification.cs (1)
24
set => Type = (_value = value).
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Temporary.cs (1)
12
Type = expression?.
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs (1)
27
set => Type = (_userDefinedCall = value).
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (35)
159
if (pArgument.
Type
== pExpr.
Type
||
160
SymbolLoader.IsBaseClassOfClass(pArgument.
Type
, pExpr.
Type
) ||
161
CConversions.FImpRefConv(pArgument.
Type
, pExpr.
Type
))
168
if (pExpr.
Type
!= null &&
169
pExpr.
Type
.IsPredefType(PredefinedType.PT_G_EXPRESSION) &&
175
Expr result = GenerateConversion(pArgument, pExpr.
Type
, pExpr.isChecked());
189
if (expr.FirstArgument.
Type
.IsPredefType(PredefinedType.PT_STRING) && expr.SecondArgument.
Type
.IsPredefType(PredefinedType.PT_STRING))
257
return GenerateConversion(expr.OptionalArguments, expr.
Type
, expr.isChecked());
260
return GenerateUserDefinedConversion(expr.OptionalArguments, expr.
Type
, expr.MethWithInst);
340
Expr pTypeOf = CreateTypeOf(((ArrayType)expr.
Type
).ElementType);
408
CType typeL = origL.
Type
;
409
CType typeR = origR.
Type
;
467
if (didEnumConversion && expr.
Type
.StripNubs().IsEnumType)
469
call = GenerateCall(PREDEFMETH.PM_EXPRESSION_CONVERT, call, CreateTypeOf(expr.
Type
));
495
Debug.Assert(!(origOp.
Type
is NullableType nub) || !nub.UnderlyingType.IsEnumType);
573
Expr pTypeOf = CreateTypeOf(expr.
Type
);
684
CType pStrippedTypeOfArgument = pArgument.
Type
.StripNubs();
701
if (isEnumToDecimalConversion(arg.
Type
, CType))
709
CType underlyingType = arg.
Type
.StripNubs().UnderlyingEnumType;
722
bool fDontLiftReturnType = (pMethodReturnType == CType || (IsNullableValueType(arg.
Type
) && IsNullableValueType(CType)));
746
if (!isEnumToDecimalConversion(pArgument.
Type
, pExpr.
Type
)
770
return GenerateConversionWithSource(pConversionSource, pCastCall.
Type
, call.isChecked());
785
return GenerateUserDefinedConversion(pCastArgument, pExpr.
Type
, pConversionSource, pExpr.UserDefinedCallMethod);
865
if (newIndex.
Type
!= intType)
883
if (expr.
Type
is NullType)
890
if (expr.
Type
!= stringType)
896
ExprTypeOf pTypeOf2 = CreateTypeOf(expr.
Type
);
990
CType aatype1 = orig1.
Type
;
991
CType aatype2 = orig2.
Type
;
1024
return pExpr is ExprProperty prop && prop.MemberGroup.OptionalObject == pObject && pObject.
Type
is NullableType;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ZeroInitialize.cs (1)
19
get => Activator.CreateInstance(
Type
.AssociatedSystemType);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
102
CType type = callingObject.
Type
;