Transpiled version (6046L) is out of date.
// Currently it matters whether you put modifiers like // "public" left or right of the "simplyCached". svoid test_tok_simplyCachedFunctions() { testTranspilationFunction tok_simplyCachedFunctions( "transient simplyCached S x() { null; }", [[ transient S x_cache; S x() { if (x_cache == null) x_cache = x_load(); ret x_cache; } S x_load() { null; } ]], "simplyCached final S x() { null; }", [[ S x_cache; final S x() { if (x_cache == null) x_cache = x_load(); ret x_cache; } final S x_load() { null; } ]], "simplyCached void x() { y(); }", [[ bool ran_x; void x() { if (ran_x) ret; set ran_x; x_impl(); } void x_impl() { y(); } ]], // abstract load method "simplyCached abstract S x();", [[ S x_cache; S x() { if (x_cache == null) x_cache = x_load(); ret x_cache; } abstract S x_load(); ]], // public "simplyCached public S x() { null; }", [[ public S x_cache; public S x() { if (x_cache == null) x_cache = x_load(); ret x_cache; } public S x_load() { null; } ]], // primitive return type "simplyCached int x() { null; }", [[ Int x_cache; int x() { if (x_cache == null) x_cache = x_load(); ret x_cache; } int x_load() { null; } ]], ); }
Began life as a copy of #1020989
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, ekrmjmnbrukm, elmgxqgtpvxh, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034327 |
Snippet name: | test_tok_simplyCachedFunctions |
Eternal ID of this version: | #1034327/20 |
Text MD5: | 9b6825c0384ee2ac63dec58fe1f2f78e |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-08-05 16:48:59 |
Source code size: | 1361 bytes / 39 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 233 / 362 |
Version history: | 19 change(s) |
Referenced in: | [show references] |