Wait, what happens if you want keyword arguments?
`def greet(name: String, greeting: String = "Hello"): String`
will work for kwargs with default values — https://type-ruby.github.io/docs/getting-started/understandi...
e.g.
def greet(name: String | "Hello"): String
I know it's all subjective but I think that reads better and it's valid ruby.To be honest low-type with a static analysis tool would be my favourite syntax for this.
Or wait, found examples that claims to be keyword arguments, but you define them just the same? I'm confused. https://type-ruby.github.io/docs/learn/functions/optional-re...
https://type-ruby.github.io/docs/learn/functions/optional-re...
def greet(name: "someone"): String
"Hello, #{name}!"
endHowever, no mention of this basic head scratcher in the docs. :rolling_eyes: