Fix throwing on asMemberOf on Intersection Override functions - #3077
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi @vadymsavchenko-lyft, thank you for the PR! Please ping me when you have signed the CLA. Also, please split this PR in two, one with the test (in a new test file and processor) and one with a fix. See https://github.com/google/ksp/blob/main/CONTRIBUTING.md for more information. I couldn't find an issue for this, so unless there already is an existing one, please also open a new issue describing the bug. :) |
Fix asMemberOf throwing on intersection-override members
When an interface inherits the same member from two supertypes nested in different classes, KSP2 attributed that member to the receiver's enclosing class instead of the real super-interface.
asMemberOf's subtype check then failed and threw.
Fix: resolve the declaring class via intersectionOverriddenSymbols/fakeOverrideOriginal before the subtype check. Adds a regression case to asMemberOf golden tests.