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

Problem with dependent type parameters in generic method

    XMLWordPrintable

Details

    • beta2
    • generic
    • solaris_7
    • Verified

    Description

      This is a problem in the prototype for jsr14 generics:

      frog$ cat -n T.java
           1 class T {
           2 public static <S, T extends S> void f(S s, T t) {}
           3 }
      frog$ /java/jdk/ws/tools/jsr14/build/solaris-sparc/bin/javac -gj T.java
      T.java:2: unexpected type
      found : S
      required: class
          public static <S, T extends S> void f(S s, T t) {}
                                      ^
      An exception has occurred in the compiler (1.4.0-internal). Please file a bug at the Java
      Developer Connection
      (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates.
      Include your program and the
      following diagnostic in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.v8.code.Type$TypeVar.supertype(Type.java:1264)
              at com.sun.tools.javac.v8.comp.Check.checkClassBounds(Check.java:1041)
              at com.sun.tools.javac.v8.comp.Check.checkClassBounds(Check.java:1018)
              at com.sun.tools.javac.v8.comp.Check$Validator._case(Check.java:521)
              at com.sun.tools.javac.v8.tree.Tree$TypeParameter.visit(Tree.java:979)
              at com.sun.tools.javac.v8.comp.Check.validate(Check.java:460)
              at com.sun.tools.javac.v8.comp.Check.validateTypeParams(Check.java:478)
              at com.sun.tools.javac.v8.comp.Attr._case(Attr.java:419)
              at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java:416)
              at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:274)
              at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:308)
              at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:2000)
              at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:375)
              at com.sun.tools.javac.v8.Main.compile(Main.java:411)
              at com.sun.tools.javac.Main.compile(Main.java:28)
              at com.sun.tools.javac.Main.main(Main.java:19)
      frog$

      Attachments

        Activity

          People

            gafter Neal Gafter
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: