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
steep check domain/TestContainer.rb
# Type checking files:
..........................................................F
domain/TestContainer.rb:9:9: [error] Type `T` does not have method `==`
│ Diagnostic ID: Ruby::NoMethod
│
└ @obj == other.obj
~~
Detected 1 problem from 1 file
Ideally we would be able to assert at least one-sided bounds on the type parameters, for example if we could assert that the parameter inherits from Numeric:
Yes, we know the requirement of type parameter bounds and have it in our roadmap to RBS 2.0, which will be released with Ruby 3.1 hopefully.
I've started implementation of the feature and will share the progress on this repo soon.
It's currently difficult to write a well-typed generic container that calls any methods on members of the type parameter. Example:
steep
(default settings) output:Ideally we would be able to assert at least one-sided bounds on the type parameters, for example if we could assert that the parameter inherits from
Numeric
:The text was updated successfully, but these errors were encountered: