Type a "modular" class #2639
Unanswered
pointlessone
asked this question in
Q&A
Replies: 1 comment
-
class Example
include Mod::_Mod # I don’t know whether this line is required or your observation is saying that `Mod < Mod::_Mod` already
include Mod
end
module Mod: _Mod
interface _Mod
def do_stuff: () -> void
end
def do_more_stuff: () -> void
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a class that is broken down into pieces. Each is confined to a separate module. The modules have expectations on the class they are included into.
It seem the typing is rather straightforward:
As far as I can gather from the docs the [module self type] is supposed to be the class/module that includes the module and provides
do_stuff
. In my mind the module self becomes something likeMod | Example
.But it looks like RBS treats it as
Mod < Example
because it reports aRBS::RecursiveAncestorError
.What is the correct way of typing such structure?
Beta Was this translation helpful? Give feedback.
All reactions