Can variable type in Crystal lang be restricted to classes that inherit from one class -
i mean:
class foo; end class bar < foo; end class cux < foo; end
is possible restrict type of variable classes inheriting foo
without unions, x : foo+
?
maybe using type restriction?
@x : foo
Comments
Post a Comment