aboutsummaryrefslogtreecommitdiff
path: root/test/lambdas.tm
diff options
context:
space:
mode:
Diffstat (limited to 'test/lambdas.tm')
-rw-r--r--test/lambdas.tm10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lambdas.tm b/test/lambdas.tm
index 15a8f23b..cb5bf3d4 100644
--- a/test/lambdas.tm
+++ b/test/lambdas.tm
@@ -30,3 +30,13 @@ func main():
>> abs100 := mul_func(100, Int.abs)
>> abs100(-5)
= 500
+
+ // Test nested lambdas:
+ outer := "Hello"
+ fn := func():
+ return func():
+ return func():
+ defer: |{outer}
+ return outer
+ >> fn()()()
+ = "Hello"