fmt: fix fn return types list ending with comma (#14529)
parent
410b57b2fa
commit
3849cdcecc
|
@ -0,0 +1,5 @@
|
||||||
|
fn ok(a int) (int, string) {
|
||||||
|
return 11, 'hello'
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,5 @@
|
||||||
|
fn ok(a int,) (int, string,) {
|
||||||
|
return 11, 'hello'
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -198,7 +198,7 @@ pub fn (mut p Parser) parse_multi_return_type() ast.Type {
|
||||||
p.check(.lpar)
|
p.check(.lpar)
|
||||||
mut mr_types := []ast.Type{}
|
mut mr_types := []ast.Type{}
|
||||||
mut has_generic := false
|
mut has_generic := false
|
||||||
for p.tok.kind != .eof {
|
for p.tok.kind !in [.eof, .rpar] {
|
||||||
mr_type := p.parse_type()
|
mr_type := p.parse_type()
|
||||||
if mr_type.idx() == 0 {
|
if mr_type.idx() == 0 {
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue