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
$ gno run a.gnopanic running expression main(): reflect: reflect.Value.SetString using value obtained using unexported field
My opinion is that in the long run we should aim to drop all the gonative opcodes and code; it appears to me that gonative is mostly especially useful for "bootstrapping" functions in Gno, and is currently still useful mostly for functions like fmt.Sprintf, which would need to rely on reflection to work as expected.
However, to support use cases (such as mine, where I was trying to simply t.Log a struct) we may add a temporary fix to the problem.
On the patch/gnochess branch, I changed this line to make the struct field exported. This is a dirty trick, but it does the job:
$ gno run a.gno
test struct { Xv string }{Xv:"a"}%
Should a fix like this one be added to the main branch?
The text was updated successfully, but these errors were encountered:
This happens mostly when doing a "gonative" call, such as is the case for
(testing.T).Log
, or more generallyfmt.Sprintf
.My opinion is that in the long run we should aim to drop all the
gonative
opcodes and code; it appears to me thatgonative
is mostly especially useful for "bootstrapping" functions in Gno, and is currently still useful mostly for functions likefmt.Sprintf
, which would need to rely on reflection to work as expected.However, to support use cases (such as mine, where I was trying to simply
t.Log
a struct) we may add a temporary fix to the problem.On the patch/gnochess branch, I changed this line to make the struct field exported. This is a dirty trick, but it does the job:
Should a fix like this one be added to the main branch?
The text was updated successfully, but these errors were encountered: