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
The dynamic nature of defining Data classes with Data#define makes it difficult (if not impossible) to adequately describe scripts using RBS.
If it indeed is impossible, perhaps we should consider a specific syntax for Data classes in RBS. Yes, they are dynamically created classes, so checking is tough, but it is odd to have a first class, core library feature not supported by RBS.
If it is possible and I simply did not know, perhaps updating the tutorial to better discuss how to do this would be very helpful
The text was updated successfully, but these errors were encountered:
I have an idea. How about generating prototype RBS when rbs prototype runtime detects Struct and Data? (It's not implemented yet.)
Would this be of help to you?
For example:
# foo.rbclassFoo < Data.define(:foo,:bar)end
$ rbs prototype runtime -R foo.rb Foo
# foo.rbsclassFoo < Data
def initialize: (untyped foo, untyped bar) -> void
| (foo: untyped, bar: untyped) -> voidattr_reader foo: untypedattr_reader bar: untypedend
The dynamic nature of defining Data classes with Data#define makes it difficult (if not impossible) to adequately describe scripts using RBS.
If it indeed is impossible, perhaps we should consider a specific syntax for Data classes in RBS. Yes, they are dynamically created classes, so checking is tough, but it is odd to have a first class, core library feature not supported by RBS.
If it is possible and I simply did not know, perhaps updating the tutorial to better discuss how to do this would be very helpful
The text was updated successfully, but these errors were encountered: