Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
leading to strange completion order
#KT-25588 Fixed
This commit is contained in:
@@ -135,6 +135,7 @@ class FuzzyType(
|
||||
private fun matchedSubstitutor(otherType: FuzzyType, matchKind: MatchKind): TypeSubstitutor? {
|
||||
if (type.isError) return null
|
||||
if (otherType.type.isError) return null
|
||||
if (otherType.type.isUnit() && matchKind == MatchKind.IS_SUBTYPE) return TypeSubstitutor.EMPTY
|
||||
|
||||
fun KotlinType.checkInheritance(otherType: KotlinType): Boolean {
|
||||
return when (matchKind) {
|
||||
|
||||
Reference in New Issue
Block a user