introduce constant: check forward reference fix ( IDEA-84139)

This commit is contained in:
anna
2012-04-06 15:01:10 +02:00
parent efec72b024
commit 8b81df9ef0
4 changed files with 51 additions and 2 deletions
@@ -0,0 +1,18 @@
public class Res {
void bar(R r){}
interface R<S, T> {
void la(S s, T t);
}
private void validateStructuresCookie(Res cookie) {
cookie.bar(new <caret>R<String, Object>(){
final String param = "";
@Override
public void la(String s, Object o) {
System.out.println(param);
}
});
}
}
@@ -0,0 +1,21 @@
public class Res {
public static final Res.R<String,Object> R = new Res.R<String, Object>() {
final String param = "";
@Override
public void la(String s, Object o) {
System.out.println(param);
}
};
void bar(R r){}
interface R<S, T> {
void la(S s, T t);
}
private void validateStructuresCookie(Res cookie) {
cookie.bar(<caret>R);
}
}
@@ -92,6 +92,15 @@ public class InplaceIntroduceConstantTest extends AbstractJavaInplaceIntroduceTe
}
});
}
public void testCorrectConstantPosition() throws Exception {
doTest(new Pass<AbstractInplaceIntroducer>() {
@Override
public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
type("R");
}
});
}
public void testEscapePosition() throws Exception {
doTestEscape();