Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2)
This commit is contained in:
+9
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user