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)
703
Debug.Assert(pExpr.
Type
is NullType);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (5)
524
CType callingObjectType = callingObject.
Type
;
584
if (Name == SpecialNames.Invoke && callingObject.
Type
.IsDelegateType)
727
if (payload is InvokeBinder && !callingObject.
Type
.IsDelegateType)
874
methprop = ExpressionBinder.GroupToArgsBinder.FindMostDerivedMethod(methprop, callingObject.
Type
);
1145
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)
350
BindImplicitConversion(expr, expr.
Type
, dest, flags);
362
if (BindImplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
365
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
374
FUNDTYPE ftSrc = expr.
Type
.FundamentalType;
378
expr.
Type
.IsSimpleType && dest.IsSimpleType)
389
if (expr.
Type
is NullType && dest.FundamentalType != FUNDTYPE.FT_REF)
396
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));
414
if (BindImplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
416
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
445
if (BindExplicitConversion(expr, expr.
Type
, dest, out Expr exprResult, flags))
448
CheckUnsafe(expr.
Type
); // added to the binder so we don't bind to pointer ops
455
bool simpleConstToSimpleDestination = exprConst != null && expr.
Type
.IsSimpleOrEnum && dest.IsSimpleOrEnum;
459
FUNDTYPE exprType = expr.
Type
.FundamentalType;
473
if (!CanExplicitConversionBeBoundInUncheckedContext(expr, expr.
Type
, dest, flags | CONVERTTYPE.NOUDC))
506
if (expr.
Type
is NullType && dest.FundamentalType != FUNDTYPE.FT_REF)
517
Debug.Assert(expr.
Type
!= null);
518
return ErrorHandling.Error(ErrorCode.ERR_NoExplicitConv, new ErrArg(expr.
Type
, ErrArgFlags.Unique), new ErrArg(dest, ErrArgFlags.Unique));
629
Debug.Assert(exprSrc == null || exprSrc.
Type
== typeSrc);
1120
FUNDTYPE ftSrc = exprSrc.
Type
.FundamentalType;
1130
Expr expr = BindDecimalConstCast(typeDest, exprSrc.
Type
, constSrc);
1159
if (constSrc.
Type
.FundamentalType == FUNDTYPE.FT_U8)
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (3)
199
if (valueSrc.
Type
is NullableType)
204
Debug.Assert(valueSrc.
Type
== _typeSrc.StripNubs());
205
if (!_binder.BindExplicitConversion(valueSrc, valueSrc.
Type
, _typeDest, _needsExprDest, out _exprDest, _flags | CONVERTTYPE.NOUDC))
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (26)
282
allowExplicit ? mustCastCore(op2, op1.
Type
, 0) : mustConvertCore(op2, op1.
Type
);
307
ArrayType pArrayType = pOp1.
Type
as ArrayType;
368
exprSrc.
Type
.FundamentalType == typeDest.FundamentalType &&
369
(!exprSrc.
Type
.IsPredefType(PredefinedType.PT_STRING) || constant.Val.IsNullRef))
396
CType callingObjectType = pObject?.
Type
;
422
Debug.Assert(pResult.
Type
== VoidType.Instance);
509
type = pObjectThrough.
Type
;
528
verifyMethodArgs(result, pObjectThrough?.
Type
);
542
CType typeSrc = arg.
Type
;
648
return ExprFactory.CreateUserDefinedUnaryOperator(ek, call.
Type
, arg, call, pmethBest.mpwi);
655
if (!(arg.
Type
is NullableType) || !canConvert(arg.
Type
.StripNubs(), typeRaw, CONVERTTYPE.NOUDC))
660
Debug.Assert(arg.
Type
is NullableType);
797
Debug.Assert(pOperand1.
Type
!= null);
805
Debug.Assert(pOperand2.
Type
!= null);
806
return ErrorHandling.Error(ErrorCode.ERR_BadBinaryOps, strOp, pOperand1.
Type
, pOperand2.
Type
);
809
return ErrorHandling.Error(ErrorCode.ERR_BadUnaryOp, strOp, pOperand1.
Type
);
831
type = prop.OptionalObjectThrough.
Type
;
989
CType typeObj = pObject.
Type
;
1056
!pObject.
Type
.IsStructOrEnum
1106
if (indir.
Type
is ParameterModifierType)
1332
Debug.Assert(arg.
Type
!= null);
1334
prgtype[iarg] = arg.
Type
;
1417
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)
177
ExprUnaryOp unary = CreateUnaryOp(ExpressionKind.Negate, operand.
Type
, operand);
186
CreateBinop(ExpressionKind.Sequence, second.
Type
, first, second);
203
ExprBinOp expr = CreateBinop(ExpressionKind.Save, wrap.
Type
, wrap.OptionalExpression, wrap);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (10)
108
return (pGroup.Flags & EXPRFLAG.EXF_CTOR) != 0 ? pGroup.ParentType : pGroup.OptionalObject?.
Type
;
325
CType pTypeThrough = _pGroup.OptionalObject?.
Type
;
477
prgTypes[i] = pArguments.prgexpr[i].
Type
;
578
FindMostDerivedMethod(pMethProp, pObject?.
Type
);
708
prgTypes[n] = _pArguments.prgexpr[n].
Type
;
1025
if (pType == pArgument.
Type
)
1151
if (_pGroup.OptionalObject?.
Type
!= null &&
1152
_pGroup.OptionalObject.
Type
.IsDelegateType &&
1158
nameErr = ((AggregateType)_pGroup.OptionalObject.
Type
).OwningAggregate.name;
1197
return _pGroup.OptionalObject?.
Type
is AggregateType agg && agg.OwningAggregate.IsDelegate()
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (6)
88
Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.
Type
); // type of source should be correct if source supplied
269
Debug.Assert(_exprSrc == null || _exprSrc.
Type
== _typeSrc);
347
Debug.Assert(exprTmp.
Type
== nubDst);
376
arg1, arg1.
Type
, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC)
378
arg1, arg1.
Type
, typeDstBase, out arg1, _flags | CONVERTTYPE.NOUDC);
649
_exprSrc.
Type
.IsNumericType &&
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
524
Debug.Assert(obj == null || obj.
Type
!= null);
536
_typeQual = (_flags & MemLookFlags.Ctor) != 0 ? _typeSrc : obj?.
Type
;
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (3)
41
Debug.Assert(exprSrc != null && exprSrc.
Type
is NullableType);
51
NullableType nubSrc = (NullableType)exprSrc.
Type
;
67
NullableType pNubSourceType = TypeManager.GetNullable(exprSrc.
Type
);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (96)
169
return ExprFactory.CreateUserDefinedBinop(ek, expr.
Type
, info.arg1, info.arg2, expr, pmpwi);
636
? GetEnumBinOpType(ek, nonLiftedArg1.
Type
, nonLiftedArg2.
Type
, out _)
637
: pArgument1.
Type
;
1158
CType type = pArgument.
Type
;
1282
pArgument = ExprFactory.CreateCast(pArgument.
Type
, pArgument);
1300
Debug.Assert(pArgument.
Type
!= null);
1303
CType pArgumentType = pArgument.
Type
;
1353
if (exprVal.
Type
!= null && exprVal.
Type
!= pArgumentType)
1394
Debug.Assert(pArgument.
Type
!= null);
1398
CType pArgumentType = pArgument.
Type
;
1516
Debug.Assert(arg?.
Type
!= null);
1517
if (arg.
Type
is NullType)
1567
Debug.Assert(arg1.
Type
.IsPredefined && arg2.
Type
.IsPredefined && arg1.
Type
.PredefinedType == arg2.
Type
.PredefinedType);
1568
return binder.BindIntOp(ek, flags, arg1, arg2, arg1.
Type
.PredefinedType);
1577
Debug.Assert(arg.
Type
.IsPredefined);
1578
return binder.BindIntOp(ek, flags, arg, null, arg.
Type
.PredefinedType);
1587
Debug.Assert(arg1.
Type
.IsPredefined && arg2.
Type
.IsPredefined && arg1.
Type
.PredefinedType == arg2.
Type
.PredefinedType);
1597
Debug.Assert(arg.
Type
.IsPredefined);
1708
ExprMultiGet exprGet = ExprFactory.CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.
Type
, null);
1721
Expr op = mustCast(exprVal, arg.
Type
, CONVERTTYPE.NOUDC);
1723
ExprMulti exprMulti = ExprFactory.CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.
Type
, arg, op);
1737
ExprMultiGet exprGet = ExprFactory.CreateMultiGet(EXPRFLAG.EXF_ASSGOP, arg.
Type
, null);
1747
ExprUnaryOp exprRes = ExprFactory.CreateUnaryOp((ek == ExpressionKind.Add) ? ExpressionKind.Inc : ExpressionKind.Dec, arg.
Type
/* type */, exprVal);
1748
mustCast(mustCast(nonLiftedResult, type), arg.
Type
);
1751
ExprMulti exprMulti = ExprFactory.CreateMulti(EXPRFLAG.EXF_ASSGOP | flags, arg.
Type
, arg, exprRes);
1765
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.
Type
.IsPredefType(PredefinedType.PT_DECIMAL));
1807
Debug.Assert(arg.
Type
.IsPredefType(PredefinedType.PT_DECIMAL));
1828
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_STRING) || arg2.
Type
.IsPredefType(PredefinedType.PT_STRING));
1840
Debug.Assert(arg1.
Type
.IsPredefined);
1841
Debug.Assert(arg2.
Type
.IsPredefType(PredefinedType.PT_INT));
1843
PredefinedType ptOp = arg1.
Type
.PredefinedType;
1846
return ExprFactory.CreateBinop(ek, arg1.
Type
, arg1, arg2);
1859
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_BOOL) || arg1.
Type
is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1860
Debug.Assert(arg2.
Type
.IsPredefType(PredefinedType.PT_BOOL) || arg2.
Type
is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1869
Debug.Assert(expr1.
Type
.IsPredefType(PredefinedType.PT_BOOL) || expr1.
Type
is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1870
Debug.Assert(expr2.
Type
.IsPredefType(PredefinedType.PT_BOOL) || expr2.
Type
is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL));
1872
if (expr1.
Type
is NullableType || expr2.
Type
is NullableType)
1882
if (!(nonLiftedArg1.
Type
is NullableType) && !(nonLiftedArg2.
Type
is NullableType))
1912
Debug.Assert(arg.
Type
.IsPredefType(PredefinedType.PT_BOOL));
1938
Debug.Assert(arg1.
Type
.IsPredefType(PredefinedType.PT_STRING) && arg2.
Type
.IsPredefType(PredefinedType.PT_STRING));
1972
Debug.Assert(arg1.
Type
== arg2.
Type
&& (arg1.
Type
.IsDelegateType || arg1.
Type
.IsPredefType(PredefinedType.PT_DELEGATE)));
1980
RetType = arg1.
Type
;
1986
RetType = arg1.
Type
;
2012
AggregateType typeDst = GetEnumBinOpType(ek, arg1.
Type
, arg2.
Type
, out AggregateType typeEnum);
2029
if (exprRes.
Type
!= typeDst)
2042
CType nonNullableType1 = arg1.
Type
is NullableType arg1NubType ? arg1NubType.UnderlyingType : arg1.
Type
;
2043
CType nonNullableType2 = arg2.
Type
is NullableType arg2NubType ? arg2NubType.UnderlyingType : arg2.
Type
;
2073
if (exprRes.
Type
!= typeDst)
2090
Debug.Assert(((ExprCast)arg).Argument.
Type
.IsEnumType);
2091
CType typeEnum = ((ExprCast)arg).Argument.
Type
;
2193
Debug.Assert(op1 != null && op1.
Type
== typeOp);
2194
Debug.Assert(op2 == null || op2.
Type
== typeOp);
2247
Debug.Assert(op != null && op.
Type
== typeOp);
2254
if (ptOp == PredefinedType.PT_UINT && op.
Type
.FundamentalType == FUNDTYPE.FT_U4)
2275
Debug.Assert(op2 == null || op1.
Type
== op2.
Type
);
2276
Debug.Assert(op1.
Type
.IsPredefType(PredefinedType.PT_FLOAT) || op1.
Type
.IsPredefType(PredefinedType.PT_DOUBLE));
2279
CType typeDest = kind.IsRelational() ? GetPredefindType(PredefinedType.PT_BOOL) : op1.
Type
;
2325
? ErrorHandling.Error(ErrorCode.ERR_AmbigBinaryOps, strOp, op1.
Type
, op2.
Type
)
2326
: ErrorHandling.Error(ErrorCode.ERR_AmbigUnaryOp, strOp, op1.
Type
);
2337
CType typeRet = pCall.
Type
;
2354
SymbolTable.PopulateSymbolTableWithName(SpecialNames.CLR_True, null, pExprWrap.
Type
.AssociatedSystemType);
2355
SymbolTable.PopulateSymbolTableWithName(SpecialNames.CLR_False, null, pExprWrap.
Type
.AssociatedSystemType);
2531
int cats = GetUserDefinedBinopArgumentTypes(arg1.
Type
, arg2.
Type
, rgats);
2589
CheckUnsafe(arg1.
Type
); // added to the binder so we don't bind to pointer ops
2590
CheckUnsafe(arg2.
Type
); // added to the binder so we don't bind to pointer ops
2624
if (!canConvert(arg1.
Type
.StripNubs(), paramsRaw[0], CONVERTTYPE.NOUDC))
2628
if (!canConvert(arg2.
Type
.StripNubs(), paramsRaw[1], CONVERTTYPE.NOUDC))
2658
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)
158
if (pArgument.
Type
== pExpr.
Type
||
159
SymbolLoader.IsBaseClassOfClass(pArgument.
Type
, pExpr.
Type
) ||
160
CConversions.FImpRefConv(pArgument.
Type
, pExpr.
Type
))
167
if (pExpr.
Type
!= null &&
168
pExpr.
Type
.IsPredefType(PredefinedType.PT_G_EXPRESSION) &&
174
Expr result = GenerateConversion(pArgument, pExpr.
Type
, pExpr.isChecked());
188
if (expr.FirstArgument.
Type
.IsPredefType(PredefinedType.PT_STRING) && expr.SecondArgument.
Type
.IsPredefType(PredefinedType.PT_STRING))
256
return GenerateConversion(expr.OptionalArguments, expr.
Type
, expr.isChecked());
259
return GenerateUserDefinedConversion(expr.OptionalArguments, expr.
Type
, expr.MethWithInst);
339
Expr pTypeOf = CreateTypeOf(((ArrayType)expr.
Type
).ElementType);
407
CType typeL = origL.
Type
;
408
CType typeR = origR.
Type
;
466
if (didEnumConversion && expr.
Type
.StripNubs().IsEnumType)
468
call = GenerateCall(PREDEFMETH.PM_EXPRESSION_CONVERT, call, CreateTypeOf(expr.
Type
));
494
Debug.Assert(!(origOp.
Type
is NullableType nub) || !nub.UnderlyingType.IsEnumType);
572
Expr pTypeOf = CreateTypeOf(expr.
Type
);
683
CType pStrippedTypeOfArgument = pArgument.
Type
.StripNubs();
700
if (isEnumToDecimalConversion(arg.
Type
, CType))
708
CType underlyingType = arg.
Type
.StripNubs().UnderlyingEnumType;
721
bool fDontLiftReturnType = (pMethodReturnType == CType || (IsNullableValueType(arg.
Type
) && IsNullableValueType(CType)));
745
if (!isEnumToDecimalConversion(pArgument.
Type
, pExpr.
Type
)
769
return GenerateConversionWithSource(pConversionSource, pCastCall.
Type
, call.isChecked());
784
return GenerateUserDefinedConversion(pCastArgument, pExpr.
Type
, pConversionSource, pExpr.UserDefinedCallMethod);
864
if (newIndex.
Type
!= intType)
882
if (expr.
Type
is NullType)
889
if (expr.
Type
!= stringType)
895
ExprTypeOf pTypeOf2 = CreateTypeOf(expr.
Type
);
989
CType aatype1 = orig1.
Type
;
990
CType aatype2 = orig2.
Type
;
1023
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)
100
CType type = callingObject.
Type
;