-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:nullabilityarea:private optionsIssues tied to -Y private/internal compiler settings.Issues tied to -Y private/internal compiler settings.itype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Description
Based on the OpenCB failure in stg-tud/bismuth
- build logs
Compiler version
Last good release: 3.8.0-RC1-bin-20250817-8c3f1a6-NIGHTLY
First bad release: 3.8.0-RC1-bin-20250818-aaa39c5-NIGHTLY
Bisect points to aaa39c5 (seems unrelated)
Minimized code
//> using options -Yexplicit-nulls
trait Key[T]
trait Bucket[T]:
def key: Key[T]
def Test =
val bucket: Option[Bucket[String]] = ???
val key = bucket.fold[Key[String] | Null](null)(_.key)
if (key ne null) then
println("not null")
Output
[error] ./test.scala:10:7
[error] expression does not take parameters
[error] if (key ne null) then
[error] ^^^^^^^^^^^
Expectation
Should either compile or the error message should suggest using ==
/ !=
operators
noti0na1
Metadata
Metadata
Assignees
Labels
area:nullabilityarea:private optionsIssues tied to -Y private/internal compiler settings.Issues tied to -Y private/internal compiler settings.itype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore