Skip to content

[RUST] Modular import defines the same struct multiple times in different files. #370

@Anatoly03

Description

@Anatoly03

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Rust-generated Bebop code creates redundant struct definitions in dependent modules using import. Have a Point struct defined in general.bop and import it into request.bop. Using the build file in the documentation, it will generate the Point class in _::request::Point and _::general::Point (it also generates redundant structs of unused definitions)

Expected behavior

The Point struct should only be generated where it is defined and dependents should instead use-link the struct into the Rust file.

Screenshots / Snippets

// general.bop
struct Point {
    int32 x;
    int32 y;
}
// request.bop
import "./general.bop"

struct PlayerMoveRequest {
    Point position;
}

message Request {
    1 -> PlayerMoveRequest move;
}

Bebop info:

  • Version: 3.0.14 and 3.1.3
  • Runtime: Rust

Desktop (please complete the following information):

  • OS: macOS-Ventura
  • Version 13.7.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions