import haxe.Constraints; class Main { static public function main() { create(C); } @:generic public static function createVoid>>(type:Class):Void { var string = new T("test"); var bool = new T(true); } } class C { public function new(a:Bool) { } }