Let
def h(a: AnyRef*) = a.mkString(\",\")
h: (a: AnyRef*)String
and so
h(\"1\",\"2\")
res: String = 1,2
H
You can reproduce the issue simply with:
val x: AnyRef = 42
Here's the relevant pull request on github that introduced the change
The rationale is that for security reasons some implicit conversions are explicitly disabled, namely when the conversion goes from T to U is disabled if:
T <: Null
or
AnyRef <: U
In your specific case, this means that an Int (which is not an AnyRef) will never be converted to AnyRef.
If you need to accept both Int and String, you can consider accepting Any instead. Since every scala object inherits from Any, there's no implicit conversion needed.
def h(a: Any*) = a.mkString(",")