0

我想在编译时将 2 个类相互关联:

class Test<A extends Test<A, B>, B extends Test<B, A>> {}
class Foo extends Test<Foo, Bar> {}
class Bar extends Test<Bar, Foo> {}

但是,它编译时出现错误

type argument B is not within bounds of type-variable A

但我在代码中看不到任何问题。

UPD。用 7u40 编译没有错误。1.7.0_06-ea-b07 的错误

4

0 回答 0