1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 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
}
|