# Scala3 extension drops colon's right-associativity

**URL:** <https://users.scala-lang.org/t/scala3-extension-drops-colons-right-associativity/7478>\
**Category:** Design\
**Created:** [May 24, 2021, 7:24am UTC](https://users.scala-lang.org/t/scala3-extension-drops-colons-right-associativity/7478 "2021-05-24T07:24:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwvh](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jwvh/32/1882_2.png) [@jwvh](https://users.scala-lang.org/u/jwvh)\
**Post date:** [May 24, 2021, 7:24am UTC](https://users.scala-lang.org/t/scala3-extension-drops-colons-right-associativity/7478/1 "2021-05-24T07:24:08Z")

</div>

The following produces different results depending on which line is un-commented.

```auto
// implicit class C(i: Int): //extension the old way
// extension (i: Int) //extension the new way
      def @:(arg: Int):Unit = println(s"$i.@:($arg)")

  44 @: 7

```

Is this by design? I haven’t found it documented.

---

<div class="post-metadata">

**Author:** ![Jasper-M](https://users.scala-lang.org/user_avatar/users.scala-lang.org/jasper-m/32/872_2.png) [@Jasper-M](https://users.scala-lang.org/u/Jasper-M)\
**Post date:** [May 24, 2021, 3:53pm UTC](https://users.scala-lang.org/t/scala3-extension-drops-colons-right-associativity/7478/2 "2021-05-24T15:53:24Z")

</div>

It appears to be by design. Note however that the operator remains right-associative. I.e. `1 @: 2 @: 3` is evaluated as `(1 @: (2 @: 3))`.

There’s some talk about right associative extension methods [here](https://dotty.epfl.ch/docs/reference/contextual/extension-methods.html#operators) under the “Operators” header. And more details [here](https://dotty.epfl.ch/docs/reference/contextual/right-associative-extension-methods.html).

I guess they did it this way because it’s more intuitive that the “receiver” is always the argument on the left. But I’m not sure they succeeded, cause now you have the weird “parameter swapping” which can cause issues with dependent parameters, and the discrepancy with right-associative methods on classes.
