Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2)

This commit is contained in:
Alexey Sedunov
2016-09-28 15:54:55 +03:00
parent 53b584f48c
commit 6c2d4ad8eb
@@ -99,7 +99,15 @@ class JavaToKotlinPreconversionPullUpHelper(
val superInterfaceCount = getCurrentSuperInterfaceCount()
javaHelper.move(info, substitutor)
val adjustedSubstitutor = substitutor.substitutionMap.entries.fold(substitutor) { subst, (typeParameter, type) ->
if (type == null) {
val substitutedUpperBound = substitutor.substitute(PsiIntersectionType.createIntersection(*typeParameter.superTypes))
subst.put(typeParameter, substitutedUpperBound)
}
else subst
}
javaHelper.move(info, adjustedSubstitutor)
if (info.isStatic) {
member.removeOverrideModifier()