summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/test0
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-10-24 15:56:44 -0700
commit741d78b6e840c88b7b183010c812ad982b342da1 (patch)
tree84a75eb7ad351bffd20cd5fb152bab032b74271c /src/test/java/com/seaofnodes/simple/test0
parent8d90d2292bbdb23596849c3c3d1cda2f6cad783e (diff)
downloadSimple-linear-chapter28a.tar.gz
Simple-linear-chapter28a.zip
Chapter 28a: Modules and Lazy Class Initializationlinear-chapter28a
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/test0')
-rw-r--r--src/test/java/com/seaofnodes/simple/test0/A.smp6
-rw-r--r--src/test/java/com/seaofnodes/simple/test0/A/B.smp1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/test/java/com/seaofnodes/simple/test0/A.smp b/src/test/java/com/seaofnodes/simple/test0/A.smp
new file mode 100644
index 00000000..b94fa147
--- /dev/null
+++ b/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/src/test/java/com/seaofnodes/simple/test0/A/B.smp b/src/test/java/com/seaofnodes/simple/test0/A/B.smp
new file mode 100644
index 00000000..82844f74
--- /dev/null
+++ b/src/test/java/com/seaofnodes/simple/test0/A/B.smp
@@ -0,0 +1 @@
+val x=5;