Skip to content

Commit

Permalink
Merge pull request #115 from oovm/patch-1
Browse files Browse the repository at this point in the history
call `ref.func` needs to be declared first
  • Loading branch information
rossberg authored May 26, 2024
2 parents ec004f6 + 54d35c6 commit 8475cff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions proposals/function-references/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Typed references have no canonical default value, because they cannot be null. T
The function `$hof` takes a function pointer as parameter, and is invoked by `$caller`, passing `$inc` as argument:
```wasm
(type $i32-i32 (func (param i32) (result i32)))
(elem declare funcref (ref.func $inc))
(func $hof (param $f (ref $i32-i32)) (result i32)
(i32.add (i32.const 10) (call_ref $i32-i32 (i32.const 42) (local.get $f)))
Expand Down

0 comments on commit 8475cff

Please sign in to comment.