You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: If you remove the field I error, the helpful error appears. I tried changing the type of E to interface{} and I did not get the panic, but the helpful error instead. The same goes for changing E to a concrete type such as int. I've only be able to reproduce with the error type.
The text was updated successfully, but these errors were encountered:
package hrm
// If either of the below types commented out are uncommented, there is no
// panic and a helpful error message.
//
// type HelpfulError1 struct {
// E int
// T HelpfulError1
// }
//
// type HelpfulError2 struct {
// E interface{}
// T HelpfulError2
// }
type Panics struct {
E error
T Panics
}
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. I have reproduced it with
go1.16.7 darwin/amd64
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a little program with a recursive type which also contained a field of type
error
, and then ran bothgo test
andgo build
:What did you expect to see?
A helpful error that I made a recursive type and the location where it was detected in the source.
What did you see instead?
A panic from
cmd/compile
:NOTE: If you remove the field
I error
, the helpful error appears. I tried changing the type ofE
tointerface{}
and I did not get the panic, but the helpful error instead. The same goes for changingE
to a concrete type such asint
. I've only be able to reproduce with theerror
type.The text was updated successfully, but these errors were encountered: