Commit 3e4e71e
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 cb3c0eb commit 3e4e71e
1 file changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2644 | 2644 | | |
2645 | 2645 | | |
2646 | 2646 | | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
2647 | 2655 | | |
2648 | 2656 | | |
2649 | 2657 | | |
2650 | | - | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
2651 | 2664 | | |
2652 | | - | |
| 2665 | + | |
2653 | 2666 | | |
2654 | 2667 | | |
2655 | 2668 | | |
| |||
0 commit comments