extract method type suggestions: suggest more accurate type if casts found (IDEA-56427)

This commit is contained in:
anna
2010-07-14 10:57:05 +04:00
parent 94d548b63c
commit fa25a0d53f
5 changed files with 102 additions and 0 deletions
@@ -0,0 +1,7 @@
class Test {
void foo(Object o) {
<selection>((A)o).doSmth();</selection>
}
}
class A {void doSmth(){}}
@@ -0,0 +1,14 @@
class Test {
void foo(Object o) {
<selection>
if (true) {
((A1)o).doSmth();
} else {
o.toString();
}
</selection>
}
}
class A {void doSmth(){}}
class A1 extends A {}
@@ -0,0 +1,15 @@
class Test {
void foo(Object o) {
<selection>
if (true) {
((A1)o).doSmth();
} else {
((A2)o).doSmth();
}
</selection>
}
}
class A {void doSmth(){}}
class A1 extends A {}
class A2 extends A {}