COMMUNITY

hl.Ref<> can only be used with a local variable

I have a function which uses hl.Ref to declare v as a reference (vSliderInt is an interface to a native function):

public static function vSliderInt(v : hl.Ref<Int>) : Bool {return false;}

If I call it this way (this.vslider_value is a class member variable):

if (ImGui.vSliderInt(this.vslider_value)) {
	trace(this.vslider_value);
}

this.vslider_value is never modified, even if the native function does it.

Now, if I use a local variable instead, then it works properly (value is modified):

var value = this.vslider_value;
if (ImGui.vSliderInt(value)) {
	this.vslider_value = value;
	trace(value);
}

Is it normal behavior or is it a bug?