rbs icon indicating copy to clipboard operation
rbs copied to clipboard

Allow Type Variable constraints to be arbitrary types

Open ParadoxV5 opened this issue 2 years ago • 1 comments

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

ParadoxV5 avatar Aug 27 '23 02:08 ParadoxV5

+1 for this.

soutaro avatar Aug 28 '23 00:08 soutaro