mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
push down: erase type arguments for raw subtypes (IDEA-53405)
This commit is contained in:
@@ -334,10 +334,11 @@ public class PushDownProcessor extends BaseRefactoringProcessor {
|
||||
if (member != null) {
|
||||
for (MemberInfo memberInfo : myMemberInfos) {
|
||||
if (PsiTreeUtil.isAncestor(memberInfo.getMember(), member, false)) {
|
||||
final PsiType substitutedType = substitutor.substitute(parameter);
|
||||
if (substitutedType != null) {
|
||||
element.getParent().replace(factory.createTypeElement(substitutedType));
|
||||
PsiType substitutedType = substitutor.substitute(parameter);
|
||||
if (substitutedType == null) {
|
||||
substitutedType = TypeConversionUtil.erasure(factory.createType(parameter));
|
||||
}
|
||||
element.getParent().replace(factory.createTypeElement(substitutedType));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
public class Parent<T> {
|
||||
void <caret>foo(T t){}
|
||||
}
|
||||
|
||||
class Child extends Parent {}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Parent<T> {
|
||||
}
|
||||
|
||||
class Child extends Parent {
|
||||
void foo(Object t){}
|
||||
}
|
||||
@@ -69,6 +69,10 @@ public class PushDownTest extends LightCodeInsightTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testTypeParameterErasure() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFieldTypeParameter() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user