summaryrefslogtreecommitdiff
path: root/test/files/specialized/t6035/second_2.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/specialized/t6035/second_2.scala')
-rw-r--r--test/files/specialized/t6035/second_2.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/specialized/t6035/second_2.scala b/test/files/specialized/t6035/second_2.scala
new file mode 100644
index 0000000000..fb317e2a6a
--- /dev/null
+++ b/test/files/specialized/t6035/second_2.scala
@@ -0,0 +1,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)
+ }
+}