summaryrefslogtreecommitdiff
path: root/test/files/run/genericValueClass.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/genericValueClass.scala')
-rw-r--r--test/files/run/genericValueClass.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/genericValueClass.scala b/test/files/run/genericValueClass.scala
new file mode 100644
index 0000000000..68162bb685
--- /dev/null
+++ b/test/files/run/genericValueClass.scala
@@ -0,0 +1,17 @@
+final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal {
+ @inline def -> [B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
+ def →[B](y: B): Tuple2[A, B] = ->(y)
+}
+
+object Test extends App {
+ {
+ @inline implicit def any2ArrowAssoc[A](x: A): ArrowAssoc[A] = new ArrowAssoc(x)
+ val x = 1 -> "abc"
+ println(x)
+ }
+
+ {
+ val y = 2 -> "def"
+ println(y)
+ }
+}