-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Macro ancestors #3875
Macro ancestors #3875
Conversation
superclasses << klass | ||
end | ||
superclasses | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I don't know if add #superclasses
here is okay because this is useless in the whole compiler...
Or maybe this should just go into src/compiler/crystal/macros/methods.cr
(or I can just drop this commit of #superclasses
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have superclass
, I'm not sure we need superclasses
—which doesn't exist in Ruby, by the way. Both for the compiler (not used) and for @type
. We can already iterate from parent to parent if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ysbaddaden ok then I'm going to remove the commit of superclasses
, thanks for reviewing 😄
cc98e9e
to
ad5673a
Compare
@ysbaddaden I removed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need some docs here https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/macros.cr#L1466 so they are published at crystal api
ad5673a
to
2e077a3
Compare
@bcardiff updated. thanks 😄 |
Is this PR GTG? |
Solved #3871 .
After this PR, we can use
#ancestors
and#superclasses
in macro to get the inherit chain of the type.