@@ -23,7 +23,6 @@ let createExportTypeFromTypeDeclaration ~annotation ~loc ~nameAs ~opaque ~type_
2323
2424let createCase (label , attributes ) ~poly =
2525 {
26- label;
2726 labelJS =
2827 (match
2928 attributes |> Annotation. getAttributePayload Annotation. tagIsAs
@@ -230,7 +229,6 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
230229 }
231230 |> returnTypeDeclaration
232231 | VariantDeclarationFromTypes constructorDeclarations , None ->
233- let recordGen = Runtime. recordGen () in
234232 let variants =
235233 constructorDeclarations
236234 |> List. map (fun constructorDeclaration ->
@@ -262,46 +260,25 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
262260 |> Translation. translateDependencies ~config ~output FileRelative
263261 ~resolver
264262 in
265- let recordValue =
266- recordGen
267- |> Runtime. newRecordValue
268- ~unboxed: (constructorArgs = Cstr_tuple [] )
269- in
270- ( name,
271- attributes,
272- argTypes,
273- importTypes,
274- recordValue |> Runtime. recordValueToString ))
263+ (name, attributes, argTypes, importTypes))
275264 in
276265 let variantsNoPayload, variantsWithPayload =
277- variants |> List. partition (fun (_ , _ , argTypes , _ , _ ) -> argTypes = [] )
266+ variants |> List. partition (fun (_ , _ , argTypes , _ ) -> argTypes = [] )
278267 in
279268 let noPayloads =
280269 variantsNoPayload
281- |> List. map
282- (fun (name , attributes , _argTypes , _importTypes , recordValue ) ->
283- {
284- ((name, attributes) |> createCase ~poly: false ) with
285- label = recordValue;
286- })
270+ |> List. map (fun (name , attributes , _argTypes , _importTypes ) ->
271+ (name, attributes) |> createCase ~poly: false )
287272 in
288273 let payloads =
289274 variantsWithPayload
290- |> List. map
291- (fun (name , attributes , argTypes , _importTypes , recordValue ) ->
275+ |> List. map (fun (name , attributes , argTypes , _importTypes ) ->
292276 let type_ =
293277 match argTypes with
294278 | [type_] -> type_
295279 | _ -> Tuple argTypes
296280 in
297- {
298- case =
299- {
300- ((name, attributes) |> createCase ~poly: false ) with
301- label = recordValue;
302- };
303- t = type_;
304- })
281+ {case = (name, attributes) |> createCase ~poly: false ; t = type_})
305282 in
306283 let variantTyp =
307284 createVariant ~inherits: [] ~no Payloads ~payloads ~polymorphic: false
@@ -325,7 +302,7 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
325302 in
326303 let importTypes =
327304 variants
328- |> List. map (fun (_ , _ , _ , importTypes , _ ) -> importTypes)
305+ |> List. map (fun (_ , _ , _ , importTypes ) -> importTypes)
329306 |> List. concat
330307 in
331308 {CodeItem. exportFromTypeDeclaration; importTypes} |> returnTypeDeclaration
0 commit comments