langtools/test/tools/javac/diags/examples/WhereIntersection2.java
author vromero
Wed, 22 Apr 2015 09:44:15 -0700
changeset 30014 fc1f2b200c1f
child 39812 6272642715a1
permissions -rw-r--r--
8078024: javac, several incorporation steps are silently failing when an error should be reported Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30014
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     1
/*
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     2
 * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     4
 *
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     7
 * published by the Free Software Foundation.
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     8
 *
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    13
 * accompanied this code).
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    14
 *
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    18
 *
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    21
 * questions.
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    22
 */
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    23
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    24
// key: compiler.err.intf.expected.here
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    25
// key: compiler.misc.inconvertible.types
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    26
// key: compiler.misc.where.description.typevar
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    27
// key: compiler.misc.where.typevar
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    28
// key: compiler.misc.intersection.type
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    29
// key: compiler.misc.where.description.intersection
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    30
// key: compiler.misc.where.intersection
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    31
// key: compiler.err.prob.found.req
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    32
// options: -XDdiags=where
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    33
// run: simple
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    34
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    35
class WhereIntersection2 {
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    36
    interface I1 {}
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    37
    interface I2 {}
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    38
    class A implements I1, I2 {}
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    39
    class B implements I1, I2 {}
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    40
    class Test {
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    41
        <Z extends A&B> Z m(Z z1, Z z2) { return null; }
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    42
        <T extends I1 & I2> T m2(){
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    43
            return m(new A(), new B());
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    44
        }
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    45
    }
fc1f2b200c1f 8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
diff changeset
    46
}