-
Notifications
You must be signed in to change notification settings - Fork 77
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
storage.Put ambiguity #3381
Comments
Hello, I saw your comment on #3372. Do you mean merging PutInt and GetInt into a single issue? I'm not sure if I understand it. This feature is critical from a user experience point of view. The storage layer's lack of types forces a lot of casting, often leading to runtime errors. All SDKs should include GetInt/PutInt and variations. |
We already have similar implicit conversion code emitted for What about using safe typecast for this, like And because this is done by the compiler (interop still returns 1 value) using |
Is very much different to me. They just follow regular Go semantics and do This can be solved with a new API around |
Is your feature request related to a problem? Please describe.
I'm always frustrated when people try to use storage.Put for structs/arrays/map and it fails in a very unpredictable way. It's documented to only work with simple types, but we better prevent this then explain again and again.
Describe the solution you'd like
Have some lower layer thin wrapper for
System.Storage.Put
that works with[]byte
and then have a convenience wrapper that utilizes serialization interop for transparent conversion.The problem is, we need backwards compatibility for existing code.
Describe alternatives you've considered
Leaving as is. Well, it works. But it's really unobvious.
The text was updated successfully, but these errors were encountered: