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)
469arg = ExprFactory.CreateConstant(SymbolTable.GetCTypeFromType(argument.Type), default(ConstVal)); 478arg = ExprFactory.CreateConstant(SymbolTable.GetCTypeFromType(argument.Type), ConstVal.Get(argument.Value)); 1361return 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)
1195ConstVal cv = ConstVal.Get(constSrc.UInt64Value); 1311ConstVal cv; 1314cv = ConstVal.Get((uint)valueInt); 1318cv = ConstVal.Get((int)valueInt); 1322cv = ConstVal.Get(valueInt); 1326cv = ConstVal.Get(valueFlt); 1412ConstVal cv; 1452cv = ConstVal.Get(result); 1473cv = ConstVal.Get(Convert.ToSByte(decTrunc)); 1476cv = ConstVal.Get((uint)Convert.ToByte(decTrunc)); 1479cv = ConstVal.Get(Convert.ToInt16(decTrunc)); 1482cv = ConstVal.Get((uint)Convert.ToUInt16(decTrunc)); 1485cv = ConstVal.Get(Convert.ToInt32(decTrunc)); 1488cv = ConstVal.Get(Convert.ToUInt32(decTrunc)); 1491cv = ConstVal.Get(Convert.ToInt64(decTrunc)); 1494cv = ConstVal.Get(Convert.ToUInt64(decTrunc)); 1497cv = ConstVal.Get(Convert.ToSingle(src.Val.DecimalVal)); 1500cv = ConstVal.Get(Convert.ToDouble(src.Val.DecimalVal));
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (6)
98CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_STRING).getThisType(), ConstVal.Get(str)); 127return CreateConstant(type, ConstVal.Get(Activator.CreateInstance(type.AssociatedSystemType))); 152return CreateConstant(type, ConstVal.GetDefaultValue(type.ConstValKind)); 156public static ExprConstant CreateConstant(CType type, ConstVal constVal) => new ExprConstant(type, constVal); 161CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_INT).getThisType(), ConstVal.Get(x)); 166CreateConstant(TypeManager.GetPredefAgg(PredefinedType.PT_BOOL).getThisType(), ConstVal.Get(b));
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (2)
497ConstVal cv = methprop.GetDefaultParameterValue(index); 506optionalArgument = ExprFactory.CreateConstant(dateTimeType, ConstVal.Get(DateTime.FromBinary(cv.Int64Val)));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (1)
662_exprDest = ExprFactory.CreateConstant(_typeDest, ConstVal.GetDefaultValue(_typeDest.ConstValKind));
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (7)
1668ConstVal cv; 1700cv = ConstVal.Get(1); 1705cv = ConstVal.Get(1); 1710cv = ConstVal.Get((long)1); 1715cv = ConstVal.Get(1.0); 1724private Expr LScalar(ExpressionKind ek, EXPRFLAG flags, Expr exprVal, CType type, ConstVal cv, CType typeTmp) 1971return 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)
1514ConstVal cv = ConstVal.Get(((DateTime)dateAttr.Value).Ticks); 1524ConstVal cv = ConstVal.Get(decAttr.Value); 1533ConstVal cv = default(ConstVal); 1545cv = ConstVal.Get((byte)defValue); 1550cv = ConstVal.Get((short)defValue); 1555cv = ConstVal.Get((int)defValue); 1560cv = ConstVal.Get((long)defValue); 1565cv = ConstVal.Get((float)defValue); 1570cv = ConstVal.Get((double)defValue); 1575cv = ConstVal.Get((char)defValue); 1580cv = ConstVal.Get((bool)defValue); 1585cv = ConstVal.Get((sbyte)defValue); 1590cv = ConstVal.Get((ushort)defValue); 1595cv = ConstVal.Get((uint)defValue); 1600cv = ConstVal.Get((ulong)defValue); 1605cv = ConstVal.Get((string)defValue);