cmd/compile: confusing error when trying to instantiate type parameter on other-package constraint with unexported fields #51942
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Consider the following 3-files program:
go.mod:
a/a.go
test.go
With go1.18 and tip, the program does not compile:
playground link: https://go.dev/play/p/yvRVxYbdkpK
To to me it looks like it should(?). The same constraint and function work fine when they're part of the main package. Am I missing something?
EDIT: I had the wrong mental model, it's correct that this doesn't work but the error message is slightly confusing. See below.
cc @findleyr @griesemer @mdempsky
The text was updated successfully, but these errors were encountered: