Skip to content

stopped haxe complaining about deprecated @:extern stuff#79

Open
ninjamuffin99 wants to merge 1 commit intosaharan:masterfrom
ninjamuffin99:macro-extern-fix
Open

stopped haxe complaining about deprecated @:extern stuff#79
ninjamuffin99 wants to merge 1 commit intosaharan:masterfrom
ninjamuffin99:macro-extern-fix

Conversation

@ninjamuffin99
Copy link
Copy Markdown

I believe this fixes it complaining about using the @:extern metadata! I've checked it against the previous outputs and it looks like it's the same!

Comment thread src/oimo/m/B.hx
Comment on lines -124 to +123
field.meta.push({
name: ":extern",
pos: U.pos()
});
Context.getLocalClass().get().isExtern = true;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will change the behavior... 🤔

The removed lines add extern metadata to variables that should finally be wiped, like foo:IVec3 which will be decomposed into fooX, fooY, and fooZ.
On the other hand I think Context.getLocalClass().get() returns the current class that is to be built, so setting it extern may wipe the entire class, but is not working somehow if it isn't causing compiler errors?

Haxe is complaining about the metadata because the metadata @:extern has been promoted into an attribute extern, so adding the attribute properly may be the right way. I need to look into it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think right, to add :extern to a variable it should be field.access.push(AExtern).
But the code still compiles if the vars are not externs, perhaps that's why it also works in an extern class.

@thattuys
Copy link
Copy Markdown

thattuys commented Feb 10, 2026

Isn't a simpler fix changing line 16 to @extern, deleting line 15, and changing line 125 to name: "extern"?

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.

4 participants