detect expected type by parent for nested array initializers (IDEA-139280)

This commit is contained in:
Anna Kozlova
2015-04-16 20:30:31 +02:00
parent fd11949634
commit 09f4d7ea1f
3 changed files with 21 additions and 0 deletions
@@ -0,0 +1,15 @@
import java.util.function.IntFunction;
class Test {
public static void main(String[] args) {
Object[][] o = new Object[][] {{
(IntFunction<String>) integer -> Integer.toString(integer)
}};
Object[] o1 = new Object[] {
(IntFunction<String>) integer -> Integer.toString(integer)
};
}
}
@@ -39,6 +39,7 @@ public class LambdaRedundantCastTest extends LightDaemonAnalyzerTestCase {
public void testLambdaReturnExpressions() { doTest(); }
public void testLambdaReturnExpressions1() { doTest(); }
public void testPreventBadReturnTypeInReturnExpression() { doTest(); }
public void testExpectedTypeByNestedArrayInitializer() { doTest(); }
private void doTest() {
doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);