aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-27 16:11:21 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-27 16:11:21 +0000
commitf7048d47b57ff21e03fd10f7917d87b2fd6c2dbb (patch)
tree770b8d50262cfbc30b7181d27285329068617053
parent2dcdafd76ea85f03254b05d6d337d2cb99b58b98 (diff)
Fix target type for int comparison operations
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntEqualsTests]/[method:canGenerateCodeForIntEquals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntNotEqualTests]/[method:canGenerateCodeForIntNotEqual(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--src/main/java/org/shedlang/compiler/shidtopatio/ShidToPatio.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntEqualsTests]/[method:canGenerateCodeForIntEquals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntEqualsTests]/[method:canGenerateCodeForIntEquals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 17417a37..5bbbded1 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntEqualsTests]/[method:canGenerateCodeForIntEquals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntEqualsTests]/[method:canGenerateCodeForIntEquals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -9,7 +9,7 @@ Compilation unit elements:
Locals:
* (val "binaryOpResult__0" int)
- * (val "tmp__0" int)
+ * (val "tmp__0" bool)
Instructions:
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntNotEqualTests]/[method:canGenerateCodeForIntNotEqual(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntNotEqualTests]/[method:canGenerateCodeForIntNotEqual(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index c9d0f655..6fa1e30b 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntNotEqualTests]/[method:canGenerateCodeForIntNotEqual(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioIntNotEqualTests]/[method:canGenerateCodeForIntNotEqual(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -9,7 +9,7 @@ Compilation unit elements:
Locals:
* (val "binaryOpResult__0" int)
- * (val "tmp__0" int)
+ * (val "tmp__0" bool)
Instructions:
diff --git a/src/main/java/org/shedlang/compiler/shidtopatio/ShidToPatio.java b/src/main/java/org/shedlang/compiler/shidtopatio/ShidToPatio.java
index 19af1806..6efa93e9 100644
--- a/src/main/java/org/shedlang/compiler/shidtopatio/ShidToPatio.java
+++ b/src/main/java/org/shedlang/compiler/shidtopatio/ShidToPatio.java
@@ -844,7 +844,7 @@ public class ShidToPatio {
(target, left, right, operationContext) -> {
var targetBoolResult = operationContext.allocateVal(
ShidToPatioLocalSpace.TEMPORARY,
- PatioTypes.INT
+ PatioTypes.BOOL
);
var targetBool = targetBoolResult.value();
operationContext = targetBoolResult.context();