|
Java example source code file (TargetType44.java)
The TargetType44.java Java example source code/* * @test /nodynamiccopyright/ * @bug 8003280 * @summary Add lambda tests * compiler throw AssertionError while backtracing from speculative attribution round * @compile/fail/ref=TargetType44.out -XDrawDiagnostics TargetType44.java */ class TargetType44 { interface Unary { void m(int i1); } interface Binary { void m(int i1, int i2); } void m(Unary u) { } void m(Binary u) { } void test() { m(()-> { new Object() { }; }); //fail m(x -> { new Object() { }; }); //ok m((x, y) -> { new Object() { }; }); //ok m((x, y, z) -> { new Object() { }; }); //fail } } Other Java examples (source code examples)Here is a short list of links related to this Java TargetType44.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.