Browse Source

[cs] fixed type parameters on enum constructors

Caue Waneck 12 years ago
parent
commit
c6e06ee02e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      gencs.ml

+ 5 - 1
gencs.ml

@@ -1627,7 +1627,11 @@ let configure gen =
   let tp_v = alloc_var "$type_param" t_dynamic in
   let mk_tp t pos = { eexpr = TLocal(tp_v); etype = t; epos = pos } in
   TypeParams.configure gen (fun ecall efield params elist ->
-    { ecall with eexpr = TCall(efield, (List.map (fun t -> mk_tp t ecall.epos ) params) @ elist) }
+    match efield.eexpr with
+    | TField(_, FEnum _) ->
+        { ecall with eexpr = TCall(efield, elist) }
+    | _ ->
+        { ecall with eexpr = TCall(efield, (List.map (fun t -> mk_tp t ecall.epos ) params) @ elist) }
   );
 
   HardNullableSynf.configure gen (HardNullableSynf.traverse gen