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
Disallow the previous syntax
```
given (x: T)
... extension methods
```
Require instead
```
given extension (x: T)
... extension methods
```
This avoids the confusion with given instances for types in parentheses and makes
i7515.scala compile. To allow building with 0.20rc1, we allow the old extension syntax
if it comes with a name. E.g. the following is still allowed, but will be dropped
once we have bootstrapped with this commit present.
```
given ops: (x: T)
... extension methods
```
`TupledFunction` can be used to generalize the `Function.untupled` methods to functions of any arities ([full example](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-untupled.scala))
`TupledFunction` can also be used to generalize the [`Tuple1.compose`](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-compose.scala) and [`Tuple1.andThen`](https://github.com/lampepfl/dotty/blob/master/tests/run/tupled-function-andThen.scala) methods to compose functions of larger arities and with functions that return tuples.
@@ -72,7 +72,7 @@ def (f: Args => R) untupled[F, Args <: Tuple, R] given (tf: TupledFunction[F, Ar
72
72
* @tparamGArgs the tuple type with the same types as the function arguments of G
0 commit comments