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