Skip to content

Commit

Permalink
Fix return value boxing of == and !=
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanblake4 committed Jan 30, 2024
1 parent b2f4938 commit 2ac3fa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.7.4
- Fix return value boxing of equals and not equals operators

## 0.7.3
- Fix error when setting a top-level variable
- Fix for-each loops that specify the type of the loop variable
Expand Down
2 changes: 2 additions & 0 deletions lib/src/eval/compiler/variable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ class Variable {
final AlwaysReturnType? returnType;
if ($this.type == CoreTypes.function.ref(ctx) && method == 'call') {
returnType = null;
} else if (checkEq || checkNotEq) {
returnType = AlwaysReturnType(CoreTypes.bool.ref(ctx), false);
} else {
returnType = AlwaysReturnType.fromInstanceMethodOrBuiltin(
ctx, $this.type, method, [..._args.map((e) => e.type)], {});
Expand Down

0 comments on commit 2ac3fa5

Please sign in to comment.