Propagate access dependencies for ternary expressions in pure functions#86
Open
AlexFalter wants to merge 7 commits intomainfrom
Open
Propagate access dependencies for ternary expressions in pure functions#86AlexFalter wants to merge 7 commits intomainfrom
AlexFalter wants to merge 7 commits intomainfrom
Conversation
jesyspa
reviewed
Apr 4, 2026
Collaborator
jesyspa
left a comment
There was a problem hiding this comment.
I am still quite concerned about this case:
class Box(inner: Box?)
fun f(x: Box?, y: Box?): Box? = (x ?: y)?.inner?.innerIt seems to me like the current approach will not correctly unfold permissions, but maybe I'm missing something.
I'll test it out and get this merged if it's okay - no action needed on your part.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we introduce conditional heap-dependent expressions in pure functions. Namely, we extend the already existing model, which passed access dependencies unconditionally, and extend it by a condition. On field access or function usage, instead of encoding an expression as an unconditional access, we create a ternary expression unfolding predicates depending on the condition under which what predicates have to be unfolded. To validate our implementation we have created various test cases