openfl / lime

A foundational Haxe framework for cross-platform development
https://lime.openfl.org/
MIT License
759 stars 369 forks source link

Unknown identifier : FAnonymous #1373

Open hopewise opened 4 years ago

hopewise commented 4 years ago

Trying to build at Ubuntu, I get this error:

/usr/lib/haxe/lib/lime/7,6,3/src/lime/_internal/macros/AssetsMacro.hx:361: character 73 : Unknown identifier : FAnonymous
/usr/lib/haxe/lib/lime/7,6,3/src/lime/_internal/macros/AssetsMacro.hx:361: character 73 : For function argument 'name'
/usr/lib/haxe/lib/openfl/8,9,2/src/openfl/text/Font.hx:23: character 1 : Build failure
Command exited with non-zero status 1

and this error:

/usr/lib/haxe/lib/lime/7,6,3/src/lime/_internal/macros/EventMacro.hx:153: character 48 : Too many arguments
/usr/lib/haxe/lib/lime/7,6,3/src/lime/ui/Window.hx:82: characters 42-67 : Unknown<0> cannot be constructed
Command exited with non-zero status 1

using haxe 4.0.5

player-03 commented 2 years ago

I'm not getting any errors in Haxe 4.2.4, but I can confirm that there's a problem with Image embedding. I'm testing the DisplayingABitmap sample, with a few changes:

@:bitmap("Assets/openfl.png") class OpenFLGraphic extends openfl.display.BitmapData {}
@:image("Assets/openfl.png") class LimeGraphic extends lime.graphics.Image {}
//...
var bitmap = new Bitmap(new OpenFLGraphic(512, 200));
addChild(bitmap);

bitmap = new Bitmap(BitmapData.fromImage(new LimeGraphic()));
bitmap.y = 200;
addChild(bitmap);

The OpenFL one works fine except that its width and height are both 0 in HTML5. The Lime one is invisible in HTML5. Both work correctly on other targets. I didn't spot any major differences between the two AssetsMacro classes. No idea what's going on.