Closed
Description
Regression reproduced based on Open CB #4730 found in fd4s/vulcan
Part of the #15949 regression tracker
I'm not sure if it's a regression or an improvement. Code, where the error was reported, has not changed recently, so probably these warnings should be checked
Compiler version
Produces warning in 3.2.1-RC1
No warnings in 3.2.0
Minimized code
//> using options "-Xfatal-warnings"
val _ = locally{
sealed abstract class PosInt(val value: Int) {
override def equals(any: Any): Boolean = any.isInstanceOf[PosInt]
}
}
Output
Compiling project (Scala 3.2.1-RC1, JVM)
[error] ./test.scala:5:46: the type test for PosInt cannot be checked at runtime
[error] override def equals(any: Any): Boolean = any.isInstanceOf[PosInt]
[error]
Expectation
Should compile