some extra notes:
I use this type-inference finally in a function which checks whether some function is defined for given input parameters. Think of it as hasmethod2
, like hasmethod
but being able to deal with forwarding f(args...; kwargs...) = g(args...; kwargs...)
.
This works like a charm with the created new types
Okay, why do I need to have this in a generated function?
It is because I want to do dispatch on the fact whether a function is defined or not.