From d50dec3930ff9ecae590e4ec4f0ddd5581021f1d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 May 2026 22:19:52 +0300 Subject: refactor: remove dead Symbol checks from Modulo Remove explicit Symbol type checks from Modulo() that are never reached. The toFloat64() helper already rejects non-numeric types (including Symbol) with a proper error, so the Symbol-specific error messages in Modulo are dead code. This makes Modulo consistent with Add, Subtract, Multiply, Divide, and other operators that rely solely on toFloat64() for type validation. --- internal/rpn/operations_arithmetic.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/rpn/operations_arithmetic.go b/internal/rpn/operations_arithmetic.go index 2df45bd..3215917 100644 --- a/internal/rpn/operations_arithmetic.go +++ b/internal/rpn/operations_arithmetic.go @@ -193,13 +193,6 @@ func (o *Operations) Modulo(stack *Stack) error { return err } - if sym, ok := a.(*Symbol); ok { - return fmt.Errorf("symbol %s cannot be used with modulo operator", sym.Name()) - } - if sym, ok := b.(*Symbol); ok { - return fmt.Errorf("symbol %s cannot be used with modulo operator", sym.Name()) - } - bF, err := toFloat64(b, "%") if err != nil { return err -- cgit v1.2.3