From d94ade722d8a1212aa7c9b6ca90fe47a637e2c7a Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 20 Aug 2008 22:06:53 +0000 Subject: 222648: testcode --- tests/bugs162/pr222648/DataAspect.aj | 11 ++++++++ tests/bugs162/pr222648/DataInterface.java | 9 ++++++ tests/bugs162/pr222648/Foo.java | 12 ++++++++ tests/bugs162/pr222648/FooBase.java | 9 ++++++ tests/bugs162/pr222648/Marker.java | 7 +++++ tests/bugs162/pr222648/Resource.java | 5 ++++ tests/bugs162/pr222648/X.java | 46 +++++++++++++++++++++++++++++++ 7 files changed, 99 insertions(+) create mode 100644 tests/bugs162/pr222648/DataAspect.aj create mode 100644 tests/bugs162/pr222648/DataInterface.java create mode 100644 tests/bugs162/pr222648/Foo.java create mode 100644 tests/bugs162/pr222648/FooBase.java create mode 100644 tests/bugs162/pr222648/Marker.java create mode 100644 tests/bugs162/pr222648/Resource.java create mode 100644 tests/bugs162/pr222648/X.java (limited to 'tests/bugs162') diff --git a/tests/bugs162/pr222648/DataAspect.aj b/tests/bugs162/pr222648/DataAspect.aj new file mode 100644 index 000000000..e1e10803e --- /dev/null +++ b/tests/bugs162/pr222648/DataAspect.aj @@ -0,0 +1,11 @@ +package test; + +public aspect DataAspect +{ + + public CONTENT Marker.getContent() + { + return null; + } + +} diff --git a/tests/bugs162/pr222648/DataInterface.java b/tests/bugs162/pr222648/DataInterface.java new file mode 100644 index 000000000..76e9b18f8 --- /dev/null +++ b/tests/bugs162/pr222648/DataInterface.java @@ -0,0 +1,9 @@ +package test; + +public interface DataInterface +{ + + public CONTENT getContent(); + + +} diff --git a/tests/bugs162/pr222648/Foo.java b/tests/bugs162/pr222648/Foo.java new file mode 100644 index 000000000..ebf2b0b8b --- /dev/null +++ b/tests/bugs162/pr222648/Foo.java @@ -0,0 +1,12 @@ +package test; + + + +abstract public class Foo +< CONTENT extends Resource, + DATA extends DataInterface +> + extends + test.FooBase +{ +} diff --git a/tests/bugs162/pr222648/FooBase.java b/tests/bugs162/pr222648/FooBase.java new file mode 100644 index 000000000..e9e0e25b6 --- /dev/null +++ b/tests/bugs162/pr222648/FooBase.java @@ -0,0 +1,9 @@ +package test; + + + +abstract public class FooBase +{ +} + + diff --git a/tests/bugs162/pr222648/Marker.java b/tests/bugs162/pr222648/Marker.java new file mode 100644 index 000000000..46718e03e --- /dev/null +++ b/tests/bugs162/pr222648/Marker.java @@ -0,0 +1,7 @@ +package test; + + + +public interface Marker extends DataInterface +{ +} diff --git a/tests/bugs162/pr222648/Resource.java b/tests/bugs162/pr222648/Resource.java new file mode 100644 index 000000000..1a7f938be --- /dev/null +++ b/tests/bugs162/pr222648/Resource.java @@ -0,0 +1,5 @@ +package test; + +public interface Resource +{ +} diff --git a/tests/bugs162/pr222648/X.java b/tests/bugs162/pr222648/X.java new file mode 100644 index 000000000..451dd70a0 --- /dev/null +++ b/tests/bugs162/pr222648/X.java @@ -0,0 +1,46 @@ + +abstract class FooBase { } + +// Existence of this line causes the exception +abstract class Foo > extends FooBase
{ } + +interface DataInterface { + public CC getContent(); // ERR +} + +interface Marker extends DataInterface { } + +interface Resource { } + +aspect DataAspect { + // Intertype declaration onto Marker that shares the variable + public C Marker.getContent() { // ERR + return null; + } +} + +/* +X.java:7 [error] can't override CC DataInterface.getContent() with CC Marker.getContent() return types don't match +public CC getContent(); + ^^^^^^^^^ + +X.java:16 [error] can't override CC DataInterface.getContent() with CC Marker.getContent() return types don't match +public C Marker.getContent() { + ^^^^^^^^^ + +1. Two errors because both source locations reported (stupid code) + + +when failing: +parent: CC DataInterface.getContent() +child : CC Marker.getContent() +Both return types are type variable reference types (different ones though) +parent: TypeVar CC extends Resource +child : CC + +So parent discovered the wrong type variable (the wrong CC). +parent is a ResolvedMemberImpl +it is considered an 'existingmember' of the type DataInterface + +*/ + -- cgit v1.2.3