Issue 101: inline switch error in c++ type
Status:  Fixed
Owner: ----
Closed:  Mar 2011
Reported by lucadelt...@googlemail.com, Mar 14, 2011
What steps will reproduce the problem?
enum State {
	a;
	b;
}

class Main {
	
	static inline function doit(x:State) {
		while(switch(x) { case a: true; default: false; }) x = b;
	}
	static function main() {
		var x = a;
		doit(x);
	}
}

What is the expected output? What do you see instead?
should compile.

error in C++ code seems to be the inferred typing of the switch is incorrectly deduced as ::State rather than bool producing the block function:

struct _Function_2_1{
	inline static ::State Block( ::State &x1){
		HX_SOURCE_POS("src/Main.hx",9)
		{
::State _switch_2 = x1;
			switch((_switch_2)->GetIndex()){
				case 0: {
					HX_SOURCE_POS("src/Main.hx",16)
					return true;
				}
				;break;
				default: {
				HX_SOURCE_POS("src/Main.hx",16)
						return false;
			}
				}
		}
	}
};

which apart from it's return type being incorrectly given as ::State when it should be bool is otherwise correct.

What version of the product are you using? On what operating system?
2,07,0



Mar 17, 2011
Project Member #1 gameh...@gmail.com
This has been fixed by Nicolas
Status: Fixed