1
0
mirror of https://github.com/golang/go synced 2024-11-23 22:10:04 -07:00

also cmd/compile/internal/syntax

Change-Id: If10974dd4c44396f553d1581773e37f045a7d224
This commit is contained in:
Mateusz Poliwczak 2024-11-09 12:26:46 +01:00
parent f1f04d35e9
commit 05e596cb5b
2 changed files with 7 additions and 3 deletions

View File

@ -886,10 +886,12 @@ func (p *printer) printSignature(sig *FuncType) {
if list := sig.ResultList; list != nil {
p.print(blank)
if len(list) == 1 && list[0].Name == nil {
p.printNode(list[0].Type)
} else {
p.printParameterList(list, 0)
if _, ok := list[0].Type.(*DotsType); !ok {
p.printNode(list[0].Type)
return
}
}
p.printParameterList(list, 0)
}
}

View File

@ -140,6 +140,8 @@ var stringTests = [][2]string{
{"package p; type _[P ((C)),] int", "package p; type _[P C] int"},
{"package p; type _[P, Q ((C))] int", "package p; type _[P, Q C] int"},
dup("package A; func A() (...A)"),
// TODO(gri) expand
}