mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
extract method type suggestions: suggest more accurate type if casts found (IDEA-56427)
This commit is contained in:
@@ -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 {}
|
||||
Reference in New Issue
Block a user