cmd/compile: IncompatibleAssign spreading slice of interface compliant types into variadic function accepting interface #62151
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?While this doesn't seem to be version-specific and appears to be an intentional design choice, it is unexpected behavior.
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Spreading a slice of interface compliant types into a function expecting variadic interface parameter results in an unexpected
IncompatibleAssign
. Directly passing the interface compliant types to the function as comma separated arguments compiles fine.https://go.dev/play/p/NP6-6rHauMC
What did you expect to see?
No compilation error
What did you see instead?
Compilation error
The text was updated successfully, but these errors were encountered: