What should be an argument of this function?

Here’e the code error.

julia> name(15)
ERROR: MethodError: no method matching name(::Int64)
Closest candidates are:

I tried also this:

julia> name(typeof(Int))
ERROR: MethodError: Cannot `convert` an object of type Symbol to an object of type DataType

Function was created from some macro, if someone wants to know.
Basic question. What argument I have to pass to this function to make it work(that means no errors)?

You can access the documentation by typing ?name into the REPL.

methods(name) will give you a list of all methods associated with the function.

This seems to be a function you defined yourself. There’s no guarantee at all that you can call that function without error. For all what we can tell from the truncated error output you provide, it might well be

name(::DataType) = throw(MethodError(convert, (DataType, :a)))

You need to give more detail in order to get a reasonable answer (unless someone knows how you created that function). More complete output about the error and which function it is/what’s the code for it/how it is defined would be a good start.


Well, it’s not actual. I’ve just made an error when was executing a macro, which initialized this function. Type don’t need to be DataType, it could be anything(Any), but thanks for the reply.