Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1025152 // Try restructuring "crazy" inner classes (WORKS)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (11125L/73K).

!7

sclass A {
  class InnerA {}
}

sclass B extends A {
  class InnerB extends InnerA { B outer() { ret B.this; } }
  
  *() { new InnerB; }
}

p-exp {
  O o = new B().new InnerB();
  printObjectLayout(o);
  print(struct(o));
  B.InnerB b = cast restructure(o);
  assertNotNull(b.outer());
  print("OK");
}

Author comment

Began life as a copy of #1025130

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025152
Snippet name: Try restructuring "crazy" inner classes (WORKS)
Eternal ID of this version: #1025152/8
Text MD5: dce1a1aae70435dc940289d1e9594dcc
Transpilation MD5: fd3716df69a1088c730273954dd24521
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-09 22:49:47
Source code size: 326 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 543
Version history: 7 change(s)
Referenced in: [show references]