Allow Type Variable constraints to be arbitrary types
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 256
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 37
Description
Currently, the RHS of [T < RHS] must be an interface, class or module, at least what RubyMine IDE identifies. Wynaut allow it to be anything? For the minumum, it can self-document when arg and return are the same constrained object/type: def []=: [E < Elem?] (index name_or_position, E) -> E
Originally posted in https://github.com/ruby/rbs/pull/1456#discussion_r1306579971; c.c. @sampersand
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the discussion from ruby/rbs#1456 and the existing handling of type-variable constraints for the [T < RHS] syntax. Define what accepting arbitrary RHS types means for the example def []=: [E < Elem?] (index name_or_position, E) -> E, then verify that the constraint is accepted and self-documents the shared argument and return type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100