mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/syntax: fix error message for ... without type
Only complain about missing type; leave it to type-checking to decide whether "..." is permitted in the first place. Fixes #43674. Change-Id: Icbc8f084e364fe3ac16076406a134354219c08d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/310209 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
ddd8d7c0a6
commit
a63ff398d5
3 changed files with 15 additions and 2 deletions
|
|
@ -1836,7 +1836,7 @@ func (p *parser) paramDeclOrNil(name *Name) *Field {
|
|||
t.Elem = p.typeOrNil()
|
||||
if t.Elem == nil {
|
||||
t.Elem = p.badExpr()
|
||||
p.syntaxError("final argument in variadic function missing type")
|
||||
p.syntaxError("... is missing type")
|
||||
}
|
||||
f.Type = t
|
||||
return f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue