Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8132535

Compiler fails with diamond anonymous class creation with intersection bound of enclosing class

    Details

    • Subcomponent:
    • Resolved In Build:
      b85
    • Verification:
      Verified

      Backports

        Description

        The following test cause compiler to fail.
        Here qualified anonymous class instance creation expression with diamond is used.
        Bound of enclosing class type parameter need to be intersection.

        Minimal test case:

        interface I {}
        class C {}
        class B extends C implements I {}

        class Test <T extends C & I>{
            class A <T>{
                public A(T b) {
                }
            }
            public void foo(){
                A a = new Test<>().new A<>(new B()){} ;
            }
        }

        It was tested with jdk 9b68 and 9b74

        The failing JCK tests are:
        lang/EXPR/expr629/expr62902m201111/expr62902m201111.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sadayapalam Srikanth Adayapalam
                  Reporter:
                  kbarzilovich Konstantin Barzilovich (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: