Skip to content

Inconsistent map behaviour #81

Open
@dan1elhughes

Description

@dan1elhughes

👋 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions