-
-
Notifications
You must be signed in to change notification settings - Fork 63
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 KtInvalidLifetimeOwnerAccessException
with KSP2
#392
Conversation
`InjectProcessor` remembers deferred symbols across rounds. KSP (KSP 2 in particular) forbids to cache symbols across rounds and verifies the lifecycle. The fix is trying to get new symbols of the deferred classes each round. For more details: google/ksp#1854
I think we need to do the same thing with deferredFunctions too right? |
Might be a little cleaner to only hold on to the qualified names between rounds, that way it has to be looked up again instead of having to remember to. |
We really should have some more rounds tests to verify things like this, not going to hold up this pr on that though |
Yes, but I'm not sure what these function cover or how to "refresh" the symbols. Are these only top-level functions? I also couldn't test this whereas I had reproducible steps for classes and wanted to start with that.
I thought about that, but decided against it in the end. Reason is that APIs like I really believe theres a lack of API support in KSP. |
Yes, they were added to support KmpComponentCreate |
I only expect we'll ever be scanning classes & top-level functions which are always supported right? Falling back to the original symbol that is 'unsupported' sounds like a recipe for some rare hard-to-debug issues to me. |
#393 is what I mean. You don't need to look up the symbols again except in the finish case which should hopefully be less common as it implies something was never resolved. |
I left comments. Let's continue the discussion there and then merge one or the other fix. |
Superseded by #393 |
InjectProcessor
remembers deferred symbols across rounds. KSP (KSP 2 in particular) forbids to cache symbols across rounds and verifies the lifecycle. The fix is trying to get new symbols of the deferred classes each round.For more details: google/ksp#1854