-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug ??] panic: interface conversion: gnolang.Type is *gnolang.SliceType, not *gnolang.DeclaredType #651
Comments
I changed some code of yours, it works now, but I need further work into it:
|
as a contrast, the code doesn't work in gno but ok in go:
|
#674 , a fix, still checking side effects. |
This should be solved in the preprocessor such that these implicit conversions are turned into explicit conversions. There is already something similar but it only applies to conversions for untyped values. gno/gnovm/pkg/gnolang/preprocess.go Lines 2336 to 2338 in 836f006
(NOTE we should keep in mind in our mission to optimize/benchmark, to make certain assumptions, such as we want OpAssign to be no slower than necessary, regardless of external factors). |
@jaekwon thank you for pointing out the right path, I did have a hard time patching all around. I'll give the fix. |
This is related to #650.
I'm porting
math/big
from go to gno for gno to support what we callarbitrary-precision
Since
math/big
has bunch of implmentaion I'm not going to post full, bug only small part that I'm having issue.this screenshot is part of Add()'s definitation in big/math
variable
z
is type of Int structAs you can see
Int
struct hasabs
member with typenat
which is type[]Word
that actually usesuint
I'm not sure exact terms for that kind of define, but let's just call as a
nested define
.67 line is origin code from go that panics on gno,
69 ~ 72 lines does fix panic by manually defining type, however I'm not sure this is right way to fix them.
If this is a bug, I thinkg pre-process stage is missing some jobs for declard type
If this is not a bug and meant to be intentional, I would like to hear some awesome ways to fix it.
The text was updated successfully, but these errors were encountered: