◆ GetType()
Returns the type that this integer literal "prefers".
140898 {
140899 D_ASSERT(type.id() == LogicalTypeId::INTEGER_LITERAL);
140900 auto info = type.AuxInfo();
140901 D_ASSERT(info->type == ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO);
140902 return info->Cast<IntegerLiteralTypeInfo>().constant_value.type();
140903}
◆ FitsInType()
Whether or not the integer literal fits into the target numeric type.
140905 {
140906 D_ASSERT(type.id() == LogicalTypeId::INTEGER_LITERAL);
140907
140908 if (target.id() == LogicalTypeId::FLOAT || target.id() == LogicalTypeId::DOUBLE) {
140909 return true;
140910 }
140911 if (!target.IsIntegral()) {
140912 return false;
140913 }
140914
140915 auto info = type.AuxInfo();
140916 D_ASSERT(info->type == ExtraTypeInfoType::INTEGER_LITERAL_TYPE_INFO);
140917 auto &literal_info = info->Cast<IntegerLiteralTypeInfo>();
140918 Value copy = literal_info.constant_value;
140919 return copy.DefaultTryCastAs(target);
140920}
The documentation for this struct was generated from the following files: