This case seems to be another one where Eclipse's Java compiler crushes javac. The only question for me is whether it's a bug in JLS or javac.
interface EndoFunctor< C, FC extends EndoFunctor< C, FC > > { /*...*/ }
interface Algebra< C, FC extends EndoFunctor< ? extends C, FC > > { /*...*/ }
The second line compiles in Eclipse, but fails to compile in javac with the message that "type parameter FC is not within its bound".
FC is declared to extend EndoFunctor< ? extends C, FC >, and the bound on FC is that it extend EndoFunctor< D, FC > for the inferred D, which in this case is ? extends C. I think javac doesn't realize that the wildcard represents the same unknown type in both contexts. Eclipse does, though!
Apparently the following gets around the problem in javac:
interface EndoFunctor< C, FC extends EndoFunctor< ? extends C, FC > > { /*...*/ }
but this is a looser definition than I want for that interface.
I could also try
interface Algebra< C, D extends C, FC extends EndoFunctor< D, FC > >
but that approach forces me to carry that extra type parameter D through everywhere.
What to do?