We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In Go language, user is able to define a custom type on top of a built-in type.
For example:
type Set map[string]struct{} func NewSet(items ...string) Set { ... } func (s Set) Has(key string) bool { _, ok := s[key] return ok }
When I'm trying to use the same type, I get a following error:
Snippet
recovered: interface conversion: gnolang.Type is *gnolang.DeclaredType, not *gnolang.MapType stack: goroutine 60 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x65 github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1() /opt/build/pkgs/sdk/baseapp.go:743 +0x2cd panic({0xc60820, 0xc014450700}) /usr/local/go/src/runtime/panic.go:884 +0x212 ...
The same code but without custom map type works.
Looks like, Gno doesn't support this kind of stuff. I checked Go and Gno compat guide but it didn't mention this limitation.
Can you please update the compat doc?
The text was updated successfully, but these errors were encountered:
The problem mentioned here will be fixed by #1246
Sorry, something went wrong.
deelawn
Successfully merging a pull request may close this issue.
Description
In Go language, user is able to define a custom type on top of a built-in type.
For example:
When I'm trying to use the same type, I get a following error:
Snippet
The same code but without custom map type works.
Looks like, Gno doesn't support this kind of stuff. I checked Go and Gno compat guide but it didn't mention this limitation.
Can you please update the compat doc?
The text was updated successfully, but these errors were encountered: