Introduction of an Override annotation

private doesn’t work like it does in PHP. Crystal’s private is more akin to PHP’s protected modifier, in that child classes can access private methods defined in the parent, but you can’t use them outside of the class itself. So because of this it would be possible for a child to re-define a private method defined on the parent and if the parent used that private method, the child’s implementation would be used instead.

Related: New keyword to re-open classes · Issue #8422 · crystal-lang/crystal · GitHub

1 Like