@@ -196,7 +196,7 @@ using StringTools;
public static function createEnum<T>( e : Enum<T>, constr : String, ?params : Array<Dynamic> ) : T
{
- if (params == null || params[0] == null)
+ if (params == null || params.length == 0)
var ret = cs.internal.Runtime.slowGetField(e, constr, true);
if (Reflect.isFunction(ret))
@@ -0,0 +1,16 @@
+package unit.issues;
+
+class Issue4407 extends Test
+{
+ public function test()
+ {
+ // please don't optimize this too much
+ var ex:Dynamic = Example;
+ t( Type.enumEq( Type.createEnum(ex, "NullParam", untyped [null, "123"]), Example.NullParam(null,"123")) );
+ }
+}
+private enum Example
+ NullParam(first:Null<Int>, second:String);