aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-11-20 20:02:13 +0000
committerMichael Williamson <mike@zwobble.org>2023-11-20 20:02:13 +0000
commit5a9bf0b81e43a747fccd59dedaeb8432431e4e1a (patch)
tree58ebfdbf85ef63a743319c268cd83c56ae7d0f94 /src/test/java
parent33888c1bac8a1e58fae55f275a0d0eafd16144c5 (diff)
Store whether bound variable is mutable or not
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java4
1 files changed, 3 insertions, 1 deletions
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"))
)))
);
}