test/tools/javac/generics/8064803/T8064803.java

Sat, 07 Nov 2020 10:30:02 +0800

author
aoqi
date
Sat, 07 Nov 2020 10:30:02 +0800
changeset 3938
93012e2a5d1d
parent 2794
7c25c29a7544
permissions
-rw-r--r--

Added tag mips-jdk8u275-b01 for changeset eb6ee6a5f2fe

mcimadamore@2794 1 /*
mcimadamore@2794 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
mcimadamore@2794 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@2794 4 *
mcimadamore@2794 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@2794 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@2794 7 * published by the Free Software Foundation. Oracle designates this
mcimadamore@2794 8 * particular file as subject to the "Classpath" exception as provided
mcimadamore@2794 9 * by Oracle in the LICENSE file that accompanied this code.
mcimadamore@2794 10 *
mcimadamore@2794 11 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@2794 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@2794 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@2794 14 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@2794 15 * accompanied this code).
mcimadamore@2794 16 *
mcimadamore@2794 17 * You should have received a copy of the GNU General Public License version
mcimadamore@2794 18 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@2794 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@2794 20 *
mcimadamore@2794 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@2794 22 * or visit www.oracle.com if you need additional information or have any
mcimadamore@2794 23 * questions.
mcimadamore@2794 24 */
mcimadamore@2794 25
mcimadamore@2794 26 /*
mcimadamore@2794 27 * @test
mcimadamore@2794 28 * @bug 8064803
mcimadamore@2794 29 * @summary Javac erroneously uses instantiated signatures when merging abstract most-specific methods
mcimadamore@2794 30 */
mcimadamore@2794 31 public class T8064803 {
mcimadamore@2794 32 interface ParentA<T> {
mcimadamore@2794 33 T process() throws Exception;
mcimadamore@2794 34 }
mcimadamore@2794 35
mcimadamore@2794 36 interface ParentB<T> {
mcimadamore@2794 37 T process() throws Exception;
mcimadamore@2794 38 }
mcimadamore@2794 39
mcimadamore@2794 40 interface Child<T> extends ParentA<T>, ParentB<T> { }
mcimadamore@2794 41
mcimadamore@2794 42 static class ChildImpl<T> implements Child<T> {
mcimadamore@2794 43 @Override
mcimadamore@2794 44 public T process() {
mcimadamore@2794 45 return null;
mcimadamore@2794 46 }
mcimadamore@2794 47 }
mcimadamore@2794 48
mcimadamore@2794 49 public static void main(String[] args) throws Exception {
mcimadamore@2794 50 Child<String> child = new ChildImpl<String>();
mcimadamore@2794 51 child.process();
mcimadamore@2794 52 }
mcimadamore@2794 53 }

mercurial