# Redeclaration stage of Build Your Own Interpreter (#DW9) has a test case for assignment

**URL:** <https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614>\
**Category:** Challenges\
**Tags:** challenge:interpreter\
**Created:** [September 2, 2024, 11:13pm UTC](https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614 "2024-09-02T23:13:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlcaga](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/karlcaga/32/1497_2.png) [@karlcaga](https://forum.codecrafters.io/u/karlcaga)\
**Post date:** [September 2, 2024, 11:13pm UTC](https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614/1 "2024-09-02T23:13:39Z")

</div>

I was going through the course and ran into this failing test case which uses assignment in Lox. This stage handles only redeclarations while assignments are not handled until the next stage.

```auto
var quz = 2;
print quz;
quz = 3;
print quz;
var world = 5;
print world;
quz = world;
print quz;

```

Thanks! 😁

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [September 3, 2024, 9:54am UTC](https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614/2 "2024-09-03T09:54:05Z")

</div>

Thanks for highlighting this!

Our team will fix the test cases by tomorrow, and I’ll update you as soon as it’s done.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [September 3, 2024, 6:50pm UTC](https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614/3 "2024-09-03T18:50:46Z")

</div>

We’ve just updated both the [stage instructions](https://github.com/codecrafters-io/build-your-own-interpreter/pull/44) and [the tester](https://github.com/codecrafters-io/interpreter-tester/pull/40), properly (re)declaring variables using the `var` keyword.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/2/2092728b3c05c6678a1202d659b3fef7c6e83d3b.png)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [September 8, 2024, 6:51pm UTC](https://forum.codecrafters.io/t/redeclaration-stage-of-build-your-own-interpreter-dw9-has-a-test-case-for-assignment/1614/4 "2024-09-08T18:51:38Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
