Incorrect wildcard parameterization subtype relations

Issue #156 resolved
Jesper Öqvist created an issue

ExtendJ 8.0.1-95-gd723ef3

ExtendJ computes incorrect subtype relations for some wildcard-parameterized types. The following code should compile, but gives an error message:

// Test subtyping relation for wildcard parameterized types.
// .result=COMPILE_PASS
public class Test {
  Klass<?> test(Klass<?> klass) {
    return klass.superklass();
  }

  interface Klass<T> {
    Klass<? super T> superklass();
  }
}

The above test case gives the following compile error:

    [junit] tests/generics/subtype_01p/Test.java:5: error: return value must be an instance of Test.Klass<wildcards.? extends java.lang.Object> which Test.Klass<wildcards.? super wildcards.? extends java.lang.Object> is not

Comments (1)

  1. Log in to comment