1 instantiation of ExprConstant
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (1)
139public static ExprConstant CreateConstant(CType type, ConstVal constVal) => new ExprConstant(type, constVal);
40 references to ExprConstant
Microsoft.CSharp (40)
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (3)
572ExprConstant isLifted = (ExprConstant)next.OptionalElement; 701else if (pExpr is ExprConstant)
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (11)
377if (expr is ExprConstant constant && 467((ExprConstant)exprConst).Val.DecimalVal.ToString(CultureInfo.InvariantCulture), dest); 486value = ((ulong)((ExprConstant)exprConst).Int64Value).ToString(CultureInfo.InvariantCulture); 493value = ((ExprConstant)exprConst).Int64Value.ToString(CultureInfo.InvariantCulture); 498value = ((ExprConstant)exprConst).Val.DoubleVal.ToString(CultureInfo.InvariantCulture); 1125ExprConstant constSrc = (ExprConstant)exprSrc.GetConst(); 1297ExprConstant expr = ExprFactory.CreateConstant(typeDest, cv); 1375private static Expr BindDecimalConstCast(CType destType, CType srcType, ExprConstant src) 1419ExprConstant exprConst = ExprFactory.CreateConstant(typeDecimal, cv); 1476ExprConstant exprConst = ExprFactory.CreateConstant(destType, cv);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (4)
367if (exprConst is ExprConstant constant && exprFlags == 0 && 371ExprConstant expr = ExprFactory.CreateConstant(typeDest, constant.Val); 1409private static bool isConstantInRange(ExprConstant exprSrc, CType typeDest) 1415private static bool isConstantInRange(ExprConstant exprSrc, CType typeDest, bool realsOk)
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (2)
64=> expr is ExprConstant constant && expr.Type.FundamentalType == FUNDTYPE.FT_REF && constant.Val.IsNullRef; 66public static bool IsZero(this Expr expr) => expr is ExprConstant constant && constant.IsZero;
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (5)
83public static ExprConstant CreateStringConstant(string str) => 139public static ExprConstant CreateConstant(CType type, ConstVal constVal) => new ExprConstant(type, constVal); 142public static ExprConstant CreateIntegerConstant(int x) => 146public static ExprConstant CreateBoolConstant(bool b) => 208public static ExprConstant CreateNull() => CreateConstant(NullType.Instance, default);
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (3)
314_exprDest = _exprSrc is ExprConstant 413_exprDest = _exprSrc is ExprConstant 690if (_exprSrc is ExprConstant constant &&
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (5)
222if (!(info.arg1 is ExprConstant constant)) 307if (!(info.arg2 is ExprConstant constant)) 1278if (pArgument is ExprConstant) 1424if (!(pArgument is ExprConstant)) 1926return ExprFactory.CreateConstant(typeBool, ConstVal.Get(((ExprConstant)argConst).Val.Int32Val == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (3)
111protected override Expr VisitCONSTANT(ExprConstant expr) 791ExprConstant nameString = ExprFactory.CreateStringConstant(name); 967ExprConstant paramsArrayArg = ExprFactory.CreateIntegerConstant(parameterCount);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExprVisitorBase.cs (4)
26ExpressionKind.Constant => VisitCONSTANT(pExpr as ExprConstant), 220exprRet = Visit((pExpr as ExprConstant).OptionalConstructorCall); 221(pExpr as ExprConstant).OptionalConstructorCall = exprRet; 394protected virtual Expr VisitCONSTANT(ExprConstant pExpr)