IDEA Generics fail with <T extends Number & Comparable<T>>

Thank you for IDEA 10.5.  However, I notice there is a bug.  The code below shows a red squiggle in the main() method.




public class IDEAGenericsFail {

    public static void main(String[] args) {
        IDEAGenericsFail fail = new IDEAGenericsFail();

        Dummy<?> d = new Dummy<Integer>();

        fail.myMethod(d);
    }

    public <T extends Number & Comparable<T>> Dummy<T> myMethod(Dummy<T> dummy) {
        return null;
    }

    public static class Dummy<T extends Number & Comparable<T>> {
    }
}

0
2 comments

Hi Ben,

please file an issue.

0

I did that a long time ago!

http://youtrack.jetbrains.net/issue/IDEA-55003

Please find it in your heart to prioritise fixing it - it makes me sad whenever I see these non-errors in our codebase.

0

Please sign in to leave a comment.