IDEA-68584 Completion should detect return type and autocast in some cases

This commit is contained in:
peter
2012-03-09 15:16:40 +04:00
parent 54b88bcb8c
commit c4ed6f3022
7 changed files with 109 additions and 98 deletions
@@ -0,0 +1,14 @@
import java.lang.Object;
class IFoo {
Object getValue() {}
}
class Foo extends IFoo {
Foo getValue() {}
void foo(IFoo o) {
if (o instanceof Foo) {
o.getv<caret>x
}
}
}
@@ -1300,4 +1300,12 @@ public class ListUtils {
checkResult()
}
public void testCastVisually() {
configure()
def p = LookupElementPresentation.renderElement(myFixture.lookupElements[0])
assert p.itemText == 'getValue'
assert p.itemTextBold
assert p.typeText == 'Foo'
}
}