Commit 7ecf961
committed
Emit thunk function for specific ABI on WebAssembly. (#6)
Changed to make thunk to convert thin-to-thick and non-throws-to-throws.
We needs it on WebAssembly host because WASM checks number of arguments strictly for indirect function call.
This patch allows you to run the Swift code below.
```swift
func f(_ a: (Int) -> Void) {
g(a)
}
func g(_ b: (Int) throws -> Void) {
try! b(1)
}
f { _ in }
```1 parent c7f55e0 commit 7ecf961
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2609 | 2609 | | |
2610 | 2610 | | |
2611 | 2611 | | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
2612 | 2620 | | |
2613 | 2621 | | |
2614 | 2622 | | |
| |||
2620 | 2628 | | |
2621 | 2629 | | |
2622 | 2630 | | |
2623 | | - | |
2624 | 2631 | | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
2625 | 2639 | | |
2626 | 2640 | | |
2627 | 2641 | | |
| |||
0 commit comments