Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types: missing Info.Types entry for variadic parameter *ast.Ellipsis #28277

alandonovan opened this issue Oct 19, 2018 · 3 comments


Copy link

Type-checking this program:

package p
func f(

causes no type to be recorded for It should be []int.


	fset := token.NewFileSet()
	const src = `package p; func f(`
	f, err := parser.ParseFile(fset, "a.go", src, 0)
	if err != nil {
	info := &types.Info{
		Types: make(map[ast.Expr]types.TypeAndValue),

	if _, err = new(types.Config).Check("p", fset, []*ast.File{f}, info); err != nil {
	ellipsis := f.Decls[0].(*ast.FuncDecl).Type.Params.List[0].Type.(*ast.Ellipsis)
	_, ok := info.Types[ellipsis]
	fmt.Println(ok) // false
Copy link

Change mentions this issue: go/analysis/passes/asmdecl: fix a latent crash

Copy link

It records a type for int in

But fair enough, it probably should also record one for

Copy link

Change mentions this issue: go/types: collect type info for type ...T in variadic functions

gopherbot pushed a commit to golang/tools that referenced this issue Oct 19, 2018
Due to a bug in go/types, a function f(...T) has no type
recorded for the parameter type expression ...T, and apparently
this has never occcured in a file checked by asmdecl before.

The addParams function should really be simplified to use types.Signature.

Updates golang/go#28277

Change-Id: I5b73535a7739b6771ffef1c0a7568f5161d564d5
Reviewed-by: Michael Matloob <>
Run-TryBot: Michael Matloob <>
TryBot-Result: Gobot Gobot <>
@golang golang locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants