File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ func (p *printer) parameters(fields *ast.FieldList, mode paramMode) {
380
380
if closing := p .lineFor (fields .Closing ); 0 < prevLine && prevLine < closing {
381
381
p .print (token .COMMA )
382
382
p .linebreak (closing , 0 , ignore , true )
383
- } else if mode == typeTParam && fields .NumFields () == 1 && combinesWithName (fields .List [0 ].Type ) {
383
+ } else if mode == typeTParam && fields .NumFields () == 1 && combinesWithName (stripParensAlways ( fields .List [0 ].Type ) ) {
384
384
// A type parameter list [P T] where the name P and the type expression T syntactically
385
385
// combine to another valid (value) expression requires a trailing comma, as in [P *T,]
386
386
// (or an enclosing interface as in [P interface(*T)]), so that the type parameter list
@@ -411,7 +411,7 @@ func combinesWithName(x ast.Expr) bool {
411
411
case * ast.BinaryExpr :
412
412
return combinesWithName (x .X ) && ! isTypeElem (x .Y )
413
413
case * ast.ParenExpr :
414
- return combinesWithName (x .X )
414
+ return ! isTypeElem (x .X )
415
415
}
416
416
return false
417
417
}
You can’t perform that action at this time.
0 commit comments