Refactoring: Rename isUnsigned -> isUnsignedNumberLiteral
This commit is contained in:
@@ -40,14 +40,15 @@ interface CompileTimeConstant<out T> {
|
||||
|
||||
val isPure: Boolean get() = parameters.isPure
|
||||
|
||||
val isUnsigned: Boolean get() = parameters.isUnsigned
|
||||
val isUnsignedNumberLiteral: Boolean get() = parameters.isUnsignedNumberLiteral
|
||||
|
||||
class Parameters(
|
||||
val canBeUsedInAnnotation: Boolean,
|
||||
val isPure: Boolean,
|
||||
val isUnsigned: Boolean,
|
||||
val usesVariableAsConstant: Boolean,
|
||||
val usesNonConstValAsConstant: Boolean
|
||||
val canBeUsedInAnnotation: Boolean,
|
||||
val isPure: Boolean,
|
||||
// `isUnsignedNumberLiteral` means that this constant represents simple number literal with `u` suffix (123u, 0xFEu)
|
||||
val isUnsignedNumberLiteral: Boolean,
|
||||
val usesVariableAsConstant: Boolean,
|
||||
val usesNonConstValAsConstant: Boolean
|
||||
)
|
||||
|
||||
override fun equals(other: Any?): Boolean
|
||||
@@ -88,7 +89,7 @@ fun createIntegerValueTypeConstant(
|
||||
module: ModuleDescriptor,
|
||||
parameters: CompileTimeConstant.Parameters
|
||||
): CompileTimeConstant<*> {
|
||||
return if (parameters.isUnsigned && !hasUnsignedTypesInModuleDependencies(module)) {
|
||||
return if (parameters.isUnsignedNumberLiteral && !hasUnsignedTypesInModuleDependencies(module)) {
|
||||
UnsignedErrorValueTypeConstant(value, parameters)
|
||||
} else {
|
||||
IntegerValueTypeConstant(value, module, parameters)
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IntegerValueTypeConstructor(
|
||||
// order of types matters
|
||||
// 'getPrimitiveNumberType' returns first of supertypes that is a subtype of expected type
|
||||
// for expected type 'Any' result type 'Int' should be returned
|
||||
val isUnsigned = parameters.isUnsigned
|
||||
val isUnsigned = parameters.isUnsignedNumberLiteral
|
||||
|
||||
if (isUnsigned) {
|
||||
assert(hasUnsignedTypesInModuleDependencies(module)) {
|
||||
|
||||
Reference in New Issue
Block a user