Commit 7c0ec17
committed
jextract: LabeledTuple support!
We now support passing and returing labelled tuples like (a: Int, b:
Stirng) etc.
This is important for being able to quickly port over code from swift to
Java using the same libraries as we don't have to special case the
labelled tuples and move them over to positional use.
These ad hoc tuple types are printed per method.
They would conflict if you use the same shape twice in a method right
now... I'm not seeing much of that use so ignored it for now.
The new tuples inherit from TupleN so Java code can just use them as
positional when necessary, also for passing them along to other methods.
The change is large because I also cleaned up type printing, I think
printing full qualified type names is good here, better nor risk
clashes.1 parent 0bdba49 commit 7c0ec17
42 files changed
Lines changed: 432 additions & 125 deletions
File tree
- Samples/SwiftJavaExtractJNISampleApp/src/test/java/com/example/swift
- Sources
- JExtractSwiftLib
- FFM
- JNI
- JavaTypes
- SwiftJavaToolLib
- SwiftKitCore/src/main/java/org/swift/swiftkit/core/tuple
- Tests/JExtractSwiftTests
- FFM
- JNI
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
| 339 | + | |
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| |||
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
623 | | - | |
624 | | - | |
| 624 | + | |
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
| 693 | + | |
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
| |||
844 | 845 | | |
845 | 846 | | |
846 | 847 | | |
| 848 | + | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
| |||
856 | 858 | | |
857 | 859 | | |
858 | 860 | | |
| 861 | + | |
859 | 862 | | |
860 | 863 | | |
861 | 864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
527 | 531 | | |
528 | 532 | | |
529 | 533 | | |
| |||
566 | 570 | | |
567 | 571 | | |
568 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
569 | 584 | | |
570 | 585 | | |
571 | 586 | | |
| |||
Lines changed: 61 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| |||
628 | 629 | | |
629 | 630 | | |
630 | 631 | | |
631 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
| |||
885 | 888 | | |
886 | 889 | | |
887 | 890 | | |
| 891 | + | |
888 | 892 | | |
889 | 893 | | |
890 | 894 | | |
| |||
1017 | 1021 | | |
1018 | 1022 | | |
1019 | 1023 | | |
| 1024 | + | |
1020 | 1025 | | |
1021 | 1026 | | |
1022 | 1027 | | |
| |||
1149 | 1154 | | |
1150 | 1155 | | |
1151 | 1156 | | |
| 1157 | + | |
1152 | 1158 | | |
| 1159 | + | |
1153 | 1160 | | |
1154 | 1161 | | |
1155 | 1162 | | |
| |||
1167 | 1174 | | |
1168 | 1175 | | |
1169 | 1176 | | |
| 1177 | + | |
1170 | 1178 | | |
1171 | 1179 | | |
1172 | 1180 | | |
1173 | 1181 | | |
1174 | 1182 | | |
| 1183 | + | |
1175 | 1184 | | |
| 1185 | + | |
1176 | 1186 | | |
1177 | 1187 | | |
1178 | | - | |
1179 | | - | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1180 | 1199 | | |
1181 | | - | |
| 1200 | + | |
1182 | 1201 | | |
1183 | 1202 | | |
1184 | 1203 | | |
| |||
1188 | 1207 | | |
1189 | 1208 | | |
1190 | 1209 | | |
1191 | | - | |
1192 | | - | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
1193 | 1218 | | |
1194 | 1219 | | |
1195 | 1220 | | |
1196 | 1221 | | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1197 | 1236 | | |
1198 | 1237 | | |
1199 | 1238 | | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
| 1239 | + | |
1204 | 1240 | | |
1205 | 1241 | | |
1206 | 1242 | | |
| |||
1285 | 1321 | | |
1286 | 1322 | | |
1287 | 1323 | | |
| 1324 | + | |
1288 | 1325 | | |
1289 | 1326 | | |
1290 | 1327 | | |
| |||
1945 | 1982 | | |
1946 | 1983 | | |
1947 | 1984 | | |
1948 | | - | |
| 1985 | + | |
1949 | 1986 | | |
1950 | 1987 | | |
1951 | 1988 | | |
| |||
2025 | 2062 | | |
2026 | 2063 | | |
2027 | 2064 | | |
| 2065 | + | |
2028 | 2066 | | |
2029 | 2067 | | |
2030 | 2068 | | |
| |||
2060 | 2098 | | |
2061 | 2099 | | |
2062 | 2100 | | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
2063 | 2110 | | |
2064 | 2111 | | |
0 commit comments