test/tools/javac/diags/examples/CantApplyDiamond1.java

Mon, 21 Jan 2013 20:13:56 +0000

author
mcimadamore
date
Mon, 21 Jan 2013 20:13:56 +0000
changeset 1510
7873d37f5b37
parent 1296
cddc2c894cc6
child 1562
2154ed9ff6c8
permissions
-rw-r--r--

8005244: Implement overload resolution as per latest spec EDR
Summary: Add support for stuck expressions and provisional applicability
Reviewed-by: jjg

mcimadamore@1238 1 /*
mcimadamore@1238 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
mcimadamore@1238 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
mcimadamore@1238 4 *
mcimadamore@1238 5 * This code is free software; you can redistribute it and/or modify it
mcimadamore@1238 6 * under the terms of the GNU General Public License version 2 only, as
mcimadamore@1238 7 * published by the Free Software Foundation.
mcimadamore@1238 8 *
mcimadamore@1238 9 * This code is distributed in the hope that it will be useful, but WITHOUT
mcimadamore@1238 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
mcimadamore@1238 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
mcimadamore@1238 12 * version 2 for more details (a copy is included in the LICENSE file that
mcimadamore@1238 13 * accompanied this code).
mcimadamore@1238 14 *
mcimadamore@1238 15 * You should have received a copy of the GNU General Public License version
mcimadamore@1238 16 * 2 along with this work; if not, write to the Free Software Foundation,
mcimadamore@1238 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
mcimadamore@1238 18 *
mcimadamore@1238 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
mcimadamore@1238 20 * or visit www.oracle.com if you need additional information or have any
mcimadamore@1238 21 * questions.
mcimadamore@1238 22 */
mcimadamore@1238 23
mcimadamore@1296 24 // key: compiler.err.prob.found.req
mcimadamore@1238 25 // key: compiler.misc.cant.apply.diamond.1
mcimadamore@1268 26 // key: compiler.misc.inferred.do.not.conform.to.upper.bounds
mcimadamore@1238 27 // key: compiler.misc.diamond
mcimadamore@1238 28
mcimadamore@1238 29 class CantApplyDiamond1<X> {
mcimadamore@1238 30
mcimadamore@1238 31 CantApplyDiamond1(CantApplyDiamond1<? super X> lz) { }
mcimadamore@1238 32
mcimadamore@1238 33 void test(CantApplyDiamond1<Integer> li) {
mcimadamore@1238 34 CantApplyDiamond1<String> ls = new CantApplyDiamond1<>(li);
mcimadamore@1238 35 }
mcimadamore@1238 36 }

mercurial