You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Type checking files:
............................................F..............F.......
src/enum.rb:1:0: [error] UnexpectedError: sig/example.rbs:1:0...6:3: ::Enumerable expects parameters [Elem], but given args []
│ Diagnostic ID: Ruby::UnexpectedError
│
└ class Something
~~~~~~~~~~~~~~~
sig/example.rbs:1:0: [error] Type `::Enumerable` is generic but used as a non generic type
│ Diagnostic ID: RBS::InvalidTypeApplication
│
└ class Something
~~~~~~~~~~~~~~~
Detected 2 problems from 2 files
If I alter the RBS to include a param for the Enumerable:
C:\Users\Thomas\SourceTree\sord-test>steepcheck# Type checking files:
...................................................................Notypeerrordetected.🍵
I'm not actually 100% sure what param to give Enumerable in the case of each yielding key and value params. hence the untyped in this case. But given that you have a collection object that return String objects, then I presume it should be include Enumerable[String]. (?)
Is there a way I can make sord generate an RBS that will not cause an error in steep?
The text was updated successfully, but these errors were encountered:
Not currently, sorry... I'm not sure how exactly this could be encoded either, since I'm not aware of any way to specify this in YARD. Looking up the type of #each feels possible but a bit hacky and fragile! Do you have any suggestions?
Given a class that implement Enumerable:
The generated output is:
If I then run
steep check
on this I get errors:If I alter the RBS to include a param for the
Enumerable
:Then it passes:
I'm not actually 100% sure what param to give Enumerable in the case of each yielding key and value params. hence the
untyped
in this case. But given that you have a collection object that returnString
objects, then I presume it should beinclude Enumerable[String]
. (?)Is there a way I can make
sord
generate an RBS that will not cause an error insteep
?The text was updated successfully, but these errors were encountered: