# Default constructor does not show up from methodswith

**URL:** <https://discourse.julialang.org/t/default-constructor-does-not-show-up-from-methodswith/62064>\
**Category:** General Usage\
**Created:** [May 30, 2021, 12:02am UTC](https://discourse.julialang.org/t/default-constructor-does-not-show-up-from-methodswith/62064 "2021-05-30T00:02:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![endremborza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/endremborza/32/19312_2.png) [@endremborza](https://discourse.julialang.org/u/endremborza)\
**Post date:** [May 30, 2021, 12:02am UTC](https://discourse.julialang.org/t/default-constructor-does-not-show-up-from-methodswith/62064/1 "2021-05-30T00:02:23Z")

</div>

can’t really describe it in more detail than what is in the title, here is an example:

```julia
struct A end

struct B
    a::A
end

println("finds constructor with A param:")
B |> methods |> println
println("does not findconstructor with A:")
A |> methodswith |> println

```

```julia
finds constructor with A param:
# 2 methods for type constructor:
[1] B(a::A) in Main at In[1]:4
[2] B(a) in Main at In[1]:4
does not find constructor with A:
Method[]

```

---

<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:** [May 30, 2021, 9:44am UTC](https://discourse.julialang.org/t/default-constructor-does-not-show-up-from-methodswith/62064/2 "2021-05-30T09:44:04Z")

</div>

I can replicate this with 1.6 and master, but could not find an open issue ([#33866](https://github.com/JuliaLang/julia/issues/33866) is related, but does not mention this explicitly). I think the problem is [this line](https://github.com/JuliaLang/julia/blob/2280efef7933af8052647aed500547a7817970e8/stdlib/InteractiveUtils/src/InteractiveUtils.jl#L192) in `InteractiveUtils._methodswith`, since constructors are not considered to be `Function`s.

Please check open issues and consider opening a new one (and link it here) so this will not be forgotten.

---

<div class="post-metadata">

**Author:** ![endremborza](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/endremborza/32/19312_2.png) [@endremborza](https://discourse.julialang.org/u/endremborza)\
**Post date:** [May 30, 2021, 10:17am UTC](https://discourse.julialang.org/t/default-constructor-does-not-show-up-from-methodswith/62064/3 "2021-05-30T10:17:50Z")

</div>

Thanks, just did it:

[https://github.com/JuliaLang/julia/issues/41010](https://github.com/JuliaLang/julia/issues/41010)
