Unrelated defaults inheritance error for type variables: why?

后端 未结 3 1405
天涯浪人
天涯浪人 2020-12-14 17:02

Disclaimer: this is not about this case (while error sounds as same): class inherits unrelated defaults for spliterator() from types java.u

3条回答
  •  时光取名叫无心
    2020-12-14 17:42

    This is simply a bug. It turns out that the bug starts in the specification, and then spills over into the implementation. Spec bug is here: https://bugs.openjdk.java.net/browse/JDK-7120669

    The constraint is perfectly valid; it is clearly possible that there exist types T that extend both I1 and I2. The problem is how we validate the well-formedness of such types.

提交回复
热议问题