diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-11-20 20:02:13 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-11-20 20:02:13 +0000 |
| commit | 5a9bf0b81e43a747fccd59dedaeb8432431e4e1a (patch) | |
| tree | 58ebfdbf85ef63a743319c268cd83c56ae7d0f94 /src/test/java/org | |
| parent | 33888c1bac8a1e58fae55f275a0d0eafd16144c5 (diff) | |
Store whether bound variable is mutable or not
Diffstat (limited to 'src/test/java/org')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/typechecker/TypeCheckerFunctionBodyTests.java | 4 |
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")) ))) ); } |
