Skip to content

[CHORE] Clean PolymodEnum calls - #533

Merged
AbnormalPoof merged 1 commit into
FunkinCrew:developfrom
ahmed7p:polymodEnums-clean
Oct 5, 2026
Merged

AbnormalPoof merged 1 commit into
FunkinCrew:developfrom
ahmed7p:polymodEnums-clean

Conversation

@ahmed7p

@ahmed7p ahmed7p commented Oct 5, 2026

Copy link
Copy Markdown

Description

This PR cleans up and centralizes PolymodEnum instantiation and field-lookup logic across Interp by replacing repetitive inline iteration loops with a clean PolymodEnum.tryBuild() helper method.

Changes

  • Added PolymodEnum.tryBuild(): Introduced a new static method to safely handle script enum existence checks, field retrieval, and variable-argument (Reflect.makeVarArgs) instantiation.
  • Converted getField to Static: Moved and changed the instance-level getField method into a static utility helper (getField(e:EnumDecl, name:String)).
  • Refactored Interp.hx: Replaced all repetitive, manual inline field-iteration loops (for (fld in enm.fields)) with clean calls to PolymodEnum.tryBuild().

@AbnormalPoof
AbnormalPoof merged commit 28b24f1 into FunkinCrew:develop Oct 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants