aboutsummaryrefslogtreecommitdiff
path: root/BUGS
blob: c8bf8b649095aa6421dcfc84999d79f0e6344be0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
1.  Nested functions should inherit constants and static locals from
    parent scopes, but not automatic 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:

        example :: () {
            x         :=  42;
            x′        ::  69;
            static x″ := 420;

            foo :: () int { return x;  } /* not fine; breaks */
            bar :: () int { return x′; } /* totally fine */
            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.

2.  Recursive functions crash the compiler.

        foo :: () { return foo(); } /* breaks */

3.  The following example function has a use-after-free for a yet
    undiagnosed reason:

        iota :: () int {
            x: int = -1;
            return x;
        }

4.  Variable shadowing breaks when you create a local variable with the
    same name as the parent function, failing with a circular-dependency:

        foo :: () { foo := 5; }

    This is not an issue with nested functions:

        foo :: () {
            bar :: () { foo := 5; }
        }