FluxML / FluxML/IRTools.jl

Dispatch doesn't work

Open
#41 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
113
Forks
37
PR merge metrics
No merged PRs in 30d

Description

We can't define a dynamo just for a subset of methods.

```julia
julia> @dynamo function foo(f, x::Real)
IR(f, x)
end

julia> foo(sin, 0.5)
ERROR: Error compiling @dynamo typeof(foo) on (typeof(sin), Float64):
MethodError: no method matching transform(::Type{typeof(foo)}, ::Type{typeof(sin)}, ::Type{Float64})
```

This is doubly-wrong because (a) the generated function entry point has no type restrictions at all and (b) the `transform` inner function does have them, but they need to be lifted to accept an equivalent set of types rather than values (exactly like a generated function).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.