rbs icon indicating copy to clipboard operation
rbs copied to clipboard

(delegate) Sigs for delegate + proposal for delegator defs in RBS

Open HoneyryderChuck opened this issue 4 years ago • 1 comments

(tentative) added support for inheriting from delegator classes

By defining such RBS classes such as:

    class Tempfile < Delegator[File]
    ...

with this patch, while building the instance definition, the class assigned to the Delegator definition is then merged with the main class definitions, which achieves the purpose of inheriting method definitions from the delegated class.

This is a solution based on a stdlib definition however, so it might not be the best way to move forward.

HoneyryderChuck avatar Aug 24 '21 17:08 HoneyryderChuck

@soutaro given the recent additions in 2.0 around bounded generics, shall we revisit this? I think we still need special syntax for this, i.e. smth like:

class Delegator[T]
  @delegate_sd_obj: T

  # some rbs syntax to say "inherit API from T?
...

HoneyryderChuck avatar Dec 31 '21 15:12 HoneyryderChuck