Skip to content

Inherited contracts #104

Open
Open
@nixpulvis

Description

@nixpulvis

This is a pretty common use case (for me at least). I define a base class:

class Base
  # ...
  Contract String => String
  def foo(arg)
    # ...
  end
  # ...
end

Next I write a bunch of subclasses from Base. I might write a bunch of new methods on these subclasses, but sometimes I also need to overwrite the definition of a function.

class A < Base
  # ...
  def foo(arg)
    # New stuff.
  end
  # ...
end

By default it would be ideal for the contract of Base#foo to be given to A#foo, allowing a new contract to overwrite the inherited one if needed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions