Closed
Description
Compiler version
3.0.0-RC1
Minimized code and output
import scala.language.experimental.genericNumberLiterals
type BigInteger = java.math.BigInteger
given BigInteger: scala.util.FromDigits[BigInteger] with {
def fromDigits(digits: String) = new BigInteger(digits)
def apply(x: BigInteger) = x
def apply(x: String) = fromDigits(x)
}
println(BigInteger(1))
^^^^^^^^^^
None of the overloaded alternatives of method apply in object BigInteger with types
(x: String): BigInteger
(x: BigInteger): BigInteger
match arguments ((1 : Int))
Expectation
Should work as when there's no overload:
given BigInteger: scala.util.FromDigits[BigInteger] with {
def fromDigits(digits: String) = new BigInteger(digits)
def apply(x: BigInteger) = x
}
println(BigInteger(1))
// 1