File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -208,10 +208,20 @@ abstract class Positioned extends Product {
208
208
// Leave out tparams, they are copied with wrong positions from parent class
209
209
check(tree.mods)
210
210
check(tree.vparamss)
211
- case tree : DefDef if tree.mods.is(Extension ) && tree.vparamss.nonEmpty =>
212
- check(tree.vparamss.head)
213
- check(tree.tparams)
214
- check(tree.vparamss.tail)
211
+ case tree : DefDef if tree.mods.is(Extension ) =>
212
+ tree.vparamss match {
213
+ case vparams1 :: vparams2 :: rest if ! isLeftAssoc(tree.name) =>
214
+ check(vparams2)
215
+ check(tree.tparams)
216
+ check(vparams1)
217
+ check(rest)
218
+ case vparams1 :: rest =>
219
+ check(vparams1)
220
+ check(tree.tparams)
221
+ check(rest)
222
+ case _ =>
223
+ check(tree.tparams)
224
+ }
215
225
check(tree.tpt)
216
226
check(tree.rhs)
217
227
case _ =>
Original file line number Diff line number Diff line change @@ -2259,7 +2259,12 @@ object Parsers {
2259
2259
val mods1 = addFlag(mods, flags)
2260
2260
val name = ident()
2261
2261
val tparams = typeParamClauseOpt(ParamOwner .Def )
2262
- val vparamss = leadingParamss ::: paramClauses(ofMethod = true )
2262
+ val vparamss = paramClauses(ofMethod = true ) match {
2263
+ case rparams :: rparamss if leadingParamss.nonEmpty && ! isLeftAssoc(name) =>
2264
+ rparams :: leadingParamss ::: rparamss
2265
+ case rparamss =>
2266
+ leadingParamss ::: rparamss
2267
+ }
2263
2268
var tpt = fromWithinReturnType {
2264
2269
if (in.token == SUBTYPE && mods.is(Inline )) {
2265
2270
in.nextToken()
You can’t perform that action at this time.
0 commit comments