S0033: unsupported + operands
Generated from rellum-diagnostics/src/db.rs.
Explanation
The + operator is overloaded only for Int, Float, String, and arrays in Rellum. Both operands must first have compatible types, and the resulting operation must be one of numeric addition, string concatenation, or array concatenation.
Common causes
- adding Bool, Char, record, enum, tuple, or function values
- using + between values of different types
- expecting implicit conversion before concatenating strings
Canonical fixes
- convert values explicitly before string concatenation
Before:
message = "count: " + count
After:
message = "count: " + to_string(count)
- use a field or projection with an addable type
Before:
sum = left + right
After:
sum = left.value + right.value
- use arrays on both sides for array concatenation
Before:
items = items + item
After:
items = items + [item]
Code example
message = "count: " + count