Skip to content

Inconsistent map behaviour #81

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

Open
dan1elhughes opened this issue Feb 3, 2025 · 0 comments
Open

Inconsistent map behaviour #81

dan1elhughes opened this issue Feb 3, 2025 · 0 comments

Comments

@dan1elhughes
Copy link
Contributor

dan1elhughes commented Feb 3, 2025

👋 When using a map that contains a newly defined type, like this:

type Foo uint

type Bar struct {
	Foo        Foo            `json:"foo"`
	FooInKey   map[Foo]bool   `json:"fooInKey"`
	FooInValue map[string]Foo `json:"fooInValue"`
}

the key value in the map does not become number as expected. The output instead:

export class Bar {
    foo: number;
    fooInKey: {[key: Foo]: boolean};
//                   ^ here
    fooInValue: {[key: string]: number};
}

I have created a PR to demonstrate the behaviour here.

Thanks!

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

1 participant