Closed road21 closed 8 hours ago
3.5.0, 3.3.3
https://scastie.scala-lang.org/road21/GozkhzC7QXaGpkbM7mNYUg/3
for { (x: Any) <- (List[Boolean]()) } yield x
Compile error:
[error] cannot test if value of type Boolean is a reference of class Object [error] (x: Any) <- (List[Boolean]()) [error] ^^^^^^
No compiler error
Same code works fine in Scala 2.13
@sjrd should this actually compile, or is this not supported for a reason? (in which case it'd just need a better error message)
Looks like a bug to me. It should compile.
Compiler version
3.5.0, 3.3.3
Minimized code
https://scastie.scala-lang.org/road21/GozkhzC7QXaGpkbM7mNYUg/3
Output
Compile error:
Expectation
No compiler error
Same code works fine in Scala 2.13