Community
Participate
Working Groups
consider class A<T extends String & List<T>>{ .. } String is final so this bound in simply wrong - it can never be realized. It's trivially detectible and perhaps a worthwhile warning. (kind of like the mandatory error for "foo" instanceof Integer (it can never be true so compiler catches it statically))
There is already a warning for final bounds. Have you seen it ?
nope. that sort of fixes it then. ok to close from my side. however, the problem in this report is definitely indicating a bug while a final bound can be ok (you can still use your A<T extends String> class while A<T extends String & RandomAccess> is doomed from the beginning).
Using build I200410260800, problem report is: "The type parameter T should not be bounded by the final type String. Final types cannot be further extended" Consider this problem fixed. I'll add this bug to JDT/Core buildnotes.
Test case already exists: GenericTypeTest#test021
Verified for 3.1 M3 with build I200411040800