top | item 34430072

(no title)

bboylen | 3 years ago

Couldn't you still have duck typing?

If a method expects to be passed an argument that it can call "quack" on, can't you define a type that has "quack"? The actual argument could be a Duck or a Goose but as long as it has a "quack" method the type will be OK

I haven't used types in Ruby (or much at all other than dabbling in Typescript), so I might be missing something

discuss

order

No comments yet.