16 instantiations of ConstVal
Microsoft.CSharp (16)
Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs (16)
112
ConstValKind.Int => new
ConstVal
(s_zeroInt32),
113
ConstValKind.Double => new
ConstVal
(0.0),
114
ConstValKind.Long => new
ConstVal
(0L),
115
ConstValKind.Decimal => new
ConstVal
(0M),
116
ConstValKind.Float => new
ConstVal
(0F),
117
ConstValKind.Boolean => new
ConstVal
(s_false),
121
public static ConstVal Get(bool value) => new
ConstVal
(value ? s_true : s_false);
123
public static ConstVal Get(int value) => new
ConstVal
(value == 0 ? s_zeroInt32 : value);
125
public static ConstVal Get(uint value) => new
ConstVal
(value);
127
public static ConstVal Get(decimal value) => new
ConstVal
(value);
129
public static ConstVal Get(string value) => new
ConstVal
(value);
131
public static ConstVal Get(float value) => new
ConstVal
(value);
133
public static ConstVal Get(double value) => new
ConstVal
(value);
135
public static ConstVal Get(long value) => new
ConstVal
(value);
137
public static ConstVal Get(ulong value) => new
ConstVal
(value);
139
public static ConstVal Get(object p) => new
ConstVal
(p);
75 references to ConstVal
Microsoft.CSharp (75)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (3)
454
arg = ExprFactory.CreateConstant(SymbolTable.GetCTypeFromType(argument.Type), default(
ConstVal
));
463
arg = ExprFactory.CreateConstant(SymbolTable.GetCTypeFromType(argument.Type),
ConstVal
.Get(argument.Value));
1331
return ExprFactory.CreateConstant(boolType,
ConstVal
.Get(result));
Microsoft\CSharp\RuntimeBinder\Semantics\ConstVal.cs (11)
109
public static
ConstVal
GetDefaultValue(ConstValKind kind) =>
121
public static
ConstVal
Get(bool value) => new ConstVal(value ? s_true : s_false);
123
public static
ConstVal
Get(int value) => new ConstVal(value == 0 ? s_zeroInt32 : value);
125
public static
ConstVal
Get(uint value) => new ConstVal(value);
127
public static
ConstVal
Get(decimal value) => new ConstVal(value);
129
public static
ConstVal
Get(string value) => new ConstVal(value);
131
public static
ConstVal
Get(float value) => new ConstVal(value);
133
public static
ConstVal
Get(double value) => new ConstVal(value);
135
public static
ConstVal
Get(long value) => new ConstVal(value);
137
public static
ConstVal
Get(ulong value) => new ConstVal(value);
139
public static
ConstVal
Get(object p) => new ConstVal(p);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (19)
1164
ConstVal
cv =
ConstVal
.Get(constSrc.UInt64Value);
1280
ConstVal
cv;
1283
cv =
ConstVal
.Get((uint)valueInt);
1287
cv =
ConstVal
.Get((int)valueInt);
1291
cv =
ConstVal
.Get(valueInt);
1295
cv =
ConstVal
.Get(valueFlt);
1378
ConstVal
cv;
1418
cv =
ConstVal
.Get(result);
1439
cv =
ConstVal
.Get(Convert.ToSByte(decTrunc));
1442
cv =
ConstVal
.Get((uint)Convert.ToByte(decTrunc));
1445
cv =
ConstVal
.Get(Convert.ToInt16(decTrunc));
1448
cv =
ConstVal
.Get((uint)Convert.ToUInt16(decTrunc));
1451
cv =
ConstVal
.Get(Convert.ToInt32(decTrunc));
1454
cv =
ConstVal
.Get(Convert.ToUInt32(decTrunc));
1457
cv =
ConstVal
.Get(Convert.ToInt64(decTrunc));
1460
cv =
ConstVal
.Get(Convert.ToUInt64(decTrunc));
1463
cv =
ConstVal
.Get(Convert.ToSingle(src.Val.DecimalVal));
1466
cv =
ConstVal
.Get(Convert.ToDouble(src.Val.DecimalVal));
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (6)
84
CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_STRING).getThisType(),
ConstVal
.Get(str));
110
return CreateConstant(type,
ConstVal
.Get(Activator.CreateInstance(type.AssociatedSystemType)));
135
return CreateConstant(type,
ConstVal
.GetDefaultValue(type.ConstValKind));
139
public static ExprConstant CreateConstant(CType type,
ConstVal
constVal) => new ExprConstant(type, constVal);
143
CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_INT).getThisType(),
ConstVal
.Get(x));
147
CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_BOOL).getThisType(),
ConstVal
.Get(b));
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (2)
496
ConstVal
cv = methprop.GetDefaultParameterValue(index);
505
optionalArgument = ExprFactory.CreateConstant(dateTimeType,
ConstVal
.Get(DateTime.FromBinary(cv.Int64Val)));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (1)
660
_exprDest = ExprFactory.CreateConstant(_typeDest,
ConstVal
.GetDefaultValue(_typeDest.ConstValKind));
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (7)
1633
ConstVal
cv;
1665
cv =
ConstVal
.Get(1);
1670
cv =
ConstVal
.Get(1);
1675
cv =
ConstVal
.Get((long)1);
1680
cv =
ConstVal
.Get(1.0);
1688
private Expr LScalar(ExpressionKind ek, EXPRFLAG flags, Expr exprVal, CType type,
ConstVal
cv, CType typeTmp)
1926
return ExprFactory.CreateConstant(typeBool,
ConstVal
.Get(((ExprConstant)argConst).Val.Int32Val == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (5)
38
private
ConstVal
[] _defaultParameters;
67
_defaultParameters = Array.Empty<
ConstVal
>();
75
_defaultParameters = new
ConstVal
[count];
130
public void SetDefaultParameterValue(int index, CType type,
ConstVal
cv)
138
public
ConstVal
GetDefaultParameterValue(int index)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (2)
12
public ExprConstant(CType type,
ConstVal
value)
22
public
ConstVal
Val { get; }
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (19)
1485
ConstVal
cv =
ConstVal
.Get(((DateTime)dateAttr.Value).Ticks);
1495
ConstVal
cv =
ConstVal
.Get(decAttr.Value);
1504
ConstVal
cv = default(
ConstVal
);
1516
cv =
ConstVal
.Get((byte)defValue);
1521
cv =
ConstVal
.Get((short)defValue);
1526
cv =
ConstVal
.Get((int)defValue);
1531
cv =
ConstVal
.Get((long)defValue);
1536
cv =
ConstVal
.Get((float)defValue);
1541
cv =
ConstVal
.Get((double)defValue);
1546
cv =
ConstVal
.Get((char)defValue);
1551
cv =
ConstVal
.Get((bool)defValue);
1556
cv =
ConstVal
.Get((sbyte)defValue);
1561
cv =
ConstVal
.Get((ushort)defValue);
1566
cv =
ConstVal
.Get((uint)defValue);
1571
cv =
ConstVal
.Get((ulong)defValue);
1576
cv =
ConstVal
.Get((string)defValue);