-
-
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
Implementation: allow to lookup class and module implementations #7742
Implementation: allow to lookup class and module implementations #7742
Conversation
ping. Could anyone review this? |
༓class Foo | ||
end | ||
|
||
alias Bar = Foo |
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.
Was there an explicit decision to not resolve to this line instead the Foo? What happens if the alias has a union?
@bcardiff Thank you for reviewing! I fixed
class Foo
end
class Bar
end
alias Baz = Foo | Bar
Baz $ bin/crystal tool implementation -c foo.cr:9:1 foo.cr
1 implementation found
foo.cr:7:1 Unfortunately this doesn't work: $ bin/crystal tool implementation -c foo.cr:7:15 foo.cr
no implementations or method call found I think implementing this is hard for now... |
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.
Thank you @makenowjust 👍
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.
I was a bit worried about the introduction of target_type
in Path
it's actually similar to target_const
.
Please, create an issue to track the left-over for the lookup from the alias definition.
Thanks!
Hi @makenowjust Yeah, this is a progress, Thank you! 👍 |
Fixed #4941
Image:
I think it is totally useful, however this implementation cannot work on some corner case. One corner case, method argument restriction:
It is hard to implement for now. Another corner case, macro argument:
It is impossible.
@faustinoaq Sorry for the late. Is this okay?