pull up: postpone type params replacement: substituted types can contain type params from base class with names that exist in current class (IDEA-87543)

This commit is contained in:
Anna Kozlova
2012-06-19 14:04:30 +04:00
parent bcc15a98f0
commit 4b5ba694dc
4 changed files with 29 additions and 2 deletions
@@ -0,0 +1,7 @@
interface Bar<T> { }
interface Base<T> { }
class Foo<T,U> implements Base<U> {
void fo<caret>o(Bar<U> bar) { }
}
@@ -0,0 +1,10 @@
interface Bar<T> { }
interface Base<T> {
void foo(Bar<T> bar);
}
class Foo<T,U> implements Base<U> {
@Override
public void foo(Bar<U> bar) { }
}
@@ -115,6 +115,10 @@ public class PullUpTest extends LightRefactoringTestCase {
doTest(false, new RefactoringTestUtil.MemberDescriptor("I", PsiClass.class));
}
public void testTypeParamsConflictingNames() throws Exception {
doTest(false, new RefactoringTestUtil.MemberDescriptor("foo", PsiMethod.class));
}
private void doTest(RefactoringTestUtil.MemberDescriptor... membersToFind) throws Exception {
doTest(true, membersToFind);
}