T8142876.java revision 3175:61faee2b9c2b
14Srgrimes/* 2549Srgrimes * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 34Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44Srgrimes * 54Srgrimes * This code is free software; you can redistribute it and/or modify it 64Srgrimes * under the terms of the GNU General Public License version 2 only, as 74Srgrimes * published by the Free Software Foundation. Oracle designates this 84Srgrimes * particular file as subject to the "Classpath" exception as provided 94Srgrimes * by Oracle in the LICENSE file that accompanied this code. 104Srgrimes * 114Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT 124Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 134Srgrimes * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 144Srgrimes * version 2 for more details (a copy is included in the LICENSE file that 154Srgrimes * accompanied this code). 164Srgrimes * 174Srgrimes * You should have received a copy of the GNU General Public License version 184Srgrimes * 2 along with this work; if not, write to the Free Software Foundation, 194Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 204Srgrimes * 214Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 224Srgrimes * or visit www.oracle.com if you need additional information or have any 234Srgrimes * questions. 244Srgrimes */ 254Srgrimes 264Srgrimes/* 274Srgrimes * @test 284Srgrimes * @bug 8142876 294Srgrimes * @summary Javac does not correctly implement wildcards removal from functional interfaces 304Srgrimes * @compile T8142876.java 314Srgrimes */ 324Srgrimesclass T8142876 { 334Srgrimes interface I<R extends Runnable, T> { 344Srgrimes void m(); 354Srgrimes } 364Srgrimes 37549Srgrimes void test() { 389744Sdg I<? extends O, String> succeed = this::ff; 394Srgrimes I<? extends Comparable<String>, String> failed = this::ff; 404Srgrimes } 41556Srgrimes 42556Srgrimes interface O {} 434Srgrimes 441549Srgrimes private void ff(){} 451549Srgrimes} 461549Srgrimes