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

@:pos vs display type #11925

Open
kLabz opened this issue Jan 20, 2025 · 0 comments
Open

@:pos vs display type #11925

kLabz opened this issue Jan 20, 2025 · 0 comments
Milestone

Comments

@kLabz
Copy link
Contributor

kLabz commented Jan 20, 2025

The following code:

macro @:pos(pos) var foo : foo.Bar<$whatever> = bar;

Will create an expression with a TypePath that has pos as position.

This will be an issue in some (admittedly niche) cases where this expression ends up being loaded before the actual display type, because compiler will enter load_instance with that type path, and call display_type for foo.Bar if pos encloses the actual display position (which can happen when using positions like class position or field position for generated expressions, which should probably be avoided in the first place).

It seems this is not easy to fix, because setting pos to the TypePath here is wanted behavior for @:genericBuild at least.

@kLabz kLabz added this to the 5.0 preview 1 milestone Jan 21, 2025
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

No branches or pull requests

1 participant