Skip to content

Fix #25624: Scoverage and separation checking failures#25625

Open
anatoliykmetyuk wants to merge 2 commits intoscala:mainfrom
anatoliykmetyuk:fix/030-separation-checking-failures
Open

Fix #25624: Scoverage and separation checking failures#25625
anatoliykmetyuk wants to merge 2 commits intoscala:mainfrom
anatoliykmetyuk:fix/030-separation-checking-failures

Conversation

@anatoliykmetyuk
Copy link
Copy Markdown
Contributor

@anatoliykmetyuk anatoliykmetyuk commented Mar 26, 2026

Fixes #25624

Separation checking for captures relies on unsafeAssumeSeparate to opt out of separation checking. To detect such code, SepCheck uses structural matching on the trees. Coverage phase may lift some trees, breaking the assumptions about the structure.

This PR:

  • Opts unsafeAssumeSeparate out of coverage instrumentation - we aren't really interested in coverage info on it anyway, only the body is interesting
  • On lifting time, marks coverage-lifted synthetic trees with an explicit attachment
  • On SepCheck time, opts-out synthetic trees created by coverage from separation checking - rationalle being we have already checked their rhs for separation on assignment time

How much have you relied on LLM-based tools in this contribution?

Moderately.

How was the solution tested?

  • Ran the full bootstrapped testCompilation --enable-coverage-phase suite
  • Run the compiler pos suite
  • Reproduced failing tests individually before and after the fix

Additional notes

I am not familiar with the captures codebase, so can use help of someone familiar with it to review this PR.

@anatoliykmetyuk anatoliykmetyuk changed the title Fix #25624: separation checking failures Fix #25624: Scoverage and separation checking failures Mar 26, 2026
@anatoliykmetyuk anatoliykmetyuk marked this pull request as ready for review March 26, 2026 08:54
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.

Scoverage & Captures interaction during separation: broken assumptions about each other cause failures

1 participant