This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Generic Signatures


Andrew Haley wrote:
> I can't get even simple tests with generic signatures to work.  Like
> this:
> 
> public class test2
> {
>   static class A extends ArrayList<String> {};
> 
>   public static void main(String[] args)
>   {
>     A a = new A();
>     Object x = a;
>     ((Collection)x).add(new Byte((byte) 1));
>     System.out.println(x.getClass().getGenericSuperclass());
>     System.out.println("We have a list parametrized with: " +
>                        
> ((ParameterizedType)x.getClass().getGenericSuperclass()).getAc
> tualTypeArguments()[0]);
>   }
> }

This code works for me (on ikvm with classpath cvs head from a couple of
days ago).

Regards,
Jeroen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]