Scala: arrays and type erasure
问题 I'd like to write overloaded functions as follows: case class A[T](t: T) def f[T](t: T) = println("normal type") def f[T](a: A[T]) = println("A type") And the result is as I expected: f(5) => normal type f(A(5)) => A type So far so good. But the problem is the same thing doesn't work for Arrays: def f[T](t: T) = println("normal type") def f[T](a: Array[T]) = println("Array type") Now the compiler complains: double definition: method f:[T](t: Array[T])Unit and method f:[T](t: T)Unit at line 14