Optimize method count for collection stubs

Do not generate stubs if they're already present in superclasses

 #KT-13698 In Progress
This commit is contained in:
Denis Zharkov
2016-10-05 15:52:48 +03:00
parent 900c442efd
commit e05e0ec921
13 changed files with 414 additions and 25 deletions
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.types.TypeSubstitutor
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.SmartList
import org.jetbrains.kotlin.utils.addToStdlib.check
fun ClassDescriptor.getClassObjectReferenceTarget(): ClassDescriptor = companionObjectDescriptor ?: this
@@ -322,3 +323,6 @@ private fun ClassDescriptor.getAllSuperClassesTypesIncludeItself(): List<KotlinT
return result
}
fun ClassDescriptor.getAllSuperclassesWithoutAny() =
generateSequence(getSuperClassNotAny(), ClassDescriptor::getSuperClassNotAny).toCollection(SmartList<ClassDescriptor>())