blob: 6d5c51f4bf5d7cce6ea8222030cf5e69de14b721 [file] [log] [blame]
Stephan Herhutd5aa0922017-05-22 16:06:14 +02001// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4package classmerging;
5
6public class Test {
7
8 public static void main(String... args) {
9 GenericInterface iface = new GenericInterfaceImpl();
10 callMethodOnIface(iface);
11 GenericAbstractClass clazz = new GenericAbstractClassImpl();
12 callMethodOnAbstractClass(clazz);
13 ConflictingInterfaceImpl impl = new ConflictingInterfaceImpl();
14 callMethodOnIface(impl);
15 System.out.println(new SubClassThatReferencesSuperMethod().referencedMethod());
16 System.out.println(new Outer().getInstance().method());
17 System.out.println(new SubClass(42));
18 }
19
20 private static void callMethodOnIface(GenericInterface iface) {
21 System.out.println(iface.method());
22 }
23
24 private static void callMethodOnAbstractClass(GenericAbstractClass clazz) {
25 System.out.println(clazz.method());
26 System.out.println(clazz.otherMethod());
27 }
28
29 private static void callMethodOnIface(ConflictingInterface iface) {
30 System.out.println(iface.method());
31 System.out.println(ClassWithConflictingMethod.conflict(null));
32 System.out.println(OtherClassWithConflictingMethod.conflict(null));
33 }
34}