@@ -23,7 +23,6 @@ let createExportTypeFromTypeDeclaration ~annotation ~loc ~nameAs ~opaque ~type_
23
23
24
24
let createCase (label , attributes ) ~poly =
25
25
{
26
- label;
27
26
labelJS =
28
27
(match
29
28
attributes |> Annotation. getAttributePayload Annotation. tagIsAs
@@ -230,7 +229,6 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
230
229
}
231
230
|> returnTypeDeclaration
232
231
| VariantDeclarationFromTypes constructorDeclarations , None ->
233
- let recordGen = Runtime. recordGen () in
234
232
let variants =
235
233
constructorDeclarations
236
234
|> List. map (fun constructorDeclaration ->
@@ -262,46 +260,25 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
262
260
|> Translation. translateDependencies ~config ~output FileRelative
263
261
~resolver
264
262
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))
275
264
in
276
265
let variantsNoPayload, variantsWithPayload =
277
- variants |> List. partition (fun (_ , _ , argTypes , _ , _ ) -> argTypes = [] )
266
+ variants |> List. partition (fun (_ , _ , argTypes , _ ) -> argTypes = [] )
278
267
in
279
268
let noPayloads =
280
269
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 )
287
272
in
288
273
let payloads =
289
274
variantsWithPayload
290
- |> List. map
291
- (fun (name , attributes , argTypes , _importTypes , recordValue ) ->
275
+ |> List. map (fun (name , attributes , argTypes , _importTypes ) ->
292
276
let type_ =
293
277
match argTypes with
294
278
| [type_] -> type_
295
279
| _ -> Tuple argTypes
296
280
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_})
305
282
in
306
283
let variantTyp =
307
284
createVariant ~inherits: [] ~no Payloads ~payloads ~polymorphic: false
@@ -325,7 +302,7 @@ let traslateDeclarationKind ~config ~loc ~outputFileRelative ~resolver
325
302
in
326
303
let importTypes =
327
304
variants
328
- |> List. map (fun (_ , _ , _ , importTypes , _ ) -> importTypes)
305
+ |> List. map (fun (_ , _ , _ , importTypes ) -> importTypes)
329
306
|> List. concat
330
307
in
331
308
{CodeItem. exportFromTypeDeclaration; importTypes} |> returnTypeDeclaration
0 commit comments