Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch doesn't work #41

Open
MikeInnes opened this issue Jan 22, 2020 · 1 comment
Open

Dispatch doesn't work #41

MikeInnes opened this issue Jan 22, 2020 · 1 comment

Comments

@MikeInnes
Copy link
Member

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

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).

@MikeInnes
Copy link
Member Author

#42 address the second part of this. The first part is a bit tricky because we currently want the generated function to have a single args... slot so that the slots in the IR can easily be mapped to that original slot. I'm not sure we can express the right type signature directly there, so we might just have to settle for a more complicated mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant