summaryrefslogtreecommitdiff
path: root/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/IDEA84533.java
blob: 23c27ee1b0eedb3fbb39f9b3c942836bcbc07f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public class Main {
    static class A {}
    static class B extends A {}
    static class X<T> { }
    static class Y<T> extends X<T> { }

    private void test1(X<B> x) {
        Y<A> y = <error descr="Inconvertible types; cannot cast 'Main.X<Main.B>' to 'Main.Y<Main.A>'">(Y<A>) x</error>;
    }

    private void test2(X<A> x) {
        Y<A> y = (Y<A>) x;
    }

    private void test3(Y<B> y1) {
        @SuppressWarnings("unchecked")
        Y<A> y2 = <error descr="Inconvertible types; cannot cast 'Main.Y<Main.B>' to 'Main.Y<Main.A>'">(Y<A>) y1</error>;
    }
}