I would want Sorbet to raise a warning when code like this is written:
list = list.sort!
As I would expect Array#sort! to be of type void
I would want Sorbet to raise a warning when code like this is written:
list = list.sort!
As I would expect Array#sort! to be of type void
Yes, Sorbet does include types for standard library of Ruby.
For example, here's the type annotation for sort!
https://github.com/sorbet/sorbet/blob/119e937e9e3b03ec27308cd8874f482791d15864/rbi/core/array.rbi#L670-L677
Note that in Ruby sort! does return a value and Sorbet correctly models that.