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