Skip to content

Extend scalegen to detect cyclic dependencies when generating encode/decode methods #61

@fasmat

Description

@fasmat

With #44 scalegen was extended to limit the maximum depth of nested types when encoding and decoding types.

Scalegen should also by default not generate code for types that contain cyclic dependencies on each other, e.g.:

type Message struct {
    Sigs []Signatures
}

type Signature struct {
    Message Message
}

This leads to messages that are arbitrarily large and is usually bad design.

Possibly a configurable parameter can be added that would allow the generation of encode & decode methods for types with cyclic dependencies but this should require the user to explicitly allow it and still print a warning during code generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions