Skip to content

Scoverage fails compilation of quotes in some corner cases #26782

Description

@anatoliykmetyuk

Compiler version

3.10.0-RC1-bin-SNAPSHOT - on latest main as of 6 August 2026, commit 266b5b3afe.

Minimized code

import language.experimental.captureChecking

def value(
  quotes: scala.quoted.Quotes,
  expr: scala.quoted.Expr[Int]
)(using scala.quoted.FromExpr[Int]) =
  given scala.quoted.Quotes = quotes
  summon[scala.quoted.FromExpr[Int]].unapply(expr)

Command

sbt -error -no-colors "scala3-bootstrapped/scalac -color:never -language:experimental.captureChecking -coverage-out target/issue-coverage -sourceroot . -d target/issue-out Repro.scala"

Output

-- [E007] Type Mismatch Error: Repro.scala:8:50 -------------------------------
8 |  summon[scala.quoted.FromExpr[Int]].unapply(expr)
  |                                                  ^
  |           Found:    scala.quoted.Quotes
  |           Required: (given_Quotes : -> scala.quoted.Quotes)
  |
  |           The error occurred for a synthesized tree:  scala.quoted.Quotes
1 error found
[error] nonzero exit code returned from runner: 1
[error] (scala3-compiler-bootstrapped / Compile / runMain) nonzero exit code returned from runner: 1

Expectation

Compilation succeeds with coverage instrumentation.

Notes

Is a blocker for scoverage to work with stdlib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:coverageCode coverage, see https://dotty.epfl.ch/docs/internals/coverage.htmlarea:experimental:ccCapture checking relateditype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions