Hi, I have tried to imnplement 2 methods those have same name and different optional named arguments pattern.
But, I couldn’t call those methods other than last defined.
Those will rise compile time error when called.
Minimal code is as follows:
def foo(*, s : String? = nil) p s end def foo(*, c : Char? = nil) p c end foo(s: "S") # Error in test/test.cr:9: no argument named 's' (did you mean 'c'?) # Matches are: # - foo(*, c : Char | ::Nil = nil) # # foo(s: "S") # ^~~
Any problems in above code?