forked from evanw/kiwi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-schema-types.sk
742 lines (655 loc) · 19.3 KB
/
test-schema-types.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
namespace test {
type Enum : string {
@alwaysinline
def toString string { return self as string }
}
namespace Enum {
@alwaysinline
def A Enum { return "A" as Enum }
@alwaysinline
def B Enum { return "B" as Enum }
}
@import
class EnumStruct {
var x Enum
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
var y List<Enum>
@alwaysinline
def has_y bool { return self.y != dynamic.void(0) }
}
namespace EnumStruct {
@alwaysinline
def new EnumStruct { return {} as dynamic }
}
@import
class BoolStruct {
var x bool
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace BoolStruct {
@alwaysinline
def new BoolStruct { return {} as dynamic }
}
@import
class ByteStruct {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace ByteStruct {
@alwaysinline
def new ByteStruct { return {} as dynamic }
}
@import
class IntStruct {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace IntStruct {
@alwaysinline
def new IntStruct { return {} as dynamic }
}
@import
class UintStruct {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace UintStruct {
@alwaysinline
def new UintStruct { return {} as dynamic }
}
@import
class Int64Struct {
var x BigInt
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Int64Struct {
@alwaysinline
def new Int64Struct { return {} as dynamic }
}
@import
class Uint64Struct {
var x BigInt
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Uint64Struct {
@alwaysinline
def new Uint64Struct { return {} as dynamic }
}
@import
class FloatStruct {
var x double
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace FloatStruct {
@alwaysinline
def new FloatStruct { return {} as dynamic }
}
@import
class StringStruct {
var x string
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace StringStruct {
@alwaysinline
def new StringStruct { return {} as dynamic }
}
@import
class CompoundStruct {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
var y int
@alwaysinline
def has_y bool { return self.y != dynamic.void(0) }
}
namespace CompoundStruct {
@alwaysinline
def new CompoundStruct { return {} as dynamic }
}
@import
class NestedStruct {
var a int
@alwaysinline
def has_a bool { return self.a != dynamic.void(0) }
var b CompoundStruct
@alwaysinline
def has_b bool { return self.b != dynamic.void(0) }
var c int
@alwaysinline
def has_c bool { return self.c != dynamic.void(0) }
}
namespace NestedStruct {
@alwaysinline
def new NestedStruct { return {} as dynamic }
}
@import
class BoolMessage {
var x bool
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace BoolMessage {
@alwaysinline
def new BoolMessage { return {} as dynamic }
}
@import
class ByteMessage {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace ByteMessage {
@alwaysinline
def new ByteMessage { return {} as dynamic }
}
@import
class IntMessage {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace IntMessage {
@alwaysinline
def new IntMessage { return {} as dynamic }
}
@import
class UintMessage {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace UintMessage {
@alwaysinline
def new UintMessage { return {} as dynamic }
}
@import
class Int64Message {
var x BigInt
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Int64Message {
@alwaysinline
def new Int64Message { return {} as dynamic }
}
@import
class Uint64Message {
var x BigInt
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Uint64Message {
@alwaysinline
def new Uint64Message { return {} as dynamic }
}
@import
class FloatMessage {
var x double
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace FloatMessage {
@alwaysinline
def new FloatMessage { return {} as dynamic }
}
@import
class StringMessage {
var x string
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace StringMessage {
@alwaysinline
def new StringMessage { return {} as dynamic }
}
@import
class CompoundMessage {
var x int
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
var y int
@alwaysinline
def has_y bool { return self.y != dynamic.void(0) }
}
namespace CompoundMessage {
@alwaysinline
def new CompoundMessage { return {} as dynamic }
}
@import
class NestedMessage {
var a int
@alwaysinline
def has_a bool { return self.a != dynamic.void(0) }
var b CompoundMessage
@alwaysinline
def has_b bool { return self.b != dynamic.void(0) }
var c int
@alwaysinline
def has_c bool { return self.c != dynamic.void(0) }
}
namespace NestedMessage {
@alwaysinline
def new NestedMessage { return {} as dynamic }
}
@import
class BoolArrayStruct {
var x List<bool>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace BoolArrayStruct {
@alwaysinline
def new BoolArrayStruct { return {} as dynamic }
}
@import
class ByteArrayStruct {
var x Uint8Array
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace ByteArrayStruct {
@alwaysinline
def new ByteArrayStruct { return {} as dynamic }
}
@import
class IntArrayStruct {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace IntArrayStruct {
@alwaysinline
def new IntArrayStruct { return {} as dynamic }
}
@import
class UintArrayStruct {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace UintArrayStruct {
@alwaysinline
def new UintArrayStruct { return {} as dynamic }
}
@import
class Int64ArrayStruct {
var x List<BigInt>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Int64ArrayStruct {
@alwaysinline
def new Int64ArrayStruct { return {} as dynamic }
}
@import
class Uint64ArrayStruct {
var x List<BigInt>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Uint64ArrayStruct {
@alwaysinline
def new Uint64ArrayStruct { return {} as dynamic }
}
@import
class FloatArrayStruct {
var x List<double>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace FloatArrayStruct {
@alwaysinline
def new FloatArrayStruct { return {} as dynamic }
}
@import
class StringArrayStruct {
var x List<string>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace StringArrayStruct {
@alwaysinline
def new StringArrayStruct { return {} as dynamic }
}
@import
class CompoundArrayStruct {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
var y List<int>
@alwaysinline
def has_y bool { return self.y != dynamic.void(0) }
}
namespace CompoundArrayStruct {
@alwaysinline
def new CompoundArrayStruct { return {} as dynamic }
}
@import
class BoolArrayMessage {
var x List<bool>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace BoolArrayMessage {
@alwaysinline
def new BoolArrayMessage { return {} as dynamic }
}
@import
class ByteArrayMessage {
var x Uint8Array
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace ByteArrayMessage {
@alwaysinline
def new ByteArrayMessage { return {} as dynamic }
}
@import
class IntArrayMessage {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace IntArrayMessage {
@alwaysinline
def new IntArrayMessage { return {} as dynamic }
}
@import
class UintArrayMessage {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace UintArrayMessage {
@alwaysinline
def new UintArrayMessage { return {} as dynamic }
}
@import
class Int64ArrayMessage {
var x List<BigInt>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Int64ArrayMessage {
@alwaysinline
def new Int64ArrayMessage { return {} as dynamic }
}
@import
class Uint64ArrayMessage {
var x List<BigInt>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace Uint64ArrayMessage {
@alwaysinline
def new Uint64ArrayMessage { return {} as dynamic }
}
@import
class FloatArrayMessage {
var x List<double>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace FloatArrayMessage {
@alwaysinline
def new FloatArrayMessage { return {} as dynamic }
}
@import
class StringArrayMessage {
var x List<string>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace StringArrayMessage {
@alwaysinline
def new StringArrayMessage { return {} as dynamic }
}
@import
class CompoundArrayMessage {
var x List<int>
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
var y List<int>
@alwaysinline
def has_y bool { return self.y != dynamic.void(0) }
}
namespace CompoundArrayMessage {
@alwaysinline
def new CompoundArrayMessage { return {} as dynamic }
}
@import
class RecursiveMessage {
var x RecursiveMessage
@alwaysinline
def has_x bool { return self.x != dynamic.void(0) }
}
namespace RecursiveMessage {
@alwaysinline
def new RecursiveMessage { return {} as dynamic }
}
@import
class NonDeprecatedMessage {
var a int
@alwaysinline
def has_a bool { return self.a != dynamic.void(0) }
var b int
@alwaysinline
def has_b bool { return self.b != dynamic.void(0) }
var c List<int>
@alwaysinline
def has_c bool { return self.c != dynamic.void(0) }
var d List<int>
@alwaysinline
def has_d bool { return self.d != dynamic.void(0) }
var e ByteStruct
@alwaysinline
def has_e bool { return self.e != dynamic.void(0) }
var f ByteStruct
@alwaysinline
def has_f bool { return self.f != dynamic.void(0) }
var g int
@alwaysinline
def has_g bool { return self.g != dynamic.void(0) }
}
namespace NonDeprecatedMessage {
@alwaysinline
def new NonDeprecatedMessage { return {} as dynamic }
}
@import
class DeprecatedMessage {
var a int
@alwaysinline
def has_a bool { return self.a != dynamic.void(0) }
var c List<int>
@alwaysinline
def has_c bool { return self.c != dynamic.void(0) }
var e ByteStruct
@alwaysinline
def has_e bool { return self.e != dynamic.void(0) }
var g int
@alwaysinline
def has_g bool { return self.g != dynamic.void(0) }
}
namespace DeprecatedMessage {
@alwaysinline
def new DeprecatedMessage { return {} as dynamic }
}
@import
class SortedStruct {
var a1 bool
@alwaysinline
def has_a1 bool { return self.a1 != dynamic.void(0) }
var b1 int
@alwaysinline
def has_b1 bool { return self.b1 != dynamic.void(0) }
var c1 int
@alwaysinline
def has_c1 bool { return self.c1 != dynamic.void(0) }
var d1 int
@alwaysinline
def has_d1 bool { return self.d1 != dynamic.void(0) }
var e1 double
@alwaysinline
def has_e1 bool { return self.e1 != dynamic.void(0) }
var f1 string
@alwaysinline
def has_f1 bool { return self.f1 != dynamic.void(0) }
var g1 BigInt
@alwaysinline
def has_g1 bool { return self.g1 != dynamic.void(0) }
var h1 BigInt
@alwaysinline
def has_h1 bool { return self.h1 != dynamic.void(0) }
var a2 bool
@alwaysinline
def has_a2 bool { return self.a2 != dynamic.void(0) }
var b2 int
@alwaysinline
def has_b2 bool { return self.b2 != dynamic.void(0) }
var c2 int
@alwaysinline
def has_c2 bool { return self.c2 != dynamic.void(0) }
var d2 int
@alwaysinline
def has_d2 bool { return self.d2 != dynamic.void(0) }
var e2 double
@alwaysinline
def has_e2 bool { return self.e2 != dynamic.void(0) }
var f2 string
@alwaysinline
def has_f2 bool { return self.f2 != dynamic.void(0) }
var g2 BigInt
@alwaysinline
def has_g2 bool { return self.g2 != dynamic.void(0) }
var h2 BigInt
@alwaysinline
def has_h2 bool { return self.h2 != dynamic.void(0) }
var a3 List<bool>
@alwaysinline
def has_a3 bool { return self.a3 != dynamic.void(0) }
var b3 Uint8Array
@alwaysinline
def has_b3 bool { return self.b3 != dynamic.void(0) }
var c3 List<int>
@alwaysinline
def has_c3 bool { return self.c3 != dynamic.void(0) }
var d3 List<int>
@alwaysinline
def has_d3 bool { return self.d3 != dynamic.void(0) }
var e3 List<double>
@alwaysinline
def has_e3 bool { return self.e3 != dynamic.void(0) }
var f3 List<string>
@alwaysinline
def has_f3 bool { return self.f3 != dynamic.void(0) }
var g3 List<BigInt>
@alwaysinline
def has_g3 bool { return self.g3 != dynamic.void(0) }
var h3 List<BigInt>
@alwaysinline
def has_h3 bool { return self.h3 != dynamic.void(0) }
}
namespace SortedStruct {
@alwaysinline
def new SortedStruct { return {} as dynamic }
}
@import
class Schema {
const Enum dynamic
def encodeEnumStruct(message EnumStruct) Uint8Array
def decodeEnumStruct(buffer Uint8Array) EnumStruct
def encodeBoolStruct(message BoolStruct) Uint8Array
def decodeBoolStruct(buffer Uint8Array) BoolStruct
def encodeByteStruct(message ByteStruct) Uint8Array
def decodeByteStruct(buffer Uint8Array) ByteStruct
def encodeIntStruct(message IntStruct) Uint8Array
def decodeIntStruct(buffer Uint8Array) IntStruct
def encodeUintStruct(message UintStruct) Uint8Array
def decodeUintStruct(buffer Uint8Array) UintStruct
def encodeInt64Struct(message Int64Struct) Uint8Array
def decodeInt64Struct(buffer Uint8Array) Int64Struct
def encodeUint64Struct(message Uint64Struct) Uint8Array
def decodeUint64Struct(buffer Uint8Array) Uint64Struct
def encodeFloatStruct(message FloatStruct) Uint8Array
def decodeFloatStruct(buffer Uint8Array) FloatStruct
def encodeStringStruct(message StringStruct) Uint8Array
def decodeStringStruct(buffer Uint8Array) StringStruct
def encodeCompoundStruct(message CompoundStruct) Uint8Array
def decodeCompoundStruct(buffer Uint8Array) CompoundStruct
def encodeNestedStruct(message NestedStruct) Uint8Array
def decodeNestedStruct(buffer Uint8Array) NestedStruct
def encodeBoolMessage(message BoolMessage) Uint8Array
def decodeBoolMessage(buffer Uint8Array) BoolMessage
def encodeByteMessage(message ByteMessage) Uint8Array
def decodeByteMessage(buffer Uint8Array) ByteMessage
def encodeIntMessage(message IntMessage) Uint8Array
def decodeIntMessage(buffer Uint8Array) IntMessage
def encodeUintMessage(message UintMessage) Uint8Array
def decodeUintMessage(buffer Uint8Array) UintMessage
def encodeInt64Message(message Int64Message) Uint8Array
def decodeInt64Message(buffer Uint8Array) Int64Message
def encodeUint64Message(message Uint64Message) Uint8Array
def decodeUint64Message(buffer Uint8Array) Uint64Message
def encodeFloatMessage(message FloatMessage) Uint8Array
def decodeFloatMessage(buffer Uint8Array) FloatMessage
def encodeStringMessage(message StringMessage) Uint8Array
def decodeStringMessage(buffer Uint8Array) StringMessage
def encodeCompoundMessage(message CompoundMessage) Uint8Array
def decodeCompoundMessage(buffer Uint8Array) CompoundMessage
def encodeNestedMessage(message NestedMessage) Uint8Array
def decodeNestedMessage(buffer Uint8Array) NestedMessage
def encodeBoolArrayStruct(message BoolArrayStruct) Uint8Array
def decodeBoolArrayStruct(buffer Uint8Array) BoolArrayStruct
def encodeByteArrayStruct(message ByteArrayStruct) Uint8Array
def decodeByteArrayStruct(buffer Uint8Array) ByteArrayStruct
def encodeIntArrayStruct(message IntArrayStruct) Uint8Array
def decodeIntArrayStruct(buffer Uint8Array) IntArrayStruct
def encodeUintArrayStruct(message UintArrayStruct) Uint8Array
def decodeUintArrayStruct(buffer Uint8Array) UintArrayStruct
def encodeInt64ArrayStruct(message Int64ArrayStruct) Uint8Array
def decodeInt64ArrayStruct(buffer Uint8Array) Int64ArrayStruct
def encodeUint64ArrayStruct(message Uint64ArrayStruct) Uint8Array
def decodeUint64ArrayStruct(buffer Uint8Array) Uint64ArrayStruct
def encodeFloatArrayStruct(message FloatArrayStruct) Uint8Array
def decodeFloatArrayStruct(buffer Uint8Array) FloatArrayStruct
def encodeStringArrayStruct(message StringArrayStruct) Uint8Array
def decodeStringArrayStruct(buffer Uint8Array) StringArrayStruct
def encodeCompoundArrayStruct(message CompoundArrayStruct) Uint8Array
def decodeCompoundArrayStruct(buffer Uint8Array) CompoundArrayStruct
def encodeBoolArrayMessage(message BoolArrayMessage) Uint8Array
def decodeBoolArrayMessage(buffer Uint8Array) BoolArrayMessage
def encodeByteArrayMessage(message ByteArrayMessage) Uint8Array
def decodeByteArrayMessage(buffer Uint8Array) ByteArrayMessage
def encodeIntArrayMessage(message IntArrayMessage) Uint8Array
def decodeIntArrayMessage(buffer Uint8Array) IntArrayMessage
def encodeUintArrayMessage(message UintArrayMessage) Uint8Array
def decodeUintArrayMessage(buffer Uint8Array) UintArrayMessage
def encodeInt64ArrayMessage(message Int64ArrayMessage) Uint8Array
def decodeInt64ArrayMessage(buffer Uint8Array) Int64ArrayMessage
def encodeUint64ArrayMessage(message Uint64ArrayMessage) Uint8Array
def decodeUint64ArrayMessage(buffer Uint8Array) Uint64ArrayMessage
def encodeFloatArrayMessage(message FloatArrayMessage) Uint8Array
def decodeFloatArrayMessage(buffer Uint8Array) FloatArrayMessage
def encodeStringArrayMessage(message StringArrayMessage) Uint8Array
def decodeStringArrayMessage(buffer Uint8Array) StringArrayMessage
def encodeCompoundArrayMessage(message CompoundArrayMessage) Uint8Array
def decodeCompoundArrayMessage(buffer Uint8Array) CompoundArrayMessage
def encodeRecursiveMessage(message RecursiveMessage) Uint8Array
def decodeRecursiveMessage(buffer Uint8Array) RecursiveMessage
def encodeNonDeprecatedMessage(message NonDeprecatedMessage) Uint8Array
def decodeNonDeprecatedMessage(buffer Uint8Array) NonDeprecatedMessage
def encodeDeprecatedMessage(message DeprecatedMessage) Uint8Array
def decodeDeprecatedMessage(buffer Uint8Array) DeprecatedMessage
def encodeSortedStruct(message SortedStruct) Uint8Array
def decodeSortedStruct(buffer Uint8Array) SortedStruct
}
}