Skip to content

cmd/compile: spurious inference error with undefined value #60434

@rsc

Description

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

import "slices"

var s struct{ x int }

func _() {
	slices.Clip(s.y)
}
% go build /tmp/x.go
# command-line-arguments
/tmp/x.go:8:13: cannot infer S ($GOROOT/src/slices/slices.go:403:11)
/tmp/x.go:8:16: s.y undefined (type struct{x int} has no field or method y)
% 

The first error should not be printed, since it is caused by the second error.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions