Can I specify interfaces when I declare a member?
After thinking about this question for a while, it occurred to me that a static-duck-typed language might actually
Crystal is a statically duck-typed language. Example:
def add(x, y) x + y end add(true, false)
The call to add causes this compilation error:
add
Error in foo.cr:6: instantiating 'add(Bool, Bool)' add(true, false) ^~~ in foo.cr:2: undefined method '+' for Bool x + y ^