blob: 5873eace1443de9e4e5bb58453b47ff4e0939f20 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import scala.language.implicitConversions
object Test extends dotty.runtime.LegacyApp {
class ArrowAssocClass[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)
}
{
@inline implicit def ArrowAssoc[A](x: A): ArrowAssocClass[A] = new ArrowAssocClass(x)
val x = 1 -> "abc"
println(x)
}
{
val y = 2 -> "def"
println(y)
}
}
|