From 5771d66f8e74b61550ef6a15bb00032fefbfbac2 Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 13 Aug 2005 15:41:23 +0000 Subject: [PATCH] genericitds: more combinations... --- tests/java5/generics/itds/sharing/MethodJ.aj | 16 +++++++++++++ tests/java5/generics/itds/sharing/MethodK.aj | 16 +++++++++++++ tests/java5/generics/itds/sharing/MethodL.aj | 21 ++++++++++++++++ tests/java5/generics/itds/sharing/MethodM.aj | 24 +++++++++++++++++++ tests/java5/generics/itds/sharing/MethodM2.aj | 24 +++++++++++++++++++ tests/java5/generics/itds/sharing/MethodN.aj | 12 ++++++++++ tests/java5/generics/itds/sharing/MethodO.aj | 12 ++++++++++ tests/java5/generics/itds/sharing/MethodO2.aj | 12 ++++++++++ tests/java5/generics/itds/sharing/MethodP.aj | 11 +++++++++ tests/java5/generics/itds/sharing/MethodQ.aj | 14 +++++++++++ 10 files changed, 162 insertions(+) create mode 100644 tests/java5/generics/itds/sharing/MethodJ.aj create mode 100644 tests/java5/generics/itds/sharing/MethodK.aj create mode 100644 tests/java5/generics/itds/sharing/MethodL.aj create mode 100644 tests/java5/generics/itds/sharing/MethodM.aj create mode 100644 tests/java5/generics/itds/sharing/MethodM2.aj create mode 100644 tests/java5/generics/itds/sharing/MethodN.aj create mode 100644 tests/java5/generics/itds/sharing/MethodO.aj create mode 100644 tests/java5/generics/itds/sharing/MethodO2.aj create mode 100644 tests/java5/generics/itds/sharing/MethodP.aj create mode 100644 tests/java5/generics/itds/sharing/MethodQ.aj 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 { } + +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 { } + +class One implements I {} + +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 doubleList = new ArrayList(); + List floatList = new ArrayList(); + + One o1 = new One(); + One o2 = new One(); + List a = o1.m(); + List b = o2.m(); + } +} + +interface I { } + +class One implements I {} + +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 doubleList = new ArrayList(); + List floatList = new ArrayList(); + + One o = new One(); + List ld = o.m(); + + Two t = new Two(); + List lf = t.m(); + } +} + +interface I { } + +class One implements I {} + +class Two implements I {} + +aspect X { + public List I.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 doubleList = new ArrayList(); + List floatList = new ArrayList(); + + One o = new One(); + o.m(new ArrayList()); + + Two t = new Two(); + t.m(new ArrayList()); + } +} + +interface I { } + +class One implements I {} + +class Two implements I {} + +aspect X { + public void I.m(List 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 I.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 { } + +aspect X { + public List I.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 { } + +aspect X { + public void I.m(List 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 { } + +aspect X { + public static List SimpleClass.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 sc = new SimpleClass(); + sc.m(new ArrayList(),new ArrayList()); + } +} + +class SimpleClass { } + +aspect X { + public void SimpleClass.m(List ll, List lz) {} // scary, multiple tvars, one from member, one from target +} -- 2.39.5