clementbera | 7288597 | 2019-05-21 12:30:02 +0200 | [diff] [blame] | 1 | // Copyright (c) 2019, 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. |
| 4 | |
clementbera | be19d30 | 2019-05-23 17:23:21 +0200 | [diff] [blame] | 5 | package nesthostexample; |
clementbera | d5bd4f3 | 2019-05-21 12:22:06 +0200 | [diff] [blame] | 6 | |
| 7 | public class NestHostInliningSubclasses { |
| 8 | |
| 9 | public static class InnerWithPrivAccess extends NestHostInlining.InnerWithPrivAccess { |
| 10 | public String accessSubclass(NestHostInlining host) { |
| 11 | return super.access(host) + "Subclass"; |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | public static class InnerNoPrivAccess extends NestHostInlining.InnerNoPrivAccess { |
| 16 | @NeverInline |
| 17 | public String printSubclass() { |
| 18 | return super.print() + "Subclass"; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | public static void main(String[] args) { |
| 23 | System.out.println(new InnerWithPrivAccess().accessSubclass(new NestHostInlining())); |
| 24 | System.out.println(new InnerNoPrivAccess().printSubclass()); |
| 25 | } |
| 26 | } |