blob: fb317e2a6a16bb9e2641ca28769a5a37bd1849a4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
class Baz extends Inter {
def foo(x: Int) = x + 1
}
object Test {
def main(args: Array[String]) {
// it's important that the type is Inter so we do not call Baz.foo(I)I directly!
val baz: Inter = new Baz
// here we should go through specialized version of foo and thus have zero boxing
baz.foo(1)
println(runtime.BoxesRunTime.integerBoxCount)
}
}
|