Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More strict macro API for init vs non init macros #11043

Merged
merged 14 commits into from
Mar 28, 2023

Conversation

kLabz
Copy link
Contributor

@kLabz kLabz commented Mar 27, 2023

As a first step towards #7871, adds:

  • Context.onAfterInitMacros to register typer-related code from init macros to be run once typer is ready
  • Context.initMacrosDone to check if configuration phase is over
  • Warnings, hidden behind -D haxe-next for now, about code currently run from init macros that should be delayed using Context.onAfterInitMacros
  • Warnings, that were (mostly?) already present with different message/position, about code meant for configuration phase that is currently run after init macros

Also adds Context.getMacroStack() to get a call stack of haxe.macro.Position for code running in macro context. Useful for custom message reporting.

Closes #11039

@kLabz kLabz marked this pull request as ready for review March 28, 2023 07:38
@kLabz
Copy link
Contributor Author

kLabz commented Mar 28, 2023

(waiting for #11046 before running CI again)

@kLabz kLabz force-pushed the feature/strict-init-macros branch from cbbeaa7 to ffa5d46 Compare March 28, 2023 08:06
@kLabz kLabz removed the test-needed label Mar 28, 2023
@kLabz
Copy link
Contributor Author

kLabz commented Mar 28, 2023

CI failures are unrelated.

@kLabz kLabz added this to the Release 4.3 milestone Mar 28, 2023
@Simn Simn merged commit 4c1c121 into development Mar 28, 2023
@Simn Simn deleted the feature/strict-init-macros branch March 28, 2023 12:14
@skial skial mentioned this pull request Mar 29, 2023
1 task
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.

Add Context.onAfterInitMacros
2 participants