Skip to content

stopped haxe complaining about deprecated @:extern stuff #79

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/oimo/m/B.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ using Lambda;
/**
* Build Macro
*/
@:haxe.warning("-WDeprecated") // for using @:extern but this doesn't seem to be working...
@:extern
class B {

#if macro
Expand All @@ -30,7 +28,7 @@ class B {

static var onGenerateAdded:Bool = false;

public static function bu() {
macro static function bu():Array<Field> {
if (!onGenerateAdded) {
Context.onGenerate(onGenerate);
onGenerateAdded = true;
Expand Down Expand Up @@ -91,7 +89,7 @@ class B {
}
}

public static function filter() {
public static function filter():Array<Field> {
var fs:Array<Field> = Context.getBuildFields();
var fs2:Array<Field> = [];
log("filtering... " + fs);
Expand Down Expand Up @@ -121,10 +119,8 @@ class B {
pos: U.pos()
}], field.access);

field.meta.push({
name: ":extern",
pos: U.pos()
});
Context.getLocalClass().get().isExtern = true;

Comment on lines -124 to +123
Copy link
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.

fs2.push(field); // keep it for type inference
} else {
fs2.push(field);
Expand Down