ClassCastException in javac with conjunction types

XMLWordPrintable

    • b140
    • x86
    • windows_7
    • Verified

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      interface A
      {
          abstract <T> void foo();
      }

      interface B
      {
          abstract void foo();
      }

      class C<T extends A & B>
      {
          void bar(T x)
          {
              x.foo();
          }
      }

      javac throws the following exception:
      java.lang.ClassCastException: com.sun.tools.javac.code.Type$MethodType cannot be cast to com.sun.tools.javac.code.Type$ForAll


      REPRODUCIBILITY :
      This bug can be reproduced always.
      Bugs 4851398 and 4881362 reported crash using similar conjunction types but those could not be reproduce.
      This crashes same way with jdk5,6,7.

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: