Commit 0f06b26
authored
Add type validations for function imports (#8478)
Validates that the exported function is a subtype of the import
declaration. Part of #8261.
Example error:
```wast
(module $A
(func $f (export "f") (param i32) (result i32)
(local.get 0)
)
)
(register "A" $A)
(module $B
(func (import "A" "f") (result i32))
)
;; [trap Imported function A.f with type (func (param i32) (result i32)) isn't compatible with import declaration with type (modulo rec groups): (func (result i32))]
```1 parent bb290e7 commit 0f06b26
2 files changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
449 | | - | |
450 | 448 | | |
451 | 449 | | |
452 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3510 | 3510 | | |
3511 | 3511 | | |
3512 | 3512 | | |
3513 | | - | |
3514 | | - | |
3515 | | - | |
| 3513 | + | |
3516 | 3514 | | |
3517 | 3515 | | |
3518 | 3516 | | |
| |||
3528 | 3526 | | |
3529 | 3527 | | |
3530 | 3528 | | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
3531 | 3541 | | |
| 3542 | + | |
| 3543 | + | |
3532 | 3544 | | |
3533 | 3545 | | |
3534 | 3546 | | |
| |||
0 commit comments