Introduce optional optimization parameters for type system context

This commit is contained in:
Simon Ogorodnik
2019-01-22 20:53:04 +03:00
parent 8992537180
commit d210e8bad0
2 changed files with 10 additions and 2 deletions
@@ -46,7 +46,7 @@ object AbstractStrictEqualityTypeChecker {
return false
}
// if (a.arguments === b.arguments) return true
if (identicalArguments(a, b)) return true
for (i in 0 until a.argumentsCount()) {
val aArg = a.getArgument(i)
@@ -25,7 +25,15 @@ enum class TypeVariance {
INV
}
interface TypeSystemContext {
interface TypeSystemOptimizationContext {
/**
* @return true is a.arguments == b.arguments, or false if not supported
*/
fun identicalArguments(a: SimpleTypeIM, b: SimpleTypeIM) = false
}
interface TypeSystemContext : TypeSystemOptimizationContext {
fun KotlinTypeIM.asSimpleType(): SimpleTypeIM?
fun KotlinTypeIM.asFlexibleType(): FlexibleTypeIM?