mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
pull up/push down: type parameters can be used in type parameters list as well as type elements (IDEA-57268)
This commit is contained in:
@@ -885,7 +885,12 @@ public class RefactoringUtil {
|
||||
if (substitutedType == null) {
|
||||
substitutedType = TypeConversionUtil.erasure(factory.createType(parameter));
|
||||
}
|
||||
element.getParent().replace(factory.createTypeElement(substitutedType));
|
||||
final PsiElement parent = element.getParent();
|
||||
if (parent instanceof PsiTypeElement) {
|
||||
parent.replace(factory.createTypeElement(substitutedType));
|
||||
} else if (element instanceof PsiJavaCodeReferenceElement && substitutedType instanceof PsiClassType) {
|
||||
element.replace(factory.createReferenceElementByType((PsiClassType)substitutedType));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Test<T> {
|
||||
<S extends T> void f<caret>oo(){}
|
||||
}
|
||||
|
||||
class B extends Test<Throwable>{
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Test<T> {
|
||||
}
|
||||
|
||||
class B extends Test<Throwable>{
|
||||
<S extends Throwable> void foo(){}
|
||||
}
|
||||
@@ -105,4 +105,8 @@ public class PushDownTest extends LightCodeInsightTestCase {
|
||||
public void testSuperOverHierarchy() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodTypeParametersList() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user