T8073842.java revision 2838:218d589184d3
1195359Simp/* 2195359Simp * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 3195359Simp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4195359Simp * 5195359Simp * This code is free software; you can redistribute it and/or modify it 6195359Simp * under the terms of the GNU General Public License version 2 only, as 7195359Simp * published by the Free Software Foundation. Oracle designates this 8195359Simp * particular file as subject to the "Classpath" exception as provided 9195359Simp * by Oracle in the LICENSE file that accompanied this code. 10195359Simp * 11195359Simp * This code is distributed in the hope that it will be useful, but WITHOUT 12195359Simp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13195359Simp * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14195359Simp * version 2 for more details (a copy is included in the LICENSE file that 15195359Simp * accompanied this code). 16195359Simp * 17195359Simp * You should have received a copy of the GNU General Public License version 18195359Simp * 2 along with this work; if not, write to the Free Software Foundation, 19195359Simp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20195359Simp * 21195359Simp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22195359Simp * or visit www.oracle.com if you need additional information or have any 23195359Simp * questions. 24195359Simp */ 25195359Simp 26195359Simp/* 27195359Simp * @test 28195359Simp * @bug 8073842 29195359Simp * @summary Invalid method reference when referencing a method on a wildcard type 30195359Simp * @compile T8073842.java 31195359Simp */ 32195359Simp 33195359Simpimport java.util.stream.Stream; 34195359Simp 35195359Simpclass T8073842 { 36195359Simp 37195359Simp static class Chunck { 38195359Simp public void work() { } 39195359Simp } 40195359Simp 41195359Simp void test(Stream<? extends Chunck> s) { 42195359Simp Stream<Runnable> r = s.map(o -> o::work); 43195359Simp } 44195359Simp} 45195359Simp