fmt: fix fn return types list ending with comma (#14529)

yuyi 2022-05-26 09:20:22 +08:00 committed by Chewing_Bever
parent 140d494d4c
commit 82332344de
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
3 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,5 @@
fn ok(a int) (int, string) {
return 11, 'hello'
}
fn main() {}

View File

@ -0,0 +1,5 @@
fn ok(a int,) (int, string,) {
return 11, 'hello'
}
fn main() {}

View File

@ -198,7 +198,7 @@ pub fn (mut p Parser) parse_multi_return_type() ast.Type {
p.check(.lpar)
mut mr_types := []ast.Type{}
mut has_generic := false
for p.tok.kind != .eof {
for p.tok.kind !in [.eof, .rpar] {
mr_type := p.parse_type()
if mr_type.idx() == 0 {
break