Skip to content

go/types: repeated 'declared but not used' errors in closures #22524

@rsc

Description

@rsc
$ cat /tmp/x.go
package p

func f() {
	_ = func() {
		var x int
	}
}
$ go get golang.org/x/tools/cmd/gotype
$ gotype /tmp/x.go
x.go:5:7: x declared but not used
x.go:5:7: x declared but not used
$ 

The error should be reported by go/types only once.

/cc @griesemer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions