enum abstracts

24 views
Skip to first unread message

David Mouton

unread,
Mar 20, 2014, 1:12:28 PM3/20/14
to haxe...@googlegroups.com
Hi,
i'm writing an abstract enum like this :

@:enum abstract LogLevel(Int) from Int to Int {

    var INFO = 0;
    var DEBUG = 1;
    var WARN = 2;
    var ERROR = 3;
}

But i can't compare too LogLevel
myLevel >= LogLevel.INFO

Any idea ?

Thanks

David Mouton

unread,
Mar 20, 2014, 1:30:13 PM3/20/14
to haxe...@googlegroups.com
I got it :
@:op(A <= B) public function pre(b:Int):Bool {
        return ( this <= b );
    }
Reply all
Reply to author
Forward
0 new messages