# What should be an argument of this function?

**URL:** <https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660>\
**Category:** General Usage\
**Tags:** question, metaprogramming, metadata, data\_structures\
**Created:** [May 17, 2020, 9:29pm UTC](https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660 "2020-05-17T21:29:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiktorkujawa](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Post date:** [May 17, 2020, 9:29pm UTC](https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660/1 "2020-05-17T21:29:40Z")

</div>

Here’e the code error.

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

```

I tried also this:

```julia
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)?

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [May 17, 2020, 11:21pm UTC](https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660/2 "2020-05-17T23:21:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [May 17, 2020, 11:50pm UTC](https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660/3 "2020-05-17T23:50:19Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

**Author:** ![wiktorkujawa](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Post date:** [May 18, 2020, 9:13am UTC](https://discourse.julialang.org/t/what-should-be-an-argument-of-this-function/39660/4 "2020-05-18T09:13:15Z")

</div>

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.
