blob: 4748927704b4a0e0533f8acb2e289be364111d4f [file] [log] [blame]
clementbera72885972019-05-21 12:30:02 +02001// 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
clementberabe19d302019-05-23 17:23:21 +02005package nesthostexample;
clementberad5bd4f32019-05-21 12:22:06 +02006
7public class NestHostInlining {
8
9 private String field = "inlining";
10
11 public static class InnerWithPrivAccess {
12 public String access(NestHostInlining host) {
13 return host.field;
14 }
15 }
16
17 public static class InnerNoPrivAccess {
18 public String print() {
19 return "InnerNoPrivAccess";
20 }
21 }
22
23 public abstract static class EmptyNoPrivAccess {}
24
25 public abstract static class EmptyWithPrivAccess {
26 public String access(NestHostInlining host) {
27 return host.field;
28 }
29 }
30
31 public static void main(String[] args) {
32 System.out.println(new InnerWithPrivAccess().access(new NestHostInlining()));
33 System.out.println(new InnerNoPrivAccess().print());
34 }
35}