Compiler version
3.10.0-RC1-bin-SNAPSHOT - on latest main as of 6 August 2026, commit 266b5b3afe.
Minimized code
import language.experimental.captureChecking
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
abstract class Repro[+A](initialTail: (AnyRef | Null)^):
def makeUpdater: TailUpdater =
new TailUpdater(
AtomicReferenceFieldUpdater.newUpdater(
classOf[Repro[?]],
classOf[AnyRef],
"_tail"
)
)
final class TailUpdater(u: AtomicReferenceFieldUpdater[Repro[?], AnyRef])
Command
sbt -error -no-colors "scala3-bootstrapped/scalac -color:never -language:experimental.captureChecking -Yexplicit-nulls -coverage-out target/issue-coverage -sourceroot . -d target/issue-out Repro.scala"
Output
-- [E007] Type Mismatch Error: Repro.scala:8:44 -------------------------------
8 | AtomicReferenceFieldUpdater.newUpdater(
| ^
|Found: (u$1 :
| (
| java.util.concurrent.atomic.AtomicReferenceFieldUpdater[
| Repro[?]{val initialTail: (Object | Null)^{any}}^{}, Object^{}]^{}
| )?
|)
|Required: java.util.concurrent.atomic.AtomicReferenceFieldUpdater[Repro[?], AnyRef]
|
|Note that capability `any²` cannot flow into capture set {any} of value u$1.
|
|The error occurred for a synthesized tree: u$1
|
|where: any is a root capability in the type of value initialTail
| any² is a root capability in the type of value initialTail
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 the standard library to work with scoverage.
Compiler version
3.10.0-RC1-bin-SNAPSHOT- on latestmainas of 6 August 2026, commit266b5b3afe.Minimized code
Command
sbt -error -no-colors "scala3-bootstrapped/scalac -color:never -language:experimental.captureChecking -Yexplicit-nulls -coverage-out target/issue-coverage -sourceroot . -d target/issue-out Repro.scala"Output
Expectation
Compilation succeeds with coverage instrumentation.
Notes
Is a blocker for the standard library to work with scoverage.