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

[fix] Fallback to string keys in maps #71

Merged
merged 1 commit into from
Nov 20, 2018
Merged

Conversation

ferozco
Copy link
Contributor

@ferozco ferozco commented Nov 20, 2018

Before this PR

We would generate key types by resolving the type of the key. This caused definitions with maps containing booleans and doubles as keys to generate invalid TypeScript.

After this PR

We fall back to string on any type which is not a string or an enum

@ferozco ferozco requested a review from a team as a code owner November 20, 2018 16:40
@dansanduleac
Copy link
Contributor

Currently, this still means that the double keys 0 and 0.0 will be different items in the map (since even the javascript equality on double values considers them different). There's not much we can do about that while javascript doesn't offer a meaningful equality relation.

However, once we finish defining the RFC for deduping map keys and set items we should add custom logic to dedupe keys correctly based on their conjure types.

@bulldozer-bot bulldozer-bot bot merged commit dc0b2dd into develop Nov 20, 2018
@bulldozer-bot bulldozer-bot bot deleted the fo/string-keys branch November 20, 2018 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants