mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
allow to infer expected type from cast expr (IDEA-97727)
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>5</line>
|
||||
<description>Casting <code>getComponent("bar")</code> to <code>Bar</code> is redundant</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>6</line>
|
||||
<description>Casting <code>getComponent("bar")</code> to <code>Bar</code> is redundant</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
class Test {
|
||||
|
||||
{
|
||||
f((Bar) getComponent("bar"));
|
||||
f1((Bar) getComponent("bar"));
|
||||
Bar b = (Bar) getComponent("bar");
|
||||
}
|
||||
|
||||
private <J extends Bar> void f(J j) {}
|
||||
|
||||
private <J> void f1(J j) {}
|
||||
|
||||
private <T> T getComponent(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static class Bar {}
|
||||
}
|
||||
Reference in New Issue
Block a user