f91db5f0b8
This problem is only relevant when isTypeRefinementEnabled == true (HMPP projects) Ambiguity accidentally was removed after471134dThere, for areCallableDescriptorsEquivalent we stopped assuming as impossible a situation of having identity-different descriptors in the same containing declaraton that still might be considered equal So, before471134dwe were comparing "fun foo(x: String)" with "[substituted] fun foo(x: String)" and areCallableDescriptorsEquivalent returned false for such case. Thus, both overrides were left in the resulting set. After471134d, those two descriptors becamed considered as equal thus having a possibility to remove any of them. The problem is that "areCallableDescriptorsEquivalent" has kind of unclear contract. Effectively it checks whether two descriptors match to the same declaration. But some of the usages expect that it also makes sure that descriptors have the same substitution (see org.jetbrains.kotlin.resolve.calls.smartcasts.IdentifierInfo.Variable#equals) So, the straight solution is using original descriptors for the cases where we need to make sure that descriptors relates to actually different declarations ^KT-34027 Fixed