# stage2: local consts · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d29dd5834b9d7386bb88e44bd2852428863cae81)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d29dd5834b9d7386bb88e44bd2852428863cae81

Requested commit: d29dd5834b9d7386bb88e44bd2852428863cae81

Commit: d29dd5834b9d7386bb88e44bd2852428863cae81

Tree: 6a1f15d341c00be937ef9308ec750b35c308a5c0

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: local consts

These are now supported enough that this example code hits the
limitations of the register allocator:

fn add(a: u32, b: u32) void {
    const c = a + b; // 7
    const d = a + c; // 10
    const e = d + b; // 14
    assert(e == 14);
}
// error: TODO implement copyToNewRegister

So now the next step is to implement register allocation as planned.

```

## Parents

- [af12596e8d728423e361e4755a6078c5ef8faf69](https://git.cafe/gitcafe/zig/commit/af12596e8d728423e361e4755a6078c5ef8faf69?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d29dd5834b9d7386bb88e44bd2852428863cae81?format=markdown)
