Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // in Haxe I have this:
- // MyRect.hx
- #if swc @:extern #end
- public var width(get, set):Int;
- #if swc @:getter(width) #end
- private function get_width() { return Std.int(rect.width); }
- #if swc @:setter(width) #end
- private function set_width(value:Int):Int { throw new Error("Cannot modify this property!"); return 0; }
- // MyObject.hx
- private var _width:Int = 0;
- //#if swc @:getter(width) #end
- override private function get_width() { return _width; }
- //#if swc @:setter(width) #end
- override private function set_width(value:Int):Int
- {
- if (_width != value) {
- _width = value;
- update();
- }
- return value;
- }
- // It compiles fine as a SWC (no compiler errors). But when I try to use the lib in AS3 I get:
- // VerifyError: Error #1053: Illegal override of width in net.test.MyObject
- //
- // I've tried removing the override, or the getter/setter to no avail.
- //
- // Using extern/getter/setter has worked fine in other tests, but every time I used an override
- // I get the mentioned error and don't know how to work around it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement