Minor. Get rid of redundant var
The lazyness here is redundant since SmartList doesn't make a lot of harm, but at the same time `var` here leads to another kotlin/jvm/internal/Ref$ObjectRef instance
This commit is contained in:
@@ -291,18 +291,14 @@ object NewKotlinTypeChecker : KotlinTypeChecker {
|
|||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
var result: MutableList<SimpleType>? = null
|
val result: MutableList<SimpleType> = SmartList()
|
||||||
|
|
||||||
anySupertype(baseType, { false }) {
|
anySupertype(baseType, { false }) {
|
||||||
val current = captureFromArguments(it, CaptureStatus.FOR_SUBTYPING) ?: it
|
val current = captureFromArguments(it, CaptureStatus.FOR_SUBTYPING) ?: it
|
||||||
|
|
||||||
when {
|
when {
|
||||||
areEqualTypeConstructors(current.constructor, constructor) -> {
|
areEqualTypeConstructors(current.constructor, constructor) -> {
|
||||||
if (result == null) {
|
result.add(current)
|
||||||
result = SmartList()
|
|
||||||
}
|
|
||||||
result!!.add(current)
|
|
||||||
|
|
||||||
SupertypesPolicy.None
|
SupertypesPolicy.None
|
||||||
}
|
}
|
||||||
current.arguments.isEmpty() -> {
|
current.arguments.isEmpty() -> {
|
||||||
@@ -314,7 +310,7 @@ object NewKotlinTypeChecker : KotlinTypeChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result ?: emptyList()
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
private val ClassDescriptor.isCommonFinalClass: Boolean
|
private val ClassDescriptor.isCommonFinalClass: Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user