Can we let getter? setter? property? macro always return a non-nil bool value?

I believe the issue in question is Can't define a default value with getter! · Issue #7968 · crystal-lang/crystal · GitHub (the referenced issues are also a good read). Asterite’s comment summarises the issue:

But for me it’s misleading. property! means if it’s not set then it will raise. If property! allows a default value then it will never raise. And at that point you better use property. Because if a user reads property! in the source code they will think “This can raise” when in fact it’ll never happen.

2 Likes