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

MacroApi cleanup for Haxe 5 #11433

Draft
wants to merge 7 commits into
base: development
Choose a base branch
from
Draft

MacroApi cleanup for Haxe 5 #11433

wants to merge 7 commits into from

Conversation

Simn
Copy link
Member

@Simn Simn commented Dec 18, 2023

Still some TODOs.

Closes #11431

@skial skial mentioned this pull request Dec 24, 2023
1 task
@back2dos
Copy link
Member

back2dos commented Feb 3, 2024

Since adding optional fields always incurs a marginal risk for breaking user code, might I use this opportunity to request also adding the positions of other names currently not exposed?

  1. The position of the type name in BaseType and TypeDefinition.
  2. The position of the field name in Field, ObjectField, EnumField and ClassField.

I see that some of these are already encoded in an unspecified name_pos (i.e. in ObjectField and EnumField as far as I can tell), but it would be nice to have proper access and generally be able to define / refer to finer grained positions for the sake of not coloring everything red.

FWIW I think in the types from haxe.macro.Type it could even be non-optional, because to the best of my knowledge constructing types by hand is not really a thing.

@Simn
Copy link
Member Author

Simn commented Feb 3, 2024

I'll have to check all this again, I thought this name_pos business was mostly for enum instances, where we can't access the value from Haxe anyway. But yes I'd like to clean all this up and provide all the information to macros.

# Conflicts:
#	src/typing/macroContext.ml
kLabz added a commit that referenced this pull request May 15, 2024
Simn pushed a commit that referenced this pull request May 15, 2024
* [macro] Don't choke on namePos for reification pattern matching

* [tests] Add test for 11670

* Do it like in #11433
kLabz added a commit that referenced this pull request Jun 28, 2024
* [macro] Don't choke on namePos for reification pattern matching

* [tests] Add test for 11670

* Do it like in #11433
@kLabz kLabz added this to the Release 5.0 milestone Jun 28, 2024
kLabz added a commit that referenced this pull request Jul 18, 2024
* [macro] Don't choke on namePos for reification pattern matching

* [tests] Add test for 11670

* Do it like in #11433
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.

Regression wrt complex type positions
3 participants