Consider the following code:
object Main {
implicit class BytesExt(private val _value: Array[Byte]) extends AnyVal {
def drop(when: Boolean): Array[Byte] = if (when) Array.empty else _value }
val a: Array[Byte] = Array(0)
val b = a.drop(1) }
This compiles fine under Scala 2.13.8 whereas it fails under Scala 3.1.1 with
[error] -- [E007] Type Mismatch Error: .../src/main/scala/Main.scala:7:17
[error] 7 | val b = a.drop(1) }
[error] | ^
[error] | Found: (1 : Int)
[error] | Required: Boolean
Is this the consequence of some changes in the implicit method resolution or is it a compiler bug?
Remarks: