Why am I getting "the method required by property is missing"?

My class contains:-

    public static var focus(get, set) : IFocusDisplayObject;

and:-

    public static function get_focus() : IFocusDisplayObject
    {
        var manager : IFocusManager = getFocusManagerForStage(Starling.current.stage);
        if (manager != null)
        {
            return manager.focus;
        }
        return null;
    }

    public static function set_focus(value : IFocusDisplayObject) : IFocusDisplayObject
    {
        var manager : IFocusManager = getFocusManagerForStage(Starling.current.stage);
        if (manager == null)
        {
            throw new Error(FOCUS_MANAGER_NOT_ENABLED_ERROR);
        }
        manager.focus = value;
        return value;
    }

So why is the compiler complaining about it?

Using: openFl compiler and targeting HTML5.

Doesn’t the property need to be defined like this?

public static var focus(default, default) : IFocusDisplayObject;

I’m new to Haxe and trying to speed learn so I might be wrong but I just tried it in my own code and seems to work :smile:

EDIT: No, that is clearly wrong - ignore me!

This is the way it works it I think:

@:isVar public var somevar(get, set) :Int;

Ref: Rules for getter and setter - Haxe - The Cross-platform Toolkit