New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class: redefining the name
property affects the behavior of to_s
#7292
Comments
It's not that it's empty, if you invoke |
Ohhhhh. TIL that |
It's a method that gives you the name of the class, and it's used in the string representation. With that class getter you was overwriting it :-) |
@asterite Is that really expected behaviour that user code can override class names? |
@straight-shoota You can do it in Ruby :-) That said, I just tried it in Ruby and if you override the |
name
property affects the behavior of to_s
However removing the
class_getter name : String = ""
causes it to work fine.https://play.crystal-lang.org/#/r/5ypk/edit
The text was updated successfully, but these errors were encountered: