Skip to content

Comments

Fix: Overhaul initialiser merging and targeting for new mixins. #197

Open
LlamaLad7 wants to merge 2 commits intomainfrom
fix/initialiser-targeting
Open

Fix: Overhaul initialiser merging and targeting for new mixins. #197
LlamaLad7 wants to merge 2 commits intomainfrom
fix/initialiser-targeting

Conversation

@LlamaLad7
Copy link
Member

@LlamaLad7 LlamaLad7 commented Feb 8, 2026

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:

  • New mixin <clinit>s have their try-catch blocks, local variables and line numbers preserved
  • New mixin <clinit>s cannot be skipped by a hypothetical early return in the target or in another mixin
  • New mixin initialisers cannot be targeted by any injectors
  • New injectors cannot target any mixin initialisers
  • Old injectors still target old mixin initialisers (bad behaviour but must be preserved)

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)
@LlamaLad7 LlamaLad7 force-pushed the fix/initialiser-targeting branch from 4d287af to 9b9fa9e Compare February 9, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant