Fix: Overhaul initialiser merging and targeting for new mixins. #197
Open
Fix: Overhaul initialiser merging and targeting for new mixins. #197
Conversation
We introduce a new compatibility level to gate the changes, and we achieve the following properties: - New <clinit>s have their try-catch blocks, local variables and line numbers preserved - New <clinit>s cannot be skipped by a theoretical early return in the target or in another mixin - New initialisers cannot be targeted by any injectors - New injectors cannot target any initialisers - Old injectors still target old initialisers (bad behaviour but must be preserved)
4d287af to
9b9fa9e
Compare
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.
Currently, merged initialisers are discoverable by injectors, which breaks the important invariant that mixin additions cannot affect other injectors' targeting.
Additionally,
<clinit>merging is half-baked.We fix these problems and introduce a new compatibility level to gate the changes. We achieve the following properties:
<clinit>s have their try-catch blocks, local variables and line numbers preserved<clinit>s cannot be skipped by a hypothetical early return in the target or in another mixin