aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-07-08 23:30:24 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-07-08 23:30:24 +0200
commit81298346f1e512b0537a2063b390ebfc920c3f04 (patch)
tree3c0077542be1a8c52895715cbe2a1cac314fe21a
parentaf6c653c673103addae060872017574dfd41f5a2 (diff)
Document known bugs
-rw-r--r--.exrc2
-rw-r--r--BUGS18
2 files changed, 19 insertions, 1 deletions
diff --git a/.exrc b/.exrc
index 932e8ae..739e666 100644
--- a/.exrc
+++ b/.exrc
@@ -1,2 +1,2 @@
set makeprg=./make
-autocmd BufRead README setlocal et tw=73
+autocmd BufRead BUGS,README setlocal et tw=73
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..2638f5c
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,18 @@
+1. Nested functions should inherit constants from parent scopes, but not
+ local variables. At the moment the former works, but when trying to
+ (incorrectly) use a local variable from an outer scope in an inner
+ function, the compiler crashes:
+
+ foo :: () {
+ x := 42;
+ X :: 69;
+
+ bar :: () int { return x; } /* not fine; breaks */
+ baz :: () int { return X; } /* totally fine */
+ }
+
+ This is presumably due to the compiler maintaining a single tree of
+ scopes where a scope contains information for both constants and
+ variables. If this is indeed the cause, then there should most
+ probably be separate scope-trees; one which has scopes for constants,
+ and one which has scopes for variables.