diff options
author | aclement <aclement> | 2005-08-13 15:41:23 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-08-13 15:41:23 +0000 |
commit | 5771d66f8e74b61550ef6a15bb00032fefbfbac2 (patch) | |
tree | cbe6363819cdab2c2ad304fd054b19b939cbb3c2 /tests/java5 | |
parent | aee5f8a89bc4cd4c91a801249c25c9527d056272 (diff) | |
download | aspectj-5771d66f8e74b61550ef6a15bb00032fefbfbac2.tar.gz aspectj-5771d66f8e74b61550ef6a15bb00032fefbfbac2.zip |
genericitds: more combinations...
Diffstat (limited to 'tests/java5')
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodJ.aj | 16 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodK.aj | 16 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodL.aj | 21 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodM.aj | 24 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodM2.aj | 24 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodN.aj | 12 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodO.aj | 12 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodO2.aj | 12 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodP.aj | 11 | ||||
-rw-r--r-- | tests/java5/generics/itds/sharing/MethodQ.aj | 14 |
10 files changed, 162 insertions, 0 deletions
diff --git a/tests/java5/generics/itds/sharing/MethodJ.aj b/tests/java5/generics/itds/sharing/MethodJ.aj new file mode 100644 index 000000000..277646642 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodJ.aj @@ -0,0 +1,16 @@ +import java.util.*; + +public class MethodJ { + public static void main(String []argv) { + One o = new One(); + List l = o.m(); + } +} + +interface I<N extends Number> { } + +class One implements I {} + +aspect X { + public List I.m() { return null;} // ok, very simple ITD on generic type, should be available for call on One +} diff --git a/tests/java5/generics/itds/sharing/MethodK.aj b/tests/java5/generics/itds/sharing/MethodK.aj new file mode 100644 index 000000000..4356b264c --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodK.aj @@ -0,0 +1,16 @@ +import java.util.*; + +public class MethodK { + public static void main(String []argv) { + One o = new One(); + List l = o.m(); + } +} + +interface I<N extends Number> { } + +class One implements I<Double> {} + +aspect X { + public List I.m() { return null;} // ok, ITD on a generic type which gets parameterized into One. +} diff --git a/tests/java5/generics/itds/sharing/MethodL.aj b/tests/java5/generics/itds/sharing/MethodL.aj new file mode 100644 index 000000000..84feba150 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodL.aj @@ -0,0 +1,21 @@ +import java.util.*; + +public class MethodL { + public static void main(String []argv) { + List<Double> doubleList = new ArrayList<Double>(); + List<Float> floatList = new ArrayList<Float>(); + + One<Double> o1 = new One<Double>(); + One<Float> o2 = new One<Float>(); + List a = o1.m(); + List b = o2.m(); + } +} + +interface I<N extends Number> { } + +class One<Z extends Number> implements I<Z> {} + +aspect X { + public List I.m() { return null; } // ok, available in both parameterizations of One +} diff --git a/tests/java5/generics/itds/sharing/MethodM.aj b/tests/java5/generics/itds/sharing/MethodM.aj new file mode 100644 index 000000000..2612186f7 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodM.aj @@ -0,0 +1,24 @@ +import java.util.*; + +public class MethodM { + public static void main(String []argv) { + List<Double> doubleList = new ArrayList<Double>(); + List<Float> floatList = new ArrayList<Float>(); + + One o = new One(); + List<Double> ld = o.m(); + + Two t = new Two(); + List<Float> lf = t.m(); + } +} + +interface I<N extends Number> { } + +class One implements I<Double> {} + +class Two implements I<Float> {} + +aspect X { + public List<Z> I<Z>.m() { return null;} // ok +} diff --git a/tests/java5/generics/itds/sharing/MethodM2.aj b/tests/java5/generics/itds/sharing/MethodM2.aj new file mode 100644 index 000000000..3819387f7 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodM2.aj @@ -0,0 +1,24 @@ +import java.util.*; + +public class MethodM2 { + public static void main(String []argv) { + List<Double> doubleList = new ArrayList<Double>(); + List<Float> floatList = new ArrayList<Float>(); + + One o = new One(); + o.m(new ArrayList<Double>()); + + Two t = new Two(); + t.m(new ArrayList<Float>()); + } +} + +interface I<N extends Number> { } + +class One implements I<Double> {} + +class Two implements I<Float> {} + +aspect X { + public void I<Z>.m(List<Z> lz) {} // ok +} diff --git a/tests/java5/generics/itds/sharing/MethodN.aj b/tests/java5/generics/itds/sharing/MethodN.aj new file mode 100644 index 000000000..5a6a65888 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodN.aj @@ -0,0 +1,12 @@ +import java.util.*; + +public class MethodN { + public static void main(String []argv) { + } +} + +interface I { } + +aspect X { + public List<Z> I<Z>.m() {}; // error - the onType isn't generic! +} diff --git a/tests/java5/generics/itds/sharing/MethodO.aj b/tests/java5/generics/itds/sharing/MethodO.aj new file mode 100644 index 000000000..ae95c31af --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodO.aj @@ -0,0 +1,12 @@ +import java.util.*; + +public class MethodO { + public static void main(String []argv) { + } +} + +interface I<N> { } + +aspect X { + public List<String> I<String>.m() {}; // error, String is an exact type +} diff --git a/tests/java5/generics/itds/sharing/MethodO2.aj b/tests/java5/generics/itds/sharing/MethodO2.aj new file mode 100644 index 000000000..0a8d77b78 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodO2.aj @@ -0,0 +1,12 @@ +import java.util.*; + +public class MethodO2 { + public static void main(String []argv) { + } +} + +interface I<N> { } + +aspect X { + public void I<String>.m(List<String> ls) {}; // error, String is an exact type +} diff --git a/tests/java5/generics/itds/sharing/MethodP.aj b/tests/java5/generics/itds/sharing/MethodP.aj new file mode 100644 index 000000000..b88d3e9bc --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodP.aj @@ -0,0 +1,11 @@ +import java.util.*; + +public class MethodP { + public static void main(String []argv) { } +} + +class SimpleClass<N extends Number> { } + +aspect X { + public static List<N> SimpleClass<N>.m() {return null;} // error, static members in generic types cannot use the type variables +} diff --git a/tests/java5/generics/itds/sharing/MethodQ.aj b/tests/java5/generics/itds/sharing/MethodQ.aj new file mode 100644 index 000000000..6c0bf7ad5 --- /dev/null +++ b/tests/java5/generics/itds/sharing/MethodQ.aj @@ -0,0 +1,14 @@ +import java.util.*; + +public class MethodQ { + public static void main(String []argv) { + SimpleClass<Float> sc = new SimpleClass<Float>(); + sc.m<Integer>(new ArrayList<Integer>(),new ArrayList<Float>()); + } +} + +class SimpleClass<N extends Number> { } + +aspect X { + public <L extends Number> void SimpleClass<Z>.m(List<L> ll, List<Z> lz) {} // scary, multiple tvars, one from member, one from target +} |