Closed
Description
Generic numeric literals should be under some sort of flag by 3.0 release.
Additionally, the scala.util.FromDigits
classes should probably be moved to some experimental package or external library
Minimized code
this can be done in 3.0.0-M1
nightlies
case class FooNum(toInt: Int)
given util.FromDigits[FooNum]:
def fromDigits(digits: String): FooNum = FooNum(BigInt(digits).toInt)
@main def Test =
val foo: FooNum = 23
println(foo)
Output
FooNum(23)
Expectation
should not compile without a flag