summaryrefslogtreecommitdiff
path: root/tests/typ/code/closure.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-27 12:05:36 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-27 12:05:36 +0200
commitf64c772b6d969fa3aa1a7391a3d8118b21430434 (patch)
tree4829cea375ccb5c7dc864052fa80a63b9dcb6fb1 /tests/typ/code/closure.typ
parent422b8e640f00977177a5a7250a3c56009eed10c4 (diff)
Fix capturing bug
Diffstat (limited to 'tests/typ/code/closure.typ')
-rw-r--r--tests/typ/code/closure.typ10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/typ/code/closure.typ b/tests/typ/code/closure.typ
index 86a6f632..402df799 100644
--- a/tests/typ/code/closure.typ
+++ b/tests/typ/code/closure.typ
@@ -44,6 +44,16 @@
test(func(), error)
}
+// Redefined variable.
+{
+ let x = 1
+ let f() = {
+ let x = x + 2
+ x
+ }
+ test(f(), 3)
+}
+
---
// Too few arguments.
{