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

Regression wrt complex type positions #11431

Closed
ncannasse opened this issue Dec 16, 2023 · 3 comments · Fixed by #11433
Closed

Regression wrt complex type positions #11431

ncannasse opened this issue Dec 16, 2023 · 3 comments · Fixed by #11433

Comments

@ncannasse
Copy link
Member

In current Haxe, the position is now part of the complex type. However when creating complex type with macros we don't always have this position set, in which case it will be set to null_pos. But the problem is that if the type is not found, Haxe compiler will simply print Type not found : Name to the output without any position context, making it very hard to debug...

I can easily hit into this error by refactoring some code, without much macros involved so I think that's quite a significant issue.

@ncannasse
Copy link
Member Author

I'm not sure it's the right fix but it now gives me proper position for my refactoring. Reopening so @Simn can give a deep look maybe.

@ncannasse ncannasse reopened this Dec 16, 2023
@Simn
Copy link
Member

Simn commented Dec 16, 2023

It might be better if decode_ast_path doesn't put null_pos there in the first place. I'll take a look.

@Simn
Copy link
Member

Simn commented Dec 18, 2023

How exactly do you create these ComplexTypess? I'm trying to understand how it's possible to have pos set but not posPath.

Simn added a commit that referenced this issue Dec 18, 2023
Simn added a commit that referenced this issue Nov 27, 2024
* [macro] add pos and posPath to TypePath

see #11431

* minor cleanup

* [eval] embrace laziness

* remove context flushing from encoder

This should no longer be necessary. I'm adding the relevant tests to make sure.

* adjust test

* slightly change custom JS generator integration
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 a pull request may close this issue.

2 participants