-
Notifications
You must be signed in to change notification settings - Fork 294
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
Fix find overridee, add tests #151
Conversation
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.
My only concern is the use of FAKE_OVERRIDE
, I'll verify it with several use cases myself, and if everything looks good I'll merge this one.
Sorry for delay, I just tried with following test case where I was worrying about use of
returns See this for repro |
awesome, thanks for the repro, i will take a look at it.
I'm curious for |
oh actually it returns null not because of FAKE_OVERRIDE check but because it overrides more than 1 method. Same problem happens with the following code as well:
I think we need to make a decision here. The docs for FunctionDescriptor does not clarify anything on the order of the results. Based on my experimentation, it depends on whichever is declared in the code first. ( I looked around the compiler codebase a bit more and there is actually a Seems like using that method is more appropriate here. I'll play w/ that one and look for more usages. sample usage from compiler: |
Yeah, I didn't mean that it is The other case is quite interesting which fall out of my consideration when implementing this API, let me know how that |
so i've been trying to create some use case w/ possible conflicts and see what KAPT generates but i couldn't create anything useful that would compile :( Also, I think for this CL, I'll change it to fix conflicts when there are more than 1 equal-level parent and turn it into true |
another possible choice is to make this function return |
I updated the PR with a BFS version. I think it is also valid to go w/ the |
LGTM, will merge after #156 is merged. |
This CL fixes a few problems in find overridee implementation: a) If the method does not override anything, it would throw instead of returning null, fixed. b) If it overrides a method that overrides another method, it would return null, now it returns the first actual override. c) If it overrides a method from a GrandSuper (where super does not override it), it would return null. Now it returns the method in GrandSuper class.
* Fix find overridee, add tests This CL fixes a few problems in find overridee implementation: a) If the method does not override anything, it would throw instead of returning null, fixed. b) If it overrides a method that overrides another method, it would return null, now it returns the first actual override. c) If it overrides a method from a GrandSuper (where super does not override it), it would return null. Now it returns the method in GrandSuper class.
This CL fixes a few problems in find overridee implementation:
a) If the method does not override anything, it would throw instead of
returning null, fixed.
b) If it overrides a method that overrides another method, it would
return null, now it returns the first actual override.
c) If it overrides a method from a GrandSuper (where super does not
override it), it would return null. Now it returns the method in
GrandSuper class.
Fixes: #150