Functional IRs sometimes throw unsupported or misplaced expression lambda or ERROR: MethodError: objects of type IRTools.Inner.Self are not callable when evaluated (similar to https://github.com/FluxML/IRTools.jl/issues/54)
Environment: IRTools v0.4.7, Julia Version 1.81, macOS Monterey, Apple M1 Pro
using IRTools: IR, @dynamo, functional, evalir, @code_ir
@dynamo function functional_dyna(a...)
ir = IR(a...)
ir === nothing && return
functional(ir)
end
foo() = false
bar() = if true false else false end
# Works: foo run normally
functional_dyna(foo) # false
# Works: foo run in two steps
ir = @code_ir functional_dyna foo()
evalir(ir, foo) # false
# Works: bar run normally
functional_dyna(bar) # false
# Errors: bar run in two steps
ir = @code_ir functional_dyna bar()
evalir(ir, bar) # ERROR: unsupported or misplaced expression lambda
Functional IRs sometimes throw
unsupported or misplaced expression lambda
orERROR: MethodError: objects of type IRTools.Inner.Self are not callable
when evaluated (similar to https://github.com/FluxML/IRTools.jl/issues/54)Environment: IRTools v0.4.7, Julia Version 1.81, macOS Monterey, Apple M1 Pro
The error trace was: