compiler: Type Check All Binary Operators

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-22 20:42:35 -04:00
parent bc51b4e280
commit 97a672bd6d
4 changed files with 57 additions and 111 deletions
+5
View File
@@ -495,6 +495,11 @@ extension BinaryOperatorExpression: CompilableExpression {
),
]
if !left_hand_side.type().eq(right_hand_side.type()) {
return Result.Error(
Error(withMessage: "Types of values used with binary expression are not the same"))
}
guard let selected_evaluator = evaluators[binary_operator_expression_node.nodeType!] else {
return Result.Error(
Error(withMessage: "No evaluator for \(binary_operator_expression_node.nodeType!)"))