summaryrefslogtreecommitdiff
path: root/chapter32/src/test/java/com/seaofnodes/simple/test0
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-15 16:11:39 -0800
committerCliff Click <cliffc@acm.org>2026-11-15 16:11:39 -0800
commit9fe7c6f9697b5bbf3041261fdc60040e75cc674f (patch)
treed92a8ff20ed984938d90ad8917b4d67fba9fb745 /chapter32/src/test/java/com/seaofnodes/simple/test0
parentf0a6c6757a795b8e186de0076836a87acef59fa7 (diff)
downloadSimple-ch32.tar.gz
Simple-ch32.zip
Split off chapter 31ch32
Ch 32 will be focused on compiler performance issues.
Diffstat (limited to 'chapter32/src/test/java/com/seaofnodes/simple/test0')
-rw-r--r--chapter32/src/test/java/com/seaofnodes/simple/test0/A.smp6
-rw-r--r--chapter32/src/test/java/com/seaofnodes/simple/test0/A/B.smp1
2 files changed, 7 insertions, 0 deletions
diff --git a/chapter32/src/test/java/com/seaofnodes/simple/test0/A.smp b/chapter32/src/test/java/com/seaofnodes/simple/test0/A.smp
new file mode 100644
index 00000000..b94fa147
--- /dev/null
+++ b/chapter32/src/test/java/com/seaofnodes/simple/test0/A.smp
@@ -0,0 +1,6 @@
+// -*- mode: java; -*-
+
+val _fcn = { -> arg ? { int x -> x+1; } : { int x -> x-1; }; };
+
+// Refer to child B is OK because last field of A has been initialized
+_fcn()(B.x);
diff --git a/chapter32/src/test/java/com/seaofnodes/simple/test0/A/B.smp b/chapter32/src/test/java/com/seaofnodes/simple/test0/A/B.smp
new file mode 100644
index 00000000..82844f74
--- /dev/null
+++ b/chapter32/src/test/java/com/seaofnodes/simple/test0/A/B.smp
@@ -0,0 +1 @@
+val x=5;