Re: Java Generics - "super" keyword usage
Olivier Lefevre <[email protected]>
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
Your snippet was really elliptic. I assumed the following definitions:
interface IColumn { }
interface ICompactSerializer<T> { }
class MyColumnSerializer implements ICompactSerializer<MyColumn> { }
class MyColumn implements IColumn { }
Your problem is that you declare that you are returning a
ICompactSerializer<T> but are actually returning ICompactSerializer<MyColumn>
Even if T somehow is a MyColumn the compiler correctly cannot
figure it out from this context. A cast of MyColumnSerializer
to ICompactSerializer<T> will succeed but is pretty meaningless
w/o knowing what is T.
-- O.L.
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com