Optimize subtyping for case of objects identity

It may be rather frequent (e.g. in case of types without arguments or
for dispatch receiver parameters)
This commit is contained in:
Denis Zharkov
2017-10-04 09:32:13 +03:00
parent f81c7a1a47
commit bb6a52c0cc
@@ -113,6 +113,7 @@ object NewKotlinTypeChecker : KotlinTypeChecker {
type.constructor.isDenotable && !type.isDynamic() && type.lowerIfFlexible().constructor == type.upperIfFlexible().constructor
fun TypeCheckerContext.isSubtypeOf(subType: UnwrappedType, superType: UnwrappedType): Boolean {
if (subType === superType) return true
val newSubType = transformToNewType(subType)
val newSuperType = transformToNewType(superType)