Skip to content

enum field names conflict, service method names conflict, method arguments conflicts. #16

@pavloschh

Description

@pavloschh

If in my thrift file I have two enums with the same name fields in them Types.hs has those two enums declared as a two sum types with the same constructor name which obviously a name conflict making it impossible to compile. Workaround would be to modify Types.hs by hand but it would be great if generator do some prefix in names the same way as in struct definitions.
The same feature applies to service's method names and arguments for them.

example thift file:

..
enum Enum1 {
SomeName,
SomeOtherNameInEnum1
}

enum Enum2 {
SomeName,
SomeOtherNameInEnum2
}
..

generated Types.hs:

..
data Enum1
= SomeName -- <<<--- this
| SomeOtherNameInEnum1
deriving (...)

data Enum2
= SomeName -- <<<--- and this
| SomeOtherNameInEnum2
deriving (...)
..

enum_field_and_service_args_names_patch.patch.gz

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