[NI] Drop useless isEmpty property from NewTypeSubstitutor

This commit is contained in:
Mikhail Zarechenskiy
2017-08-24 13:24:03 +03:00
parent 9f2bf066b9
commit 6f397f8512
2 changed files with 0 additions and 6 deletions
@@ -575,8 +575,6 @@ class DelegatedPropertyResolver(
}
private object AnonymousTypeSubstitutor : NewTypeSubstitutor {
override val isEmpty get() = true
override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? {
val declarationDescriptor = constructor.declarationDescriptor
if (declarationDescriptor is ClassifierDescriptor && DescriptorUtils.isAnonymousObject(declarationDescriptor)) {
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.types.checker.intersectTypes
interface NewTypeSubstitutor {
fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType?
val isEmpty: Boolean
fun safeSubstitute(type: UnwrappedType): UnwrappedType = substitute(type) ?: type
@@ -136,13 +135,10 @@ interface NewTypeSubstitutor {
}
class NewTypeSubstitutorByConstructorMap(val map: Map<TypeConstructor, UnwrappedType>) : NewTypeSubstitutor {
override val isEmpty get() = map.isEmpty()
override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? = map[constructor]
}
class FreshVariableNewTypeSubstitutor(val freshVariables: List<TypeVariableFromCallableDescriptor>) : NewTypeSubstitutor {
override val isEmpty get() = freshVariables.isEmpty()
override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? {
val indexProposal = (constructor.declarationDescriptor as? TypeParameterDescriptor)?.index ?: return null
val typeVariable = freshVariables.getOrNull(indexProposal) ?: return null