test/tools/javac/lambda/8023558/T8023558a.java

Thu, 12 Sep 2013 22:40:29 +0100

author
vromero
date
Thu, 12 Sep 2013 22:40:29 +0100
changeset 2025
3ae1814f7c59
child 2043
571f8ebc2d51
permissions
-rw-r--r--

8023558: Javac creates invalid bootstrap methods for complex lambda/methodref case
Reviewed-by: jjg
Contributed-by: maurizio.cimadamore@oracle.com, vicente.romero@oracle.com

vromero@2025 1 /*
vromero@2025 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
vromero@2025 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
vromero@2025 4 *
vromero@2025 5 * This code is free software; you can redistribute it and/or modify it
vromero@2025 6 * under the terms of the GNU General Public License version 2 only, as
vromero@2025 7 * published by the Free Software Foundation.
vromero@2025 8 *
vromero@2025 9 * This code is distributed in the hope that it will be useful, but WITHOUT
vromero@2025 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
vromero@2025 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
vromero@2025 12 * version 2 for more details (a copy is included in the LICENSE file that
vromero@2025 13 * accompanied this code).
vromero@2025 14 *
vromero@2025 15 * You should have received a copy of the GNU General Public License version
vromero@2025 16 * 2 along with this work; if not, write to the Free Software Foundation,
vromero@2025 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
vromero@2025 18 *
vromero@2025 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
vromero@2025 20 * or visit www.oracle.com if you need additional information or have any
vromero@2025 21 * questions.
vromero@2025 22 */
vromero@2025 23
vromero@2025 24 /*
vromero@2025 25 * @test
vromero@2025 26 * @bug 8023558
vromero@2025 27 * @summary Javac creates invalid bootstrap methods for complex lambda/methodref case
vromero@2025 28 */
vromero@2025 29 public class T8023558a {
vromero@2025 30 interface SAM<T> {
vromero@2025 31 T get();
vromero@2025 32 }
vromero@2025 33
vromero@2025 34 public static void main(String[] args) {
vromero@2025 35 SAM<SAM> sam = new SAM<SAM>() { public SAM get() { return null; } };
vromero@2025 36 SAM temp = sam.get()::get;
vromero@2025 37 }
vromero@2025 38 }

mercurial