blob: 4d87998ec650a4bff6c959b9cbdd3f16bf519f13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
trait Foo[@specialized(Int) A] {
def fun[@specialized(Int) B](init: B)(f: (B, A) => B): B
}
class Bar(values: Array[Int]) extends Foo[Int] {
def fun[@specialized(Int) C](init: C)(f: (C, Int) => C): C = {
val arr = values
f(init, arr(0))
}
}
|