summaryrefslogtreecommitdiffstats
path: root/tests/bugs162/pr222648/X.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs162/pr222648/X.java')
-rw-r--r--tests/bugs162/pr222648/X.java46
1 files changed, 46 insertions, 0 deletions
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<A> { }
+
+// Existence of this line causes the exception
+abstract class Foo <CC extends Resource, DD extends DataInterface<CC>> extends FooBase<DD> { }
+
+interface DataInterface<CC> {
+ public CC getContent(); // ERR
+}
+
+interface Marker<CC> extends DataInterface<CC> { }
+
+interface Resource { }
+
+aspect DataAspect {
+ // Intertype declaration onto Marker that shares the variable
+ public C Marker<C>.getContent() { // ERR
+ return null;
+ }
+}
+
+/*
+X.java:7 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match
+public CC getContent();
+ ^^^^^^^^^
+
+X.java:16 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match
+public C Marker<C>.getContent() {
+ ^^^^^^^^^
+
+1. Two errors because both source locations reported (stupid code)
+
+
+when failing:
+parent: CC DataInterface<CC>.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<CC>
+
+*/
+