Mads Ager | 418d1ca | 2017-05-22 09:35:49 +0200 | [diff] [blame^] | 1 | // 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. |
| 4 | package memberrebinding2; |
| 5 | |
| 6 | import memberrebinding2.subpackage.PublicClass; |
| 7 | |
| 8 | public class Test { |
| 9 | |
| 10 | public static void main(String[] args) { |
| 11 | ClassAtBottomOfChain bottomInstance = new ClassAtBottomOfChain(); |
| 12 | PublicClass instance = new PublicClass(); |
| 13 | |
| 14 | int x = 0; |
| 15 | |
| 16 | bottomInstance.bottomField = 1; |
| 17 | bottomInstance.middleField = 2; |
| 18 | bottomInstance.superField = 3; |
| 19 | instance.field = 4; |
| 20 | |
| 21 | bottomInstance.staticBottomField = 5; |
| 22 | bottomInstance.staticMiddleField = 6; |
| 23 | bottomInstance.staticSuperField = 7; |
| 24 | instance.staticField = 8; |
| 25 | |
| 26 | x += bottomInstance.bottomField; |
| 27 | x += bottomInstance.middleField; |
| 28 | x += bottomInstance.superField; |
| 29 | x += instance.field; |
| 30 | |
| 31 | x += bottomInstance.staticBottomField; |
| 32 | x += bottomInstance.staticMiddleField; |
| 33 | x += bottomInstance.staticSuperField; |
| 34 | x += instance.staticField; |
| 35 | |
| 36 | System.out.println(x); |
| 37 | } |
| 38 | } |