misprintt / mockatoo

A cross platform mocking framework for Haxe. Supports JavaScript, Flash, C++, PHP and Neko.
MIT License
49 stars 31 forks source link

mock function fails for interface properties with haxe 3.2 compiler #48

Open bjitivo opened 9 years ago

bjitivo commented 9 years ago

Here is a small example:

import mockatoo.Mockatoo.*;
using mockatoo.Mockatoo;

interface IFoo
{
    var someVar(get, never) : Int;
}

class Foo
{
    public static function main()
    {
        mock(IFoo);
    }
}

The above fails when compiled with the haxe 3.2 compiler:

bji/bug_demo$ haxe -cpp Foo-cpp -main Foo -lib mockatoo
/usr/lib/haxe/lib/mockatoo/3,2,1/mockatoo/internal/MockMethod.hx:334: characters 44-52 : Warning : Usage of this typedef is deprecated
Foo.hx:7: characters 4-34 : Duplicate class field declaration : get_someVar
bji/bug_demo$ 

It appears that there is some issue with how the 3.2 compiler AST represents interface properties that is not working correctly with the mockatoo macros.

IBwWG commented 8 years ago

I'm experiencing this too on haxe 3.2.1/Win7x64 with mockatoo 3.2.1, using the code you provided.