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

Illegal type variable bound cause compiler crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      This program causes a compiler crash (with -XDdev):

      class Test {
          public static <T extends U & Test, U> T max() {
              return null;
          }
      }

      java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeSymbol cannot be cast to com.sun.tools.javac.code.Symbol$ClassSymbol
              at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1544)
              at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1535)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2722)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2652)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2588)
              at com.sun.tools.javac.comp.Attr.attribBounds(Attr.java:466)
              at com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:570)
              at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:640)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:358)
              at com.sun.tools.javac.comp.Attr.attribStat(Attr.java:395)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2726)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2652)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2588)
              at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1036)
              at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:765)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
              at com.sun.tools.javac.main.Main.compile(Main.java:366)
              at com.sun.tools.javac.main.Main.compile(Main.java:292)
              at com.sun.tools.javac.main.Main.compile(Main.java:283)
              at com.sun.tools.javac.Main.compile(Main.java:69)
              at com.sun.tools.javac.Main.main(Main.java:54)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ahe Peter Ahe
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: