MikeInnes/Charlotte.jl

Support calls to other functions

Opened this issue · 0 comments

Here's an example that doesn't work (using PR #8):

julia> @noinline anotherfun(x) = 3x
anotherfun (generic function with 1 method)

julia> mathfun(x) = 2x
mathfun (generic function with 1 method)

julia> mathfun2(x, y) = mathfun(x) + anotherfun(y)
mathfun2 (generic function with 1 method)

julia> m = wasm_module([mathfun => Tuple{Float64},
                        mathfun2 => Tuple{Float64, Float64}])
ERROR: Can't convert to wasm: $(Expr(:invoke, MethodInstance for anotherfun(::Float64), :(Main.anotherfun), get_local 1))
Stacktrace:

Calling other functions works if they happen to be inlined.