Support for generics in short method declarations
Issue #208
invalid
Short method declarations (not 100% sure that that is the name) is a really nice feature in JastAdd, i.e:
public void A.b(Object o, Collection<Object> res) {
...
}
Unfortunately JastAdd does not support generic methods. I.e. I get parse error for the following:
public <T extends C> void A.b(T o, Collection<T> res) {
...
}
The workaround is to write:
public class A {
public <T extends C> void b(T o, Collection<T> res) {
...
}
}
Unfortunately this introduces some other problems, such as different class declaration signatures for A. I thing that this would be a really nice feature for JastAdd!
Comments (5)
-
-
Which version of JastAdd2 do you have this problem in? Is it reproducible in version 2.1.11+?
-
reporter Well that was embarrassing, upgraded to 2.1.11 (from 2.1.5) and it works fine :) Thank you for the help!
-
reporter - changed status to invalid
My bad, works in 2.1.11.
-
Okay, no problem! At least we have another test for this feature now :)
- Log in to comment
I added a test case for this, but it seems that it works. Here is my test case:
Test.ast:
Test.jrag:
Generated code: