Skip to content
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

generating map types with uint64 keys yields uncompilable typescript #633

Open
technicallyty opened this issue Jul 8, 2024 · 2 comments

Comments

@technicallyty
Copy link

technicallyty commented Jul 8, 2024

when generating proto code that has type of

map<uint64, someotherType> telescope generates uncompilable typescript. map key types can only be a Number type.

example here:

https://github.com/technicallyty/telescope-test/blob/4a69452e6587c1a0de70069dd774a227cf4adfde/src/codegen/cosmos/auth/v1beta1/auth.ts#L124

that line produces an error:
image

this is the message it generated from:

message Foo {
  map<uint64, string> bar = 1;
}

docs here say we can use long or bigint for 64 bit integer types, however neither type is valid when used in a map as key.

@Zetazzz
Copy link
Collaborator

Zetazzz commented Jul 19, 2024

if both bigint or long's not valid key type, then we need to fix this using string as the key type and do the converting in this case:

https://github.com/technicallyty/telescope-test/blob/4a69452e6587c1a0de70069dd774a227cf4adfde/src/codegen/cosmos/auth/v1beta1/auth.ts#L124

@technicallyty
Copy link
Author

any update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants