diff options
author | aclement <aclement> | 2005-07-29 12:48:58 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-07-29 12:48:58 +0000 |
commit | d8c084d286dd115764da0c63a824b8c36f71c28b (patch) | |
tree | b67dfa47bbf7ab25408188bfbf0a1d9c03224fa8 /tests/java5/generics/itds | |
parent | 8b26d315d428c9ac5ee5375438f95d8f03b8043e (diff) | |
download | aspectj-d8c084d286dd115764da0c63a824b8c36f71c28b.tar.gz aspectj-d8c084d286dd115764da0c63a824b8c36f71c28b.zip |
genericitds: using wildcard '? extends' with typevariables.
Diffstat (limited to 'tests/java5/generics/itds')
-rw-r--r-- | tests/java5/generics/itds/GenericMethodITD1.aj | 17 | ||||
-rw-r--r-- | tests/java5/generics/itds/GenericMethodITD2.aj | 19 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/GenericMethodITD1.aj b/tests/java5/generics/itds/GenericMethodITD1.aj new file mode 100644 index 000000000..d1ed5ad73 --- /dev/null +++ b/tests/java5/generics/itds/GenericMethodITD1.aj @@ -0,0 +1,17 @@ +import java.util.*; + +class Base { } + +public class GenericMethodITD1 { + + public static void main(String[] argv) { + List<A> as = new ArrayList<A>(); + new Base().simple(as); // this is OK, <E>s upper bound is object + } +} + +class A {} + +aspect X { + <E> void Base.simple(List<? extends E> list) {} +} diff --git a/tests/java5/generics/itds/GenericMethodITD2.aj b/tests/java5/generics/itds/GenericMethodITD2.aj new file mode 100644 index 000000000..8deb71775 --- /dev/null +++ b/tests/java5/generics/itds/GenericMethodITD2.aj @@ -0,0 +1,19 @@ +import java.util.*; + +class Base { } + +public class GenericMethodITD2 { + + public static void main(String[] argv) { + List<A> as = new ArrayList<A>(); + new Base().simple(as); // error + } +} + +class Super {} + +class A extends Super {} + +aspect X { + <E extends Number> void Base.simple(List<? extends E> list) {} +} |