robinp/hxpattern — Issue #1: Simply does not work properly with recent haxe.
Author: deltaluca
Created: 2011-11-01 11:25:19+00:00
State: open

haxe 2.09-r4011, haxe 2.09-r4061 both fail the unit tests:

Class: GSwitchTest ..FE...........
* GSwitchTest::testHaxeSwitch1()
ERR: GSwitchTest.hx:37(GSwitchTest.testHaxeSwitch1) - expected '1' but was '0'

Called from haxe/unit/TestCase.hx line 70
Called from GSwitchTest.hx line 37
Called from a C function
Called from haxe/unit/TestRunner.hx line 119

* GSwitchTest::testHaxeSwitch3()
ERR: exception thrown : Invalid field access : index

Called from GSwitchTest.hx line 57
Called from a C function
Called from haxe/unit/TestRunner.hx line 119

FAILED 15 tests, 2 failed, 13 success

----------

Also that not even something simple like: Hxpat.gswitch(e, tInt(0) = 0, _ = 1); for instance fails that we can't perform a normal haxe switch on tInt(0). And also things like tAdd(tInt(x),tInt(y)) = tInt(x+y) (in a gswitch) will complain that x,y are not defined (in both occurences) :P