upd I have a function that accepts types with existentials:
trait QueryValue[V]
trait QueryValueFormats {
implicit object IntQueryValue extends QueryValue[Int]
implicit object StringQueryValue extends QueryValue[String]
}
trait Magnets {
trait NumericCol[C]
implicit def numericFromInt[T <: Int](s: T)(implicit evidence: QueryValue[T]): NumericCol[T] = new NumericCol[T] {}
implicit def numericFromString[T <: String](s: T)(implicit evidence: QueryValue[T]): NumericCol[T] = new NumericCol[T] {}
}
object Hello extends App with Magnets with QueryValueFormats {
//function accept only existentials
def existentialsOnly(coln: NumericCol[_]*): Unit = println("stub")
existentialsOnly(1, "str")//not compiles
}
It compiles with 2.12, but with 2.13 - not:
[error] ..//Hello.scala:21:20: type mismatch;
[error] found : Int(1)
[error] required: example.Hello.NumericCol[_]
[error] existentialsOnly(1, "str")
[error]
I try to remove existentials(Just some tryings):
def existentialsOnly[T: ClassTag](coln: NumericCol[T]*): Unit
And this make code compilable, but if coln have single type only. E.g:
existentialsOnly("str", "str")
So, how properly use existentials in first case? Does current usage wrong for 2.13?