From 6c2d4ad8ebf1eca82e05f8aefe213a511125ff82 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 28 Sep 2016 15:54:55 +0300 Subject: [PATCH] Pull Up: Replace unresolved type parameters with their upper bounds (Fixes test failure after switching to IDEA 2016.2) --- .../pullUp/JavaToKotlinPreconversionPullUpHelper.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt index e2f08a46cae..cab442199eb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt @@ -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()