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