NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773)
This commit is contained in:
+6
-2
@@ -110,14 +110,18 @@ class ResolvedAtomCompleter(
|
|||||||
private val ResolvedLambdaAtom.isCoercedToUnit: Boolean
|
private val ResolvedLambdaAtom.isCoercedToUnit: Boolean
|
||||||
get() {
|
get() {
|
||||||
val returnTypes =
|
val returnTypes =
|
||||||
resultArguments.mapNotNull {
|
resultArguments.map {
|
||||||
val type = it.safeAs<SimpleKotlinCallArgument>()?.receiver?.receiverValue?.type ?: return@mapNotNull null
|
val type = it.safeAs<SimpleKotlinCallArgument>()?.receiver?.receiverValue?.type ?: return@map null
|
||||||
val unwrappedType = when (type) {
|
val unwrappedType = when (type) {
|
||||||
is WrappedType -> type.unwrap()
|
is WrappedType -> type.unwrap()
|
||||||
is UnwrappedType -> type
|
is UnwrappedType -> type
|
||||||
}
|
}
|
||||||
resultSubstitutor.safeSubstitute(unwrappedType)
|
resultSubstitutor.safeSubstitute(unwrappedType)
|
||||||
}
|
}
|
||||||
|
if (returnTypes.isEmpty()) return true
|
||||||
|
val substitutedTypes = returnTypes.filterNotNull()
|
||||||
|
// we have some unsubstituted types
|
||||||
|
if (substitutedTypes.isEmpty()) return false
|
||||||
val commonReturnType = CommonSupertypes.commonSupertype(returnTypes)
|
val commonReturnType = CommonSupertypes.commonSupertype(returnTypes)
|
||||||
return commonReturnType.isUnit()
|
return commonReturnType.isUnit()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user