Issue 181: Use of untyped __global__ inside expression blocks
Status:  Fixed
Owner: ----
Closed:  Jun 2012
Reported by waneck, Jun 5, 2012
class Main 
{
	
	static inline function getByte(b:haxe.io.BytesData, pos:Int) return untyped __global__.__hxcpp_memory_get_byte(b,pos)

	static function eq(i:Int, i2:Int):Bool return i == i2
	
	static function main() 
	{
		var b = haxe.io.Bytes.alloc(2).getData();
		eq({ getByte(b,0); getByte(b,1); }, { getByte(b,0); getByte(b,1); });
	}
	
}

This will generate the following kind of code:

		struct _Function_1_1{
			inline static int Block( Dynamic &__global__,Array< unsigned char > &b){
				{
					HX_SOURCE_POS("src/Main.hx",22)
					::__hxcpp_memory_get_byte(b,(int)0);
					HX_SOURCE_POS("src/Main.hx",22)
					return ::__hxcpp_memory_get_byte(b,(int)1);
				}
				return null();
			}
		};

which expects a reference of the __global__ magic identifier
Jun 11, 2012
Project Member #1 gameh...@gmail.com
Fixed on svn - thanks for reporting.
Status: Fixed