package unit.issues;
import unit.Test;

class Issue3033 extends Test
{
	public function test()
	{
		var g = guessReturnType;
		t(g != null); //if it compiles, it's working
  }

	public static function guessReturnType<T>()
	{
	var result = new Ref();
	function tt(r:Ref<T>):T return dynamicReturnType();
	if (Math.random() < 0.5) result.t = tt(new Ref<T>());
	return result;
	}

  public static function dynamicReturnType():Dynamic
  {
	return guessReturnType();
  }
}

private class Ref<T>
{
  public function new() {}
  public var t:T;
}
