Open gogotanaka opened 9 years ago
This would be very useful. I think its pretty common to return one type or the other depending on the outcome of the method. e.g. Return a Hash on success and nil on failure. There is currently no way to typesig this type of method without using the blanket Any
which may let through other types that are unwanted.
The input args should also be able to be specified as one | another
:
# allow an Integer OR a String for the first arg, a String for the second, and return a String OR nil
typesig :method, [Integer | String, String] => (String | NilClass)
like that?