-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:experimental:ccCapture checking relatedCapture checking relatedarea:typeritype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Description
Based on failure in OpenCB for sbt/sbt
- build logs
Compiler version
Last good release: 3.8.0-RC1-bin-20250818-aaa39c5-NIGHTLY
First bad release: 3.8.0-RC1-bin-20250819-1f13619-NIGHTLY
Bisect points to 1f13619
I have not inspected the ++
signature but probably it captures the argument. The infered reference to private symbol is probably not stripped.
It needs to be fixed before 3.8 - the opt-in experimental.cc is currently affecting the default compilation mode.
Minimized code
class Setting
object Test:
private lazy val settings: Seq[Setting] = Nil
def fails = Seq.empty[Setting] ++ settings
def works: Seq[Setting] = Seq.empty[Setting] ++ settings
Output
Compiling project (Scala 3.8.0-RC1-bin-20250907-8c9c051-NIGHTLY, JVM (21))
[error] ./test.scala:6:7
[error] non-private method fails in object Test refers to private lazy value settings
[error] in its type signature => Seq[Setting]
[error] def fails = Seq.empty[Setting] ++ settings
[error] ^
Expectation
The typer should strip the captured symbol when CC is not enabled
Metadata
Metadata
Assignees
Labels
area:experimental:ccCapture checking relatedCapture checking relatedarea:typeritype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore