From 5a9bf0b81e43a747fccd59dedaeb8432431e4e1a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 20 Nov 2023 20:02:13 +0000 Subject: Store whether bound variable is mutable or not --- .../shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/test/java/org') diff --git a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java index 6ac002b1..04445758 100644 --- a/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java +++ b/src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java @@ -477,6 +477,7 @@ public class TypeCheckerFunctionBodyTests { public void boundVariablesAreSet() { var untyped = Untyped.block(List.of( Untyped.val("local1", Untyped.intLiteral(1)), + Untyped.assign(Untyped.targetVar("localMutable"), Untyped.intLiteral(3)), Untyped.expressionStatement(Untyped.reference("y")), Untyped.expressionStatement(Untyped.if_( List.of( @@ -508,7 +509,8 @@ public class TypeCheckerFunctionBodyTests { .withBlock(isTypedBlockNodeWithBoundVariables(containsExactly( equalTo(BoundVariable.immutable("argPositional")), equalTo(BoundVariable.immutable("argNamed")), - equalTo(BoundVariable.immutable("local1")) + equalTo(BoundVariable.immutable("local1")), + equalTo(BoundVariable.mutable("localMutable")) ))) ); } -- cgit v1.2.3