aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t5853.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-12 22:44:33 +0100
commit9ef5f6817688f814a3450126aa7383b0928e80a0 (patch)
tree5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/pos/t5853.scala
parent194be919664447631ba55446eb4874979c908d27 (diff)
downloaddotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2
dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/pos/t5853.scala')
-rw-r--r--tests/untried/pos/t5853.scala55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/untried/pos/t5853.scala b/tests/untried/pos/t5853.scala
new file mode 100644
index 000000000..2ebb6667d
--- /dev/null
+++ b/tests/untried/pos/t5853.scala
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+final class C(val x: Int) extends AnyVal {
+ def ppp[@specialized(Int) T](y: T) = ()
+}
+
+
+class Foo {
+ def f = new C(1) ppp 2
+}
+
+
+/* Original SI-5853 test-case. */
+
+object Bippy {
+ implicit final class C(val x: Int) extends AnyVal {
+ def +++[@specialized T](y: T) = ()
+ }
+ def f = 1 +++ 2
+}
+
+
+/* Few more examples. */
+
+final class C2(val x: Int) extends AnyVal {
+ def +++[@specialized(Int) T](y: T) = ()
+}
+
+
+class Foo2 {
+ def f = new C2(1) +++ 2
+}
+
+
+object Arrow {
+ implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal {
+ @inline def ->>[B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
+ }
+
+ def foo = 1 ->> 2
+}
+
+
+object SpecArrow {
+ implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal {
+ @inline def ->> [@specialized(Int) B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y)
+ }
+
+ def foo = 1 ->> 2
+}