Introduce optional optimization parameters for type system context
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ object AbstractStrictEqualityTypeChecker {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (a.arguments === b.arguments) return true
|
if (identicalArguments(a, b)) return true
|
||||||
|
|
||||||
for (i in 0 until a.argumentsCount()) {
|
for (i in 0 until a.argumentsCount()) {
|
||||||
val aArg = a.getArgument(i)
|
val aArg = a.getArgument(i)
|
||||||
|
|||||||
@@ -25,7 +25,15 @@ enum class TypeVariance {
|
|||||||
INV
|
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.asSimpleType(): SimpleTypeIM?
|
||||||
fun KotlinTypeIM.asFlexibleType(): FlexibleTypeIM?
|
fun KotlinTypeIM.asFlexibleType(): FlexibleTypeIM?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user