diff options
author | aclement <aclement> | 2005-10-20 14:47:22 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-10-20 14:47:22 +0000 |
commit | 6e337a8e27541f3223a5312bd47013f195915be1 (patch) | |
tree | eb8df591912c5da2fa4b8e14293b21ad7a85d4a8 /tests/java5/generics | |
parent | f06df41e4038bbde47a9934b240a3c064aa26099 (diff) | |
download | aspectj-6e337a8e27541f3223a5312bd47013f195915be1.tar.gz aspectj-6e337a8e27541f3223a5312bd47013f195915be1.zip |
*Now* we're moving - more and more stuff from GenericsTests is working :) see pr112105 comment #11
Diffstat (limited to 'tests/java5/generics')
-rw-r--r-- | tests/java5/generics/genericaspects/GenericAspectK.aj | 4 | ||||
-rw-r--r-- | tests/java5/generics/genericaspects/GenericAspectK2.aj | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/java5/generics/genericaspects/GenericAspectK.aj b/tests/java5/generics/genericaspects/GenericAspectK.aj index 5c4b72f93..2a15c0aee 100644 --- a/tests/java5/generics/genericaspects/GenericAspectK.aj +++ b/tests/java5/generics/genericaspects/GenericAspectK.aj @@ -4,13 +4,13 @@ abstract aspect GenericAspect<A,B> { interface SimpleI<L extends Number> {} - declare parents: A implements SimpleI<B>; + declare parents: A implements SimpleI<B>; // Error: 'B' specified in the GenericAspect declaration doesnt say 'B extends Number' public N SimpleI<N>.m4(N n) { System.err.println(n);return n;} } -aspect GenericAspectI extends GenericAspect<Base,String> { // error, String doesnt meet bounds in SimpleI<> in the generic aspect +aspect GenericAspectK extends GenericAspect<Base,String> { // Error: String doesnt extend Number public static void main(String []argv) { Base b = new Base(); String s = b.m4("hello"); diff --git a/tests/java5/generics/genericaspects/GenericAspectK2.aj b/tests/java5/generics/genericaspects/GenericAspectK2.aj new file mode 100644 index 000000000..2c4ce99a1 --- /dev/null +++ b/tests/java5/generics/genericaspects/GenericAspectK2.aj @@ -0,0 +1,23 @@ +import java.util.*; + +abstract aspect GenericAspect<A,B extends Number> { + + interface SimpleI<L extends Number> {} + + declare parents: A implements SimpleI<B>; + + public N SimpleI<N>.m4(N n) { System.err.println(n);return n;} + +} + +aspect GenericAspectK2 extends GenericAspect<Base,String> { // Error: String doesnt meet bounds for B in GenericAspect + public static void main(String []argv) { + Base b = new Base(); + String s = b.m4("hello"); + if (!s.equals("hello")) + throw new RuntimeException("Not hello?? "+s); + } +} + +class Base {} + |