Skip to content

Bug: Enum generator fails to handle binary expressions with iota #14

@umputun

Description

@umputun

Bug Description

The enum generator fails to properly handle binary expressions like 'iota + 1' in enum declarations.

Example:

When defining an enum with iota + 1, the first constant is missing from the generated code.

Root Cause:

The parser in generator.go only handles plain iota identifiers but doesn't handle binary expressions like iota + 1, which are common in enum declarations.

Fix Needed:

Add support for ast.BinaryExpr to handle expressions like iota + 1, iota + 2, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions