diff options
Diffstat (limited to 'javatests/com')
-rw-r--r-- | javatests/com/google/turbine/lower/LowerIntegrationTest.java | 1 | ||||
-rw-r--r-- | javatests/com/google/turbine/lower/testdata/canon_class_header.test | 30 |
2 files changed, 31 insertions, 0 deletions
diff --git a/javatests/com/google/turbine/lower/LowerIntegrationTest.java b/javatests/com/google/turbine/lower/LowerIntegrationTest.java index 91c7d86..a7b4e86 100644 --- a/javatests/com/google/turbine/lower/LowerIntegrationTest.java +++ b/javatests/com/google/turbine/lower/LowerIntegrationTest.java @@ -280,6 +280,7 @@ public class LowerIntegrationTest { "type_anno_array_bound.test", "type_anno_return.test", "type_anno_order.test", + "canon_class_header.test", }; List<Object[]> tests = ImmutableList.copyOf(testCases).stream().map(x -> new Object[] {x}).collect(toList()); diff --git a/javatests/com/google/turbine/lower/testdata/canon_class_header.test b/javatests/com/google/turbine/lower/testdata/canon_class_header.test new file mode 100644 index 0000000..a8012d4 --- /dev/null +++ b/javatests/com/google/turbine/lower/testdata/canon_class_header.test @@ -0,0 +1,30 @@ +=== test/Test.java === +package test; +import test.A.Inner; +import java.util.TreeMap; +import java.util.Map; + +// in Map<K, Inner>, Inner is resolved using the single type import, and is raw +class A<K extends Comparable> extends TreeMap<K, Inner> { + public class Inner {} +} + +class S<T> { + public class Inner {} +} + +// Inner is resolved using the single type import, and is raw +abstract class B<K extends Comparable> extends S implements Map<K, Inner> { +} + +class C extends S<String> { + // Inner is resolved as a member of the enclosing instance, and is implicitly + // qualified by `S<String>` + abstract class One<K> extends TreeMap<K, Inner> { + } + + // Inner is resolved as a member of the enclosing instance (not as a member + // of the superclass!), and is qualified by `S<String>` (not S<Number>) + abstract class Two<K> extends S<Number> implements Map<K, Inner> { + } +} |