soma.cell

Handlers don't declare return types

Pitfall 3 of writing Soma, the programming language: a habit from another language, or a rule that surprises, with what the Soma compiler answers and the form to write.

on add(a: Int, b: Int) -> Int { return a + b }
// error: handlers do not declare return types — put '-> Int' on the
//        signal declaration inside face { }
face { signal add(a: Int, b: Int) -> Int }
on add(a: Int, b: Int) { return a + b }