introduce variable: use right expression if left ref is unresolved (IDEA-72914)

This commit is contained in:
anna
2012-04-14 19:09:32 +02:00
parent 2820396d33
commit f073b37e46
4 changed files with 37 additions and 0 deletions
@@ -0,0 +1,15 @@
import java.util.*;
public class Test<T>
{
List<Collection<T>> getList ()
{
return new ArrayList<Collection<T>> ();
}
public void test2 (Test<?> arg)
{
final List<? extends Collection<?>> collection = result;
collection = arg.getList ();
}
}
@@ -0,0 +1,14 @@
import java.util.*;
public class Test<T>
{
List<Collection<T>> getList ()
{
return new ArrayList<Collection<T>> ();
}
public void test2 (Test<?> arg)
{
res<caret>ult = arg.getList ();
}
}
@@ -273,6 +273,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
public void testPolyadic() throws Exception {
doTest(new MockIntroduceVariableHandler("b1", true, true, true, "boolean"));
}
public void testAssignmentToUnresolvedReference() throws Exception {
doTest(new MockIntroduceVariableHandler("collection", true, true, true, "java.util.List<? extends java.util.Collection<?>>"));
}
public void testSiblingInnerClassType() throws Exception {
doTest(new MockIntroduceVariableHandler("vari", true, false, false, "A.B") {