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

@:native vs. two macros #11481

Closed
Simn opened this issue Jan 10, 2024 · 1 comment
Closed

@:native vs. two macros #11481

Simn opened this issue Jan 10, 2024 · 1 comment

Comments

@Simn
Copy link
Member

Simn commented Jan 10, 2024

// Main.hx

function main() {
	trace(pack.OldClass);
}
// pack/OldClass.hx

package pack;

@:native("NewClass")
class OldClass {
	macro static function f2() {
		return null;
	}

	macro static function f1() {
		return null;
	}
}

This fails in one of the macros with Module pack.OldClass does not define type OldClass.

I think this is because flush_macro_context does apply_native_paths, and then the second macro can't find its own class anymore.

@Simn
Copy link
Member Author

Simn commented Jan 10, 2024

I have simply removed the renaming because I don't see why the macro context would need native names like that. There's nothing native here and all this does is cause paths from the macro and outside contexts to be out of sync.

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