blob: de9d1b7040c6e9b9e92832ad3acfe331c055e788 (
plain) (
blame)
1
2
3
4
5
6
7
8
|
object Example extends App {
type Tag[X] = {type Tag = X}
type TaggedArray[T] = Array[T] with Tag[Any]
def method[T: reflect.ClassTag](a: TaggedArray[T], value: T) {a.update(0, value)}
method(Array(1, 2).asInstanceOf[TaggedArray[Int]], 1)
}
|