reflect: Set: argument validation panics with ValueError, which is for receiver #41953
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
Pass a zero reflect.Value to Value.Set, as an argument.
https://play.golang.org/p/hynNVbNp4-L
What did you expect to see?
An error that puts the culprit on Value.Set's argument, not on its receiver. Something like:
What did you see instead?
A ValueError like this:
According to the docs:
But that's not what's really happening here. The receiving Value does support Set. It's the argument which is wrong.
The text was updated successfully, but these errors were encountered: