-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
scala/scala
#7540Description
There are different priorities for two variants of arrow operators:
$ scala
Welcome to Scala 2.12.7 (OpenJDK 64-Bit Server VM, Java 1.8.0_181).
Type in expressions for evaluation. Or try :help.
scala> "a" -> "b" -> "c"
res0: ((String, String), String) = ((a,b),c)
scala> "a" → "b" → "c"
res1: ((String, String), String) = ((a,b),c)
scala> "a" → "b" -> "c"
res2: ((String, String), String) = ((a,b),c)
scala> "a" -> "b" → "c"
res3: (String, (String, String)) = (a,(b,c))
scala> "a" + "b" -> "c"
res4: (String, String) = (ab,c)
scala> "a" + "b" → "c"
res5: String = a(b,c)
Unicode arrow "→" has higher priority then "->". Moreover there are some operators that have priority higher than "->" and lower than "→". It was unexpected for me when I got a broken code after replacement "->" with "→".