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