# What is the type 'Method' and where is it defined?

**URL:** <https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755>\
**Category:** New to Julia\
**Created:** [September 17, 2020, 6:55am UTC](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755 "2020-09-17T06:55:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenrikM](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrikm/32/17975_2.png) [@HenrikM](https://discourse.julialang.org/u/HenrikM)\
**Post date:** [September 17, 2020, 6:55am UTC](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755/1 "2020-09-17T06:55:34Z")

</div>

The `@which` macro returns a mutable composite type `Method`. Is this documented anywhere and how do I find the source code for it? I guess it is part of the Julia internals since the usual ways of discovery fail.

```julia
m = @which length([1.0])
typeof(m)
@which Method
methods(Method)

```

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [September 17, 2020, 7:16am UTC](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755/2 "2020-09-17T07:16:49Z")

</div>

Yes, it’s an internal type. You can find many of Julia’s internals documented via comments in [base/boot.jl](https://github.com/JuliaLang/julia/blob/master/base/boot.jl); the closer they are to the compiler the less likely they seem to be to be spelled out. The authoritative source is [julia.h](https://github.com/JuliaLang/julia/blob/01ebd93771be2f3c5ddf9973467eefce4c6b82a4/src/julia.h#L295-L334), and the Julia “mirror” is created in [jltypes.c](https://github.com/JuliaLang/julia/blob/01ebd93771be2f3c5ddf9973467eefce4c6b82a4/src/jltypes.c#L2281-L2330).

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 18, 2020, 5:28am UTC](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755/3 "2020-09-18T05:28:10Z")

</div>

Also, there are some docs at

[https://docs.julialang.org/en/v1.6-dev/devdocs/ast/#ast-lowered-method](https://docs.julialang.org/en/v1.6-dev/devdocs/ast/#ast-lowered-method)
