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

Inference should compute glb of type arguments

XMLWordPrintable

    • 5.0
    • 5.0
    • b71
    • generic
    • solaris_8
    • Verified

      from http://forum.java.sun.com/thread.jsp?forum=316&thread=523496

      I have changed the code to make it compile:

      abstract class Test {

          protected <T> void getConstructor(Class<? extends T> clazz) {
              Class<? extends T> impl;
              impl = clazz.isInterface() ? getImplementationClass(clazz) : clazz;
              if (clazz.isInterface()) {
                  impl = getImplementationClass(clazz);
              } else {
                  impl = clazz;
              }
          }


          abstract public <T> Class<? extends T>
          getImplementationClass(Class<T> interfaceClass);
      }

      This line don't compile in tiger-fcs, but compiled in b48:

      impl = clazz.isInterface() ? getImplementationClass(clazz) : clazz;
      ###@###.### 10/27/04 01:05 GMT

            ahe Peter Ahe
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: