test/tools/javac/OverrideChecks/6738538/T6738538a.java

Tue, 11 Aug 2009 01:13:42 +0100

author
mcimadamore
date
Tue, 11 Aug 2009 01:13:42 +0100
changeset 360
62fb6cafa93b
parent 134
8c098cf64ab5
child 525
9871ce4fd56f
permissions
-rw-r--r--

6869075: regression: javac crashes when compiling compound string assignment with generics
Summary: javac should not add syntehtic cast to the LHS of an assignment expression
Reviewed-by: jjg

mcimadamore@134 1 /*
mcimadamore@134 2 * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
mcimadamore@134 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@134 4 *
mcimadamore@134 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@134 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@134 7 * published by the Free Software Foundation.
mcimadamore@134 8 *
mcimadamore@134 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@134 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@134 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@134 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@134 13 * accompanied this code).
mcimadamore@134 14 *
mcimadamore@134 15 * You should have received a copy of the GNU General Public License version
mcimadamore@134 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@134 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@134 18 *
mcimadamore@134 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
mcimadamore@134 20 * CA 95054 USA or visit www.sun.com if you need additional information or
mcimadamore@134 21 * have any questions.
mcimadamore@134 22 */
mcimadamore@134 23
mcimadamore@134 24 /*
mcimadamore@134 25 * @test
mcimadamore@134 26 * @bug 6738538 6687444
mcimadamore@134 27 * @summary javac crashes when using a type parameter as a covariant method return type
mcimadamore@134 28 * @author Maurizio Cimadamore
mcimadamore@134 29 *
mcimadamore@134 30 * @compile T6738538a.java
mcimadamore@134 31 */
mcimadamore@134 32
mcimadamore@134 33 class T6738538a {
mcimadamore@134 34
mcimadamore@134 35 class C<T> {
mcimadamore@134 36 public T m(){
mcimadamore@134 37 return null;
mcimadamore@134 38 }
mcimadamore@134 39 }
mcimadamore@134 40 interface I<T>{
mcimadamore@134 41 public T m();
mcimadamore@134 42 }
mcimadamore@134 43 class Crash<T extends C<?> & I> {}
mcimadamore@134 44 }

mercurial