@magnusopera/fscript 0.92.5 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
1
 
2
2
  import { Span, Position } from "./Span.js";
3
3
  import { EvalException, EvalError$ } from "./Error.js";
4
- import { tail as tail_1, head, isEmpty as isEmpty_1, iterate2, iterate as iterate_1, tryFind as tryFind_1, forAll2, length, forAll as forAll_1, contains, map, append, filter, ofArray, choose, empty as empty_1 } from "../fable_modules/fable-library-js.5.27.0/List.js";
4
+ import { tail as tail_1, head, iterate2, iterate as iterate_1, tryFind as tryFind_1, forAll2, forAll as forAll_1, length, isEmpty, contains, map, append, filter, ofArray, choose, empty as empty_1 } from "../fable_modules/fable-library-js.5.27.0/List.js";
5
5
  import { Value, HostManagedValue, ExtensionRegistration } from "./Value.js";
6
6
  import { concat, isNullOrWhiteSpace, join } from "../fable_modules/fable-library-js.5.27.0/String.js";
7
7
  import { typeDefs } from "./BuiltinTypes.js";
8
- import { FSharpMap__get_Item, iterate, map as map_1, FSharpMap__get_Count, FSharpMap__TryFind, tryFind, forAll, exists, FSharpMap__get_IsEmpty, FSharpMap__Add, containsKey, empty as empty_2 } from "../fable_modules/fable-library-js.5.27.0/Map.js";
9
- import { curry2, stringHash, disposeSafe, getEnumerator, comparePrimitives } from "../fable_modules/fable-library-js.5.27.0/Util.js";
10
- import { Types_ftvType, Types_typeToString, Type } from "./Types.js";
8
+ import { FSharpMap__get_Item, iterate, map as map_1, FSharpMap__get_Count, FSharpMap__TryFind, tryFind, forAll, exists, FSharpMap__Add, FSharpMap__get_IsEmpty, containsKey, empty as empty_2 } from "../fable_modules/fable-library-js.5.27.0/Map.js";
9
+ import { curry2, equals, stringHash, disposeSafe, getEnumerator, comparePrimitives } from "../fable_modules/fable-library-js.5.27.0/Util.js";
10
+ import { Types_ftvType, Types_typeToString, Types_expand, Type } from "./Types.js";
11
+ import { minElement, isEmpty as isEmpty_1, ofList, count } from "../fable_modules/fable-library-js.5.27.0/Set.js";
11
12
  import { exists as exists_1 } from "../fable_modules/fable-library-js.5.27.0/Seq.js";
12
13
  import { value as value_4, toArray } from "../fable_modules/fable-library-js.5.27.0/Option.js";
13
- import { minElement, isEmpty } from "../fable_modules/fable-library-js.5.27.0/Set.js";
14
14
  import { min } from "../fable_modules/fable-library-js.5.27.0/Double.js";
15
15
 
16
16
  const span = new Span(new Position(undefined, 0, 0), new Position(undefined, 0, 0));
@@ -70,7 +70,25 @@ export function typeDefinitions(registration, scriptNames) {
70
70
  }) ? true : containsKey(descriptor.Name, definitions)) {
71
71
  fail(concat("Host type name conflict: \'", descriptor.Name, "\'"));
72
72
  }
73
- definitions = FSharpMap__Add(definitions, descriptor.Name, descriptor.HostManaged ? (new Type(/* THostManaged */ 17, [descriptor.Name, descriptor.Fields])) : (new Type(/* TRecord */ 8, [descriptor.Fields])));
73
+ const body = descriptor.HostManaged ? (new Type(/* THostManaged */ 19, [descriptor.Name, descriptor.Fields])) : (new Type(/* TRecord */ 8, [descriptor.Fields]));
74
+ let definition;
75
+ const matchValue = descriptor.TypeParameters;
76
+ if (isEmpty(matchValue)) {
77
+ definition = body;
78
+ }
79
+ else {
80
+ const parameters = matchValue;
81
+ if (!descriptor.HostManaged ? true : !FSharpMap__get_IsEmpty(descriptor.Fields)) {
82
+ fail(concat("Generic host type \'", descriptor.Name, "\' must be opaque and have no visible fields"));
83
+ }
84
+ if (count(ofList(parameters, {
85
+ Compare: (x_2, y_2) => (comparePrimitives(x_2, y_2) | 0),
86
+ })) !== length(parameters)) {
87
+ fail(concat("Generic host type \'", descriptor.Name, "\' repeats a type parameter"));
88
+ }
89
+ definition = (new Type(/* TGenericDefinition */ 14, [parameters, body]));
90
+ }
91
+ definitions = FSharpMap__Add(definitions, descriptor.Name, definition);
74
92
  }
75
93
  }
76
94
  finally {
@@ -84,15 +102,15 @@ export function typeDefinitions(registration, scriptNames) {
84
102
  fail("Host unions require a name and at least one case");
85
103
  }
86
104
  if (contains(descriptor_1.Name, reserved, {
87
- Equals: (x_2, y_2) => (x_2 === y_2),
88
- GetHashCode: (x_2) => (stringHash(x_2) | 0),
105
+ Equals: (x_3, y_3) => (x_3 === y_3),
106
+ GetHashCode: (x_3) => (stringHash(x_3) | 0),
89
107
  }) ? true : containsKey(descriptor_1.Name, definitions)) {
90
108
  fail(concat("Host type name conflict: \'", descriptor_1.Name, "\'"));
91
109
  }
92
110
  if (exists((name, _arg) => isNullOrWhiteSpace(name), descriptor_1.Cases)) {
93
111
  fail(concat("Host union \'", descriptor_1.Name, "\' has an empty case name"));
94
112
  }
95
- definitions = FSharpMap__Add(definitions, descriptor_1.Name, new Type(/* TUnion */ 13, [descriptor_1.Name, descriptor_1.Cases]));
113
+ definitions = FSharpMap__Add(definitions, descriptor_1.Name, new Type(/* TUnion */ 15, [descriptor_1.Name, descriptor_1.Cases]));
96
114
  }
97
115
  }
98
116
  finally {
@@ -105,15 +123,26 @@ export function matches(definitions_mut, expected_mut, value_mut) {
105
123
  matches:
106
124
  while (true) {
107
125
  const definitions = definitions_mut, expected = expected_mut, value = value_mut;
126
+ let matchValue_1, parameters;
108
127
  const fieldsMatch = (fields, values) => forAll((name, fieldType) => exists_1((value_1) => matches(definitions, fieldType, value_1), toArray(tryFind(name, values))), fields);
109
- let matchResult, name_1, fields_1, host, name_2, fields_2, values_1, constructible, fields_3, host_1, fields_4, values_2, t_1, values_3, ts, values_4, t_2, v, t_3, values_5, actualName, caseName, cases, name_3, payload;
128
+ let matchResult, typ, fields_1, host, name_1, fields_2, values_1, constructible, fields_3, host_1, fields_4, values_2, t, values_3, ts, values_4, t_1, v, t_2, values_5, actualName, caseName, cases, name_2, payload;
110
129
  switch (expected.tag) {
111
- case 17: {
130
+ case 12: {
131
+ matchResult = 0;
132
+ typ = expected;
133
+ break;
134
+ }
135
+ case 13: {
136
+ matchResult = 0;
137
+ typ = expected;
138
+ break;
139
+ }
140
+ case 19: {
112
141
  if (value.tag === 16) {
113
142
  matchResult = 1;
114
143
  fields_1 = expected.fields[1];
115
144
  host = value.fields[0];
116
- name_2 = expected.fields[0];
145
+ name_1 = expected.fields[0];
117
146
  }
118
147
  else {
119
148
  matchResult = 16;
@@ -131,7 +160,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
131
160
  }
132
161
  break;
133
162
  }
134
- case 18: {
163
+ case 20: {
135
164
  switch (value.tag) {
136
165
  case 16: {
137
166
  matchResult = 3;
@@ -199,7 +228,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
199
228
  case 5: {
200
229
  if (value.tag === 5) {
201
230
  matchResult = 6;
202
- t_1 = expected.fields[0];
231
+ t = expected.fields[0];
203
232
  values_3 = value.fields[0];
204
233
  }
205
234
  else {
@@ -222,7 +251,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
222
251
  if (value.tag === 9) {
223
252
  if (value.fields[0] != null) {
224
253
  matchResult = 9;
225
- t_2 = expected.fields[0];
254
+ t_1 = expected.fields[0];
226
255
  v = value.fields[0];
227
256
  }
228
257
  else {
@@ -237,7 +266,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
237
266
  case 9: {
238
267
  if (value.tag === 8) {
239
268
  matchResult = 10;
240
- t_3 = expected.fields[1];
269
+ t_2 = expected.fields[1];
241
270
  values_5 = value.fields[0];
242
271
  }
243
272
  else {
@@ -245,13 +274,13 @@ export function matches(definitions_mut, expected_mut, value_mut) {
245
274
  }
246
275
  break;
247
276
  }
248
- case 13: {
277
+ case 15: {
249
278
  if (value.tag === 10) {
250
279
  matchResult = 11;
251
280
  actualName = value.fields[0];
252
281
  caseName = value.fields[1];
253
282
  cases = expected.fields[1];
254
- name_3 = expected.fields[0];
283
+ name_2 = expected.fields[0];
255
284
  payload = value.fields[2];
256
285
  }
257
286
  else {
@@ -268,7 +297,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
268
297
  }
269
298
  break;
270
299
  }
271
- case 14: {
300
+ case 16: {
272
301
  if (value.tag === 12) {
273
302
  matchResult = 12;
274
303
  }
@@ -290,11 +319,11 @@ export function matches(definitions_mut, expected_mut, value_mut) {
290
319
  }
291
320
  break;
292
321
  }
293
- case 15: {
322
+ case 17: {
294
323
  matchResult = 14;
295
324
  break;
296
325
  }
297
- case 16: {
326
+ case 18: {
298
327
  switch (value.tag) {
299
328
  case 1:
300
329
  case 2: {
@@ -306,16 +335,24 @@ export function matches(definitions_mut, expected_mut, value_mut) {
306
335
  }
307
336
  break;
308
337
  }
309
- default: {
310
- matchResult = 0;
311
- name_1 = expected.fields[0];
312
- }
338
+ default:
339
+ matchResult = 16;
313
340
  }
314
341
  switch (matchResult) {
315
- case 0:
316
- return exists_1((t) => matches(definitions, t, value), toArray(FSharpMap__TryFind(definitions, name_1)));
342
+ case 0: {
343
+ const expanded = Types_expand(definitions, typ);
344
+ if (!equals(expanded, typ)) {
345
+ definitions_mut = definitions;
346
+ expected_mut = expanded;
347
+ value_mut = value;
348
+ continue matches;
349
+ }
350
+ else {
351
+ return false;
352
+ }
353
+ }
317
354
  case 1:
318
- if (((host.Descriptor.HostManaged && (host.Descriptor.Name === name_2)) && host.Descriptor.Fields.Equals(fields_1)) && (FSharpMap__get_Count(host.Fields) === FSharpMap__get_Count(fields_1))) {
355
+ if ((((host.Descriptor.HostManaged && (host.Descriptor.Name === name_1)) && host.Descriptor.Fields.Equals(fields_1)) && ((matchValue_1 = FSharpMap__TryFind(definitions, name_1), (matchValue_1 != null) ? ((matchValue_1.tag === 14) ? ((parameters = matchValue_1.fields[0], equals(host.Descriptor.TypeParameters, parameters))) : isEmpty(host.Descriptor.TypeParameters)) : isEmpty(host.Descriptor.TypeParameters)))) && (FSharpMap__get_Count(host.Fields) === FSharpMap__get_Count(fields_1))) {
319
356
  return fieldsMatch(fields_1, host.Fields);
320
357
  }
321
358
  else {
@@ -335,7 +372,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
335
372
  case 5:
336
373
  return true;
337
374
  case 6:
338
- return forAll_1((value_2) => matches(definitions, t_1, value_2), values_3);
375
+ return forAll_1((value_2) => matches(definitions, t, value_2), values_3);
339
376
  case 7:
340
377
  if (length(ts) === length(values_4)) {
341
378
  return forAll2((expected_1, value_3) => matches(definitions, expected_1, value_3), ts, values_4);
@@ -347,21 +384,21 @@ export function matches(definitions_mut, expected_mut, value_mut) {
347
384
  return true;
348
385
  case 9: {
349
386
  definitions_mut = definitions;
350
- expected_mut = t_2;
387
+ expected_mut = t_1;
351
388
  value_mut = v;
352
389
  continue matches;
353
390
  }
354
391
  case 10:
355
- return forAll((_arg, v_1) => matches(definitions, t_3, v_1), values_5);
392
+ return forAll((_arg, v_1) => matches(definitions, t_2, v_1), values_5);
356
393
  case 11:
357
- if (name_3 === actualName) {
358
- const matchValue_1 = FSharpMap__TryFind(cases, caseName);
359
- let matchResult_1, t_4, v_2;
360
- if (matchValue_1 != null) {
361
- if (value_4(matchValue_1) != null) {
394
+ if (name_2 === actualName) {
395
+ const matchValue_2 = FSharpMap__TryFind(cases, caseName);
396
+ let matchResult_1, t_3, v_2;
397
+ if (matchValue_2 != null) {
398
+ if (value_4(matchValue_2) != null) {
362
399
  if (payload != null) {
363
400
  matchResult_1 = 1;
364
- t_4 = value_4(matchValue_1);
401
+ t_3 = value_4(matchValue_2);
365
402
  v_2 = payload;
366
403
  }
367
404
  else {
@@ -383,7 +420,7 @@ export function matches(definitions_mut, expected_mut, value_mut) {
383
420
  return true;
384
421
  case 1: {
385
422
  definitions_mut = definitions;
386
- expected_mut = t_4;
423
+ expected_mut = t_3;
387
424
  value_mut = v_2;
388
425
  continue matches;
389
426
  }
@@ -416,6 +453,7 @@ export function validate(definitions, expected, value) {
416
453
  }
417
454
 
418
455
  export function create(registration, typeName, fields, payload) {
456
+ let matchValue_1;
419
457
  const definitions = typeDefinitions(registration, empty_1());
420
458
  const matchValue = tryFind_1((d) => {
421
459
  if (d.Name === typeName) {
@@ -429,8 +467,9 @@ export function create(registration, typeName, fields, payload) {
429
467
  return fail(concat("Unknown host-managed type \'", typeName, "\'"));
430
468
  }
431
469
  else {
432
- const value = new Value(/* VHostManaged */ 16, [new HostManagedValue(matchValue, fields, payload)]);
433
- validate(definitions, new Type(/* TNamed */ 12, [typeName]), value);
470
+ const descriptor = matchValue;
471
+ const value = new Value(/* VHostManaged */ 16, [new HostManagedValue(descriptor, fields, payload)]);
472
+ validate(definitions, (matchValue_1 = descriptor.TypeParameters, isEmpty(matchValue_1) ? (new Type(/* TNamed */ 12, [typeName])) : (new Type(/* TApplied */ 13, [typeName, map((Item) => (new Type(/* TVar */ 17, [Item])), matchValue_1)]))), value);
434
473
  return value;
435
474
  }
436
475
  }
@@ -466,11 +505,11 @@ export function prepareCall(definitions, signature, arguments$) {
466
505
  Compare: (x, y) => (comparePrimitives(x, y) | 0),
467
506
  });
468
507
  const variables = Types_ftvType(signature);
469
- let nextVariable = isEmpty(variables) ? -1 : min(-1, minElement(variables) - 1);
508
+ let nextVariable = isEmpty_1(variables) ? -1 : min(-1, minElement(variables) - 1);
470
509
  const fresh = () => {
471
510
  const id = nextVariable | 0;
472
511
  nextVariable = ((nextVariable - 1) | 0);
473
- return new Type(/* TVar */ 15, [id]);
512
+ return new Type(/* TVar */ 17, [id]);
474
513
  };
475
514
  const valueType = (value) => {
476
515
  switch (value.tag) {
@@ -484,7 +523,7 @@ export function prepareCall(definitions, signature, arguments$) {
484
523
  return Type.TString;
485
524
  case 16: {
486
525
  const host = value.fields[0];
487
- return new Type(/* THostManaged */ 17, [host.Descriptor.Name, host.Descriptor.Fields]);
526
+ return new Type(/* THostManaged */ 19, [host.Descriptor.Name, host.Descriptor.Fields]);
488
527
  }
489
528
  case 5:
490
529
  return new Type(/* TList */ 5, [fresh()]);
@@ -496,8 +535,29 @@ export function prepareCall(definitions, signature, arguments$) {
496
535
  return new Type(/* TMap */ 9, [fresh(), fresh()]);
497
536
  case 9:
498
537
  return new Type(/* TOption */ 10, [fresh()]);
499
- case 10:
500
- return new Type(/* TNamed */ 12, [value.fields[0]]);
538
+ case 10: {
539
+ const name_1 = value.fields[0];
540
+ const matchValue = FSharpMap__TryFind(definitions, name_1);
541
+ let matchResult, parameters;
542
+ if (matchValue != null) {
543
+ if (matchValue.tag === 14) {
544
+ matchResult = 0;
545
+ parameters = matchValue.fields[0];
546
+ }
547
+ else {
548
+ matchResult = 1;
549
+ }
550
+ }
551
+ else {
552
+ matchResult = 1;
553
+ }
554
+ switch (matchResult) {
555
+ case 0:
556
+ return new Type(/* TApplied */ 13, [name_1, map((_arg_3) => fresh(), parameters)]);
557
+ default:
558
+ return new Type(/* TNamed */ 12, [name_1]);
559
+ }
560
+ }
501
561
  case 12:
502
562
  return Type.TTypeToken;
503
563
  case 13:
@@ -514,39 +574,40 @@ export function prepareCall(definitions, signature, arguments$) {
514
574
  observe:
515
575
  while (true) {
516
576
  const expected = expected_mut, value_1 = value_1_mut;
517
- let registered;
577
+ let registered, registered_1;
518
578
  const observeFields = (required, actual) => {
519
579
  iterate((name_2, t) => {
520
580
  observe(t, FSharpMap__get_Item(actual, name_2));
521
581
  }, required);
522
582
  };
523
- let matchResult, id_1;
583
+ let matchResult_1, id_1;
524
584
  switch (expected.tag) {
525
- case 15: {
526
- matchResult = 0;
527
- id_1 = expected.fields[0];
585
+ case 12:
586
+ case 13: {
587
+ matchResult_1 = 1;
528
588
  break;
529
589
  }
530
- case 16: {
531
- matchResult = 0;
532
- id_1 = expected.fields[0];
590
+ case 20: {
591
+ matchResult_1 = 2;
533
592
  break;
534
593
  }
535
- case 12: {
536
- matchResult = 1;
594
+ case 17: {
595
+ matchResult_1 = 0;
596
+ id_1 = expected.fields[0];
537
597
  break;
538
598
  }
539
599
  case 18: {
540
- matchResult = 2;
600
+ matchResult_1 = 0;
601
+ id_1 = expected.fields[0];
541
602
  break;
542
603
  }
543
604
  default:
544
- matchResult = 3;
605
+ matchResult_1 = 3;
545
606
  }
546
- switch (matchResult) {
607
+ switch (matchResult_1) {
547
608
  case 0: {
548
- const matchValue = FSharpMap__TryFind(bindings, id_1);
549
- if (matchValue == null) {
609
+ const matchValue_1 = FSharpMap__TryFind(bindings, id_1);
610
+ if (matchValue_1 == null) {
550
611
  validate(definitions, expected, value_1);
551
612
  const bound_1 = valueType(value_1);
552
613
  bindings = FSharpMap__Add(bindings, id_1, bound_1);
@@ -555,19 +616,19 @@ export function prepareCall(definitions, signature, arguments$) {
555
616
  continue observe;
556
617
  }
557
618
  else {
558
- expected_mut = matchValue;
619
+ expected_mut = matchValue_1;
559
620
  value_1_mut = value_1;
560
621
  continue observe;
561
622
  }
562
623
  break;
563
624
  }
564
625
  case 1: {
565
- const matchValue_1 = tryFind(expected.fields[0], definitions);
566
- if (matchValue_1 == null) {
626
+ const expanded = Types_expand(definitions, expected);
627
+ if (equals(expanded, expected)) {
567
628
  validate(definitions, expected, value_1);
568
629
  }
569
630
  else {
570
- expected_mut = matchValue_1;
631
+ expected_mut = expanded;
571
632
  value_1_mut = value_1;
572
633
  continue observe;
573
634
  }
@@ -586,27 +647,27 @@ export function prepareCall(definitions, signature, arguments$) {
586
647
  else {
587
648
  observe(matchValue_2, value_1);
588
649
  }
589
- let matchResult_1, host_2, actual_1;
650
+ let matchResult_2, host_2, actual_1;
590
651
  switch (value_1.tag) {
591
652
  case 16: {
592
653
  if (!expected.fields[2]) {
593
- matchResult_1 = 0;
654
+ matchResult_2 = 0;
594
655
  host_2 = value_1.fields[0];
595
656
  }
596
657
  else {
597
- matchResult_1 = 2;
658
+ matchResult_2 = 2;
598
659
  }
599
660
  break;
600
661
  }
601
662
  case 7: {
602
- matchResult_1 = 1;
663
+ matchResult_2 = 1;
603
664
  actual_1 = value_1.fields[0];
604
665
  break;
605
666
  }
606
667
  default:
607
- matchResult_1 = 2;
668
+ matchResult_2 = 2;
608
669
  }
609
- switch (matchResult_1) {
670
+ switch (matchResult_2) {
610
671
  case 0: {
611
672
  observeFields(fields_1, host_2.Fields);
612
673
  break;
@@ -624,125 +685,142 @@ export function prepareCall(definitions, signature, arguments$) {
624
685
  }
625
686
  case 3: {
626
687
  validate(definitions, expected, value_1);
627
- let matchResult_2, fields_2, host_3, name_4, actual_2, fields_3, t_1, values_1, ts, values_2, inner, t_2, keyType, t_3, values_3, cases, inner_1, name_5;
688
+ let matchResult_3, fields_2, host_3, name_3, actual_2, fields_3, t_1, values_1, ts, values_2, inner, t_2, keyType, t_3, values_3, cases, inner_1, name_4;
628
689
  switch (expected.tag) {
629
- case 17: {
690
+ case 19: {
630
691
  if (value_1.tag === 16) {
631
- matchResult_2 = 0;
692
+ matchResult_3 = 0;
632
693
  fields_2 = expected.fields[1];
633
694
  host_3 = value_1.fields[0];
634
- name_4 = expected.fields[0];
695
+ name_3 = expected.fields[0];
635
696
  }
636
697
  else {
637
- matchResult_2 = 7;
698
+ matchResult_3 = 7;
638
699
  }
639
700
  break;
640
701
  }
641
702
  case 8: {
642
703
  if (value_1.tag === 7) {
643
- matchResult_2 = 1;
704
+ matchResult_3 = 1;
644
705
  actual_2 = value_1.fields[0];
645
706
  fields_3 = expected.fields[0];
646
707
  }
647
708
  else {
648
- matchResult_2 = 7;
709
+ matchResult_3 = 7;
649
710
  }
650
711
  break;
651
712
  }
652
713
  case 5: {
653
714
  if (value_1.tag === 5) {
654
- matchResult_2 = 2;
715
+ matchResult_3 = 2;
655
716
  t_1 = expected.fields[0];
656
717
  values_1 = value_1.fields[0];
657
718
  }
658
719
  else {
659
- matchResult_2 = 7;
720
+ matchResult_3 = 7;
660
721
  }
661
722
  break;
662
723
  }
663
724
  case 7: {
664
725
  if (value_1.tag === 6) {
665
- matchResult_2 = 3;
726
+ matchResult_3 = 3;
666
727
  ts = expected.fields[0];
667
728
  values_2 = value_1.fields[0];
668
729
  }
669
730
  else {
670
- matchResult_2 = 7;
731
+ matchResult_3 = 7;
671
732
  }
672
733
  break;
673
734
  }
674
735
  case 10: {
675
736
  if (value_1.tag === 9) {
676
737
  if (value_1.fields[0] != null) {
677
- matchResult_2 = 4;
738
+ matchResult_3 = 4;
678
739
  inner = value_1.fields[0];
679
740
  t_2 = expected.fields[0];
680
741
  }
681
742
  else {
682
- matchResult_2 = 7;
743
+ matchResult_3 = 7;
683
744
  }
684
745
  }
685
746
  else {
686
- matchResult_2 = 7;
747
+ matchResult_3 = 7;
687
748
  }
688
749
  break;
689
750
  }
690
751
  case 9: {
691
752
  if (value_1.tag === 8) {
692
- matchResult_2 = 5;
753
+ matchResult_3 = 5;
693
754
  keyType = expected.fields[0];
694
755
  t_3 = expected.fields[1];
695
756
  values_3 = value_1.fields[0];
696
757
  }
697
758
  else {
698
- matchResult_2 = 7;
759
+ matchResult_3 = 7;
699
760
  }
700
761
  break;
701
762
  }
702
- case 13: {
763
+ case 15: {
703
764
  if (value_1.tag === 10) {
704
765
  if (value_1.fields[2] != null) {
705
- matchResult_2 = 6;
766
+ matchResult_3 = 6;
706
767
  cases = expected.fields[1];
707
768
  inner_1 = value_1.fields[2];
708
- name_5 = value_1.fields[1];
769
+ name_4 = value_1.fields[1];
709
770
  }
710
771
  else {
711
- matchResult_2 = 7;
772
+ matchResult_3 = 7;
712
773
  }
713
774
  }
714
775
  else {
715
- matchResult_2 = 7;
776
+ matchResult_3 = 7;
716
777
  }
717
778
  break;
718
779
  }
719
780
  default:
720
- matchResult_2 = 7;
781
+ matchResult_3 = 7;
721
782
  }
722
- switch (matchResult_2) {
783
+ switch (matchResult_3) {
723
784
  case 0: {
724
- const matchValue_4 = tryFind(name_4, definitions);
725
- let matchResult_3, registered_1;
785
+ const matchValue_4 = tryFind(name_3, definitions);
786
+ let matchResult_4, registered_2;
726
787
  if (matchValue_4 != null) {
727
- if (matchValue_4.tag === 17) {
728
- if ((registered = matchValue_4.fields[1], registered.Equals(fields_2))) {
729
- matchResult_3 = 0;
730
- registered_1 = matchValue_4.fields[1];
788
+ switch (matchValue_4.tag) {
789
+ case 19: {
790
+ if ((registered = matchValue_4.fields[1], registered.Equals(fields_2))) {
791
+ matchResult_4 = 0;
792
+ registered_2 = matchValue_4.fields[1];
793
+ }
794
+ else {
795
+ matchResult_4 = 1;
796
+ }
797
+ break;
731
798
  }
732
- else {
733
- matchResult_3 = 1;
799
+ case 14: {
800
+ if (matchValue_4.fields[1].tag === 19) {
801
+ if ((registered_1 = matchValue_4.fields[1].fields[1], registered_1.Equals(fields_2))) {
802
+ matchResult_4 = 0;
803
+ registered_2 = matchValue_4.fields[1].fields[1];
804
+ }
805
+ else {
806
+ matchResult_4 = 1;
807
+ }
808
+ }
809
+ else {
810
+ matchResult_4 = 1;
811
+ }
812
+ break;
734
813
  }
735
- }
736
- else {
737
- matchResult_3 = 1;
814
+ default:
815
+ matchResult_4 = 1;
738
816
  }
739
817
  }
740
818
  else {
741
- matchResult_3 = 1;
819
+ matchResult_4 = 1;
742
820
  }
743
- switch (matchResult_3) {
821
+ switch (matchResult_4) {
744
822
  case 1: {
745
- fail(concat("Unregistered host-managed type \'", name_4, "\'"));
823
+ fail(concat("Unregistered host-managed type \'", name_3, "\'"));
746
824
  break;
747
825
  }
748
826
  }
@@ -776,7 +854,7 @@ export function prepareCall(definitions, signature, arguments$) {
776
854
  break;
777
855
  }
778
856
  case 6: {
779
- const option_1 = FSharpMap__get_Item(cases, name_5);
857
+ const option_1 = FSharpMap__get_Item(cases, name_4);
780
858
  if (option_1 != null) {
781
859
  expected_mut = option_1;
782
860
  value_1_mut = inner_1;
@@ -798,28 +876,28 @@ export function prepareCall(definitions, signature, arguments$) {
798
876
  check:
799
877
  while (true) {
800
878
  const remainingType = remainingType_mut, remainingArguments = remainingArguments_mut;
801
- let matchResult_4, argument, argumentType, resultType, tail, resultType_1;
879
+ let matchResult_5, argument, argumentType, resultType, tail, resultType_1;
802
880
  if (remainingType.tag === 11) {
803
- if (isEmpty_1(remainingArguments)) {
804
- matchResult_4 = 1;
881
+ if (isEmpty(remainingArguments)) {
882
+ matchResult_5 = 1;
805
883
  resultType_1 = remainingType;
806
884
  }
807
885
  else {
808
- matchResult_4 = 0;
886
+ matchResult_5 = 0;
809
887
  argument = head(remainingArguments);
810
888
  argumentType = remainingType.fields[0];
811
889
  resultType = remainingType.fields[1];
812
890
  tail = tail_1(remainingArguments);
813
891
  }
814
892
  }
815
- else if (isEmpty_1(remainingArguments)) {
816
- matchResult_4 = 1;
893
+ else if (isEmpty(remainingArguments)) {
894
+ matchResult_5 = 1;
817
895
  resultType_1 = remainingType;
818
896
  }
819
897
  else {
820
- matchResult_4 = 2;
898
+ matchResult_5 = 2;
821
899
  }
822
- switch (matchResult_4) {
900
+ switch (matchResult_5) {
823
901
  case 0: {
824
902
  observe(argumentType, argument);
825
903
  remainingType_mut = resultType;