Add #nilable? to more macro types


#1

Currently it is a major pain to figure out if a method arg’s restriction is nilable or not since it could be a multitude of different types.

https://play.crystal-lang.org/#/r/5zj0

It would be super helpful if additional types had a .nilable? that would return true if the type includes nil. Which would be like:

  • Union.types.any? &.==(::Nil)
  • Generic.type_vars.any? &.==(::Nil)
  • Path.resolve.nilable?