-
-
Save z64/eba030d96d822a220452cd912e944a89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cr getter.cr | |
nil | |
# crystal tool expand -c getter.cr:2:3 getter.cr | |
1 expansion found | |
expansion 1: | |
class_getter?(bar : String | ::Nil) do | |
"str" | |
end | |
# expand macro 'class_getter?' (/usr/lib/crystal/core/object.cr:230:3) | |
~> @@bar : String | ::Nil | |
def self.bar? : String | ::Nil | |
@@bar | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
class_getter? bar : String? do | |
"str" | |
end | |
end | |
p Foo.bar? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment