/ go Public
cmd/compile: confusing error when trying to instantiate type parameter on other-package constraint with unexported fields #51942
Issues related to the Go compiler and/or runtime.
Feedback is required from experts, contributors, and/or the community before a change can be made.
Consider the following 3-files program:
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: