test/tools/javac/diags/examples/BadArgTypesInLambda.java

Wed, 15 May 2013 14:00:31 +0100

author
mcimadamore
date
Wed, 15 May 2013 14:00:31 +0100
changeset 1759
05ec778794d0
parent 1677
94a202228ec2
child 2000
4a6acc42c3a1
permissions
-rw-r--r--

8012003: Method diagnostics resolution need to be simplified in some cases
Summary: Unfold method resolution diagnostics when they mention errors in poly expressions
Reviewed-by: jjg, vromero

mcimadamore@1677 1 /*
mcimadamore@1677 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
mcimadamore@1677 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@1677 4 *
mcimadamore@1677 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@1677 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@1677 7 * published by the Free Software Foundation.
mcimadamore@1677 8 *
mcimadamore@1677 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@1677 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@1677 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@1677 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@1677 13 * accompanied this code).
mcimadamore@1677 14 *
mcimadamore@1677 15 * You should have received a copy of the GNU General Public License version
mcimadamore@1677 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@1677 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@1677 18 *
mcimadamore@1677 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@1677 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@1677 21 * questions.
mcimadamore@1677 22 */
mcimadamore@1677 23
mcimadamore@1677 24 // key: compiler.err.cant.apply.symbol
mcimadamore@1677 25 // key: compiler.misc.no.conforming.assignment.exists
mcimadamore@1677 26 // key: compiler.misc.bad.arg.types.in.lambda
mcimadamore@1759 27 // key: compiler.err.prob.found.req
mcimadamore@1759 28 // key: compiler.misc.inconvertible.types
mcimadamore@1759 29 // options: -Xdiags:verbose
mcimadamore@1677 30
mcimadamore@1677 31 class BadArgTypesInLambda {
mcimadamore@1677 32 interface SAM {
mcimadamore@1677 33 void m(Integer i);
mcimadamore@1677 34 }
mcimadamore@1677 35
mcimadamore@1677 36 void g(SAM s) { }
mcimadamore@1677 37
mcimadamore@1677 38 void test() {
mcimadamore@1677 39 g(x->{ String s = x; });
mcimadamore@1677 40 }
mcimadamore@1677 41 }

mercurial