Explorar o código

[cs] fixed type parameters on enum constructors

Caue Waneck %!s(int64=12) %!d(string=hai) anos
pai
achega
c6e06ee02e
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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