rbs
rbs copied to clipboard
Type Signature for Ruby
Add type to CSV::Row#initialize in stdlib because the type does not exist. The content of the headers array is `untyped`, because any object can be specified as long as it...
```ruby # RBS # type rec = {foo: String, bar: Integer } # and having variable a typed as rec a.each do |x, y| # x and y appear as...
Given a variable typed as smth or collection of smth, `Array(a)` does not spread correctly: ``` # a: Symbol | Array[Symbol] Array(a).each do |el| # el is typed as Symbol...
I request a notation for method overload narrowing, such that subtype args narrow supertype args. The intent is so the return type of supertype overloads not longer need to explicitly...
Not sure, but I think some variations with case-statement of this work, but this does not: ```ruby # considering a @io typed as TCPSocket | SSLSocket if @io.is_a?(SSLSocket) && @io.verify_hostname(host)...
The headers keyword option of `CSV.foreach` can take String, Symbol and Array too. Therefore, this adds them to the type definition. refs: * https://docs.ruby-lang.org/en/3.3/CSV.html#method-c-foreach * https://docs.ruby-lang.org/en/3.3/CSV.html#class-CSV-label-Options+for+Parsing Note: In https://github.com/ruby/rbs/pull/1738/files#r1468802569, @m11o...
It seems rbs is trying to make a native extension on JRuby which is not supported. For complete log output, see https://github.com/Shopify/ruby-lsp/issues/2292 That results in rbs not being able to...
Hey, not sure if this is meant to be valid or not, but while trying to write various tests I came across this sample which errors on `rbs -Isig validate`:...
It would be very helpful to use Union type for the module-self. In my project, I have a `Commentable` concern module used across multiple ActiveRecord models. This Commentable module uses...