compiler: Type Check All Binary Operators
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -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!)"))
|
||||
|
||||
Reference in New Issue
Block a user