Compiler version
3.9.0-RC1-bin-SNAPSHOT - latest main on commit 5ad714f170 as of 19th of May, 2026.
Minimized code
class C { def setA(a: Int): this.type = this }
extension (c: C) def addMode: c.type = c
val x = identity(C()).setA(???).addMode.setA(???)
Command
sbt "scala3-nonbootstrapped/scalac -Ycheck:instrumentCoverage -coverage-out . Repro.scala"
Output
Compiler output
checking Repro.scala after phase instrumentCoverage
*** error while checking Repro.scala after phase instrumentCoverage ***
Exception in thread "main" java.lang.AssertionError: assertion failed: Type Mismatch (while checking typedUnadapted):
Position: Repro.scala:3:25
Found: ($1$ : C)
Required: (?1 : C)
tree = addMode(
{
val $1$: C =
identity[C](
{
scala.runtime.coverage.Invoker.invoked(...)
new C()
}
)
val a$1: Nothing = ???
scala.runtime.coverage.Invoker.invoked(...)
$1$.setA(a$1)
}
)
Expectation
Compilation succeeds with coverage instrumentation and -Ycheck:instrumentCoverage, matching the no-coverage compile of the same source.
Note
Detected while compiling the compiler itself with -Ycheck and coverage.
Compiler version
3.9.0-RC1-bin-SNAPSHOT- latestmainon commit5ad714f170as of 19th of May, 2026.Minimized code
Command
sbt "scala3-nonbootstrapped/scalac -Ycheck:instrumentCoverage -coverage-out . Repro.scala"Output
Compiler output
Expectation
Compilation succeeds with coverage instrumentation and
-Ycheck:instrumentCoverage, matching the no-coverage compile of the same source.Note
Detected while compiling the compiler itself with
-Ycheckand coverage.