You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: map name position to desugared version of named context bound (#22374)
resolves: #22335
This PR changes the positions so context bound name position is
correctly mapped in the desugaring:
```scala
def aa[T : Numeric as num]() = ??? // original code
def aa[T >: Nothing <: Any]()(using num: Numeric[T]): Nothing = ??? // desugared code, where position of `num` points to `num` in the original code
```
This also affects the cases where context bound is not named. The
definition position of `evidence$0` changed:
```scala
def aa[T : Numeric]() = ??? // original code
def aa[T >: Nothing <: Any]()(using evidence$0: Numeric[T]): Nothing = ??? // desugared code
// previously position of evidence$0 in original code
def aa[T : <<>>Numeric]() = ???
// after this PR
def aa[T : Numeric<<>>]() = ???
```
Which I think makes sense since if the was a name it would go after the
context bound
0 commit comments