Is there any reason to make return type of IrTypeS...
# compiler
p
Is there any reason to make return type of IrTypeSystemContext::findCommonIntegerLiteralTypesSuperType not nullable in 2.1.0-Beta2? What should be return if explicitSupertypes are not primitive numbers? With current implementation IrTypeSystemContext::commonSuperType always returns Int no matter what types are provided. Previously (2.1.0-Beta1) i can override findCommonIntegerLiteralTypesSuperType and return null for such cases.
d
?
was removed from the return type during automated refactoring In fact the whole implementation of
findCommonIntegerLiteralTypesSuperType
in
IrTypeSystemContext
is incorrect, as it always should return
null
as there is no ILT in the IR type system
I'll fix it, but it will go only in 2.1.20-Beta1 2.1.0 is already branched and this change is not something which should be cherry-picked
p
Thanks! For now i made such workaround:
Copy code
override fun findCommonIntegerLiteralTypesSuperType(explicitSupertypes: List<RigidTypeMarker>): IrSimpleType {
 return nullable(null as IrSimpleType?)
}

private fun <T> nullable(v: T?): T {
 @Suppress("UNCHECKED_CAST")
 return v as T
}
👍 1