InferenceVariableInstantiatedUnexpectedlyTest.java revision 3518:ddc91de2ee61
155714Skris/* 255714Skris * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 355714Skris * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 455714Skris * 555714Skris * This code is free software; you can redistribute it and/or modify it 655714Skris * under the terms of the GNU General Public License version 2 only, as 755714Skris * published by the Free Software Foundation. 855714Skris * 955714Skris * This code is distributed in the hope that it will be useful, but WITHOUT 1055714Skris * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1155714Skris * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1255714Skris * version 2 for more details (a copy is included in the LICENSE file that 1355714Skris * accompanied this code). 1455714Skris * 1555714Skris * You should have received a copy of the GNU General Public License version 1655714Skris * 2 along with this work; if not, write to the Free Software Foundation, 1755714Skris * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1855714Skris * 1955714Skris * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2055714Skris * or visit www.oracle.com if you need additional information or have any 2155714Skris * questions. 2255714Skris */ 2355714Skris 2455714Skris/* 2555714Skris * @test 2655714Skris * @bug 8048543 2755714Skris * @summary JLS8 18.5.3: inference variable seems to be instantiated unexpectedly 2855714Skris * @compile InferenceVariableInstantiatedUnexpectedlyTest.java 2955714Skris */ 3055714Skris 3155714Skrispublic class InferenceVariableInstantiatedUnexpectedlyTest { 3255714Skris interface Iface<A1 extends A2, A2> { 3355714Skris String m(A1 t); 3455714Skris } 3555714Skris 3655714Skris public void run() { 3755714Skris Iface<? super Integer, Number> i = (Integer a) -> a.toString(); 3855714Skris } 3955714Skris} 4055714Skris