[FIR] Properly approximate return type of callable declarations

- approximate intersection types in all non-local declarations
- approximate local types in non-private non-local declarations
This commit is contained in:
Dmitriy Novozhilov
2022-11-10 15:34:40 +02:00
committed by Space Team
parent 0f70635fcb
commit 01c6c7dc59
19 changed files with 190 additions and 230 deletions
@@ -0,0 +1,14 @@
// FIR_IDENTICAL
// WITH_STDLIB
private val PRIMITIVE_CLASSES = listOf(Boolean::class, Byte::class, Char::class, Double::class, Float::class, Int::class, Long::class, Short::class)
// Map
private val PRIMITIVE_TO_WRAPPER = PRIMITIVE_CLASSES.map { it.javaPrimitiveType to it.javaObjectType }.toMap()
private val WRAPPER_TO_PRIMITIVE = PRIMITIVE_CLASSES.map { it.javaObjectType to it.javaPrimitiveType }.toMap()
val Class<*>.primitiveByWrapper: Class<*>?
get() = WRAPPER_TO_PRIMITIVE[this]
val Class<*>.wrapperByPrimitive: Class<*>?
get() = PRIMITIVE_TO_WRAPPER[this]
@@ -0,0 +1,7 @@
package
private val PRIMITIVE_CLASSES: kotlin.collections.List<kotlin.reflect.KClass<out kotlin.Any>>
private val PRIMITIVE_TO_WRAPPER: kotlin.collections.Map<java.lang.Class<out kotlin.Any>?, java.lang.Class<out kotlin.Any>>
private val WRAPPER_TO_PRIMITIVE: kotlin.collections.Map<java.lang.Class<out kotlin.Any>, java.lang.Class<out kotlin.Any>?>
public val java.lang.Class<*>.primitiveByWrapper: java.lang.Class<*>?
public val java.lang.Class<*>.wrapperByPrimitive: java.lang.Class<*>?