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

A map<bool, bool> field generates invalid TS #926

Closed
jcready opened this issue Sep 27, 2023 · 1 comment · Fixed by #933
Closed

A map<bool, bool> field generates invalid TS #926

jcready opened this issue Sep 27, 2023 · 1 comment · Fixed by #933
Labels

Comments

@jcready
Copy link

jcready commented Sep 27, 2023

An example:

message Example {
    map<bool, bool> map_bool_bool = 68;
}

Will generate code which doesn't typecheck:

export interface Example {
    mapBoolBool: { [key: boolean]: boolean };
    //               ^ An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type.(1268)
}

To be clear, this issue will present itself in any map field which uses bool for the key, so map<bool, string> also has this issue.

stephenh added a commit that referenced this issue Sep 30, 2023
stephenh added a commit that referenced this issue Sep 30, 2023
stephenh added a commit that referenced this issue Sep 30, 2023
* fix: Use a Map when map keys are boolean.

Fixes #926

* Fix toJSON.

* Fix tests.

* Fix test.
stephenh pushed a commit that referenced this issue Sep 30, 2023
## [1.159.1](v1.159.0...v1.159.1) (2023-09-30)

### Bug Fixes

* Use a Map when map keys are boolean. ([#933](#933)) ([c1253a3](c1253a3)), closes [#926](#926)
@stephenh
Copy link
Owner

🎉 This issue has been resolved in version 1.159.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants