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

16
LINES

< > BotCompany Repo | #1031586 // test_getSlashSet_earlyEvaluationOfArgument

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2834L/17K).

1  
// Ah, this wouldn't even compile with late evaluation of the argument
2  
svoid test_getSlashSet_earlyEvaluationOfArgument() {
3  
  class X {
4  
    S bla;
5  
  }
6  
  
7  
  new X y;
8  
  new X z;
9  
  X x = y;
10  
  var getSet = get/set bla(x);
11  
  getSet.set("yo");
12  
  x = z;
13  
  assertEqualsVerbose("yo", getSet!);
14  
  x = y;
15  
  assertEqualsVerbose("yo", getSet!);
16  
}

Author comment

Began life as a copy of #1031585

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031586
Snippet name: test_getSlashSet_earlyEvaluationOfArgument
Eternal ID of this version: #1031586/3
Text MD5: 2493b01ffaf66ab4df9976b687d0176c
Transpilation MD5: e0e7666c697c217fd860b4693d38d0f5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-22 07:00:49
Source code size: 348 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 199 / 258
Version history: 2 change(s)
Referenced in: [show references]