create functions on a companion object which do the construction for you in a typesafe way that can be checked at compile time:
class myClass(){
var someStrings: List[String]=List[String]()
println("hello!")
}
object myClass {
def fromStrings(strings: List[String]) = {
val c = new myClass
c.someStrings = strings
}
def fromInts(ints: List[Int]) = {
val c = new myClass
c.someStrings = ints.map(_.toString)
}
}
object Usage {
val c1 = myClass.fromStrings(List("a","b","c"))
val c2 = myClass.fromInts(List(1,2,3))
}
I would urge you to avoid overloading in general, or checking types at runtime, when you could be checking types at compile-time instead