summaryrefslogtreecommitdiff
path: root/internal/rpn/operations_hyper.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rpn/operations_hyper.go')
-rw-r--r--internal/rpn/operations_hyper.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/rpn/operations_hyper.go b/internal/rpn/operations_hyper.go
index b0bb24b..b261fd2 100644
--- a/internal/rpn/operations_hyper.go
+++ b/internal/rpn/operations_hyper.go
@@ -303,7 +303,14 @@ func resultMetricForHyperAdd(metrics []*Metric) *Metric {
return m
}
}
- return metrics[0]
+ // All Universal (Cool) or empty slice — default to Cool.
+ // In practice, metrics is never empty (popAll enforces >= 2 operands),
+ // but we handle it defensively.
+ if len(metrics) > 0 && metrics[0] != nil {
+ return metrics[0]
+ }
+ m, _ := GetMetricRegistry().Find("Cool")
+ return m
}
// validateSameCategory checks that all metrics belong to the same category.