testdata for IDEA-157926

GitOrigin-RevId: 0227aa27f1329ae64011e737291f27338ed5a825
This commit is contained in:
Anna Kozlova
2020-05-05 11:29:06 +00:00
committed by intellij-monorepo-bot
parent 06d5a740c0
commit 0ed0e007ee
2 changed files with 17 additions and 0 deletions
@@ -0,0 +1,16 @@
import java.util.function.Consumer;
class Program {
static <T> T foo(Consumer<T> c) {
c.accept(null);
return null;
}
public static void main(String[] args) {
long l = (<warning descr="Casting 'foo(...)' to 'long' is redundant">long</warning>)foo(x -> bar(x));
}
static void bar(Long x) { System.out.println(1);}
static void bar(Object x) { System.out.println(2); }
}
@@ -48,4 +48,5 @@ public class RedundantCast18Test extends LightDaemonAnalyzerTestCase {
public void testDiamondWithUpperBounds() { doTest();}
public void testBinaryConversions() { doTest();}
public void testInferenceIncompatibilityWithoutCast() { doTest();}
public void testCastToPrimitive() { doTest();}
}