File tree 1 file changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/printing
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -795,9 +795,14 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
795
795
withEnclosingDef(tree) {
796
796
val (prefix, vparamss) =
797
797
if isExtension then
798
- (keywordStr(" extension" ) ~~ paramsText(tree.vparamss.head)
798
+ val (leadingParams, otherParamss) = (tree.vparamss: @ unchecked) match
799
+ case vparams1 :: vparams2 :: rest if ! isLeftAssoc(tree.name) =>
800
+ (vparams2, vparams1 :: rest)
801
+ case vparams1 :: rest =>
802
+ (vparams1, rest)
803
+ (keywordStr(" extension" ) ~~ paramsText(leadingParams)
799
804
~~ (defKeyword ~~ valDefText(nameIdText(tree, dropExtension = true ))).close,
800
- tree.vparamss.tail )
805
+ otherParamss )
801
806
else (defKeyword ~~ valDefText(nameIdText(tree)), tree.vparamss)
802
807
803
808
addVparamssText(prefix ~ tparamsText(tree.tparams), vparamss) ~
You can’t perform that action at this time.
0 commit comments