Skip to content

fix: issues Event derive macro on structs with unnamed fields#15

Draft
PiquelChips wants to merge 4 commits intomainfrom
fix/event-derive
Draft

fix: issues Event derive macro on structs with unnamed fields#15
PiquelChips wants to merge 4 commits intomainfrom
fix/event-derive

Conversation

@PiquelChips
Copy link
Copy Markdown
Owner

@PiquelChips PiquelChips commented Apr 8, 2026

Fix an issue where the Event derive macro would destructure structs with unnamed fields by creating variables named after ints (like "0"). Now, destructures to names with _ for the names to be acceptable by the compiler. To keep using the indexes in the format message, we append the the variables to the formatting, filtering out indeces that are not specified in the format message.

Setup removing subscribers from the event manager if their channel closes.

TODO

  • if receive channel is closed, remove from list
  • Setup tests for Events
    • make an event of every possible type (enum & struct with each field type)
    • annotate them fitting possible edge cases
  • Fix macro for tests to pass

@PiquelChips PiquelChips added this to the 0.1 milestone Apr 8, 2026
@PiquelChips PiquelChips self-assigned this Apr 8, 2026
@PiquelChips PiquelChips added the enhancement New feature or request label Apr 8, 2026
@PiquelChips PiquelChips moved this from Up next to In Progress in DirkEngine Development Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant