aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/spec-maps.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/spec-maps.scala')
-rw-r--r--tests/untried/pos/spec-maps.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/untried/pos/spec-maps.scala b/tests/untried/pos/spec-maps.scala
new file mode 100644
index 000000000..d961110cd
--- /dev/null
+++ b/tests/untried/pos/spec-maps.scala
@@ -0,0 +1,10 @@
+trait Fun1[@specialized +R, @specialized -T] {
+ def apply(x: T): R
+}
+
+object Main {
+ def mapA[@specialized B](xs: Array[B], f: Fun1[B, B]): Unit = {
+ for (i <- 0 until xs.length)
+ xs(i) = f(xs(i))
+ }
+}