-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
Hello!
I opened a thread on discourse and I was advised to open an issue as well, as it is really difficult to explain behavior:
struct A end
struct B
a::A
end
println("finds constructor with A param:")
B |> methods |> println
println("does not find constructor with A:")
A |> methodswith |> printlnoutputs
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[]
this was run on 1.5 but it is clearly present on master as it was pointed out to me to be the result of this line
| if isa(f, Function) |
because isa(B, Function) == false as B is a DataType
but technically there is a method with A, so I would classify this as a bug:
bm = methods(B) |> collect |> (x -> x[1])
println(bm |> typeof)
println(bm.sig)outputs
Method
Tuple{Type{B},A}
I think I'll attempt a PR but I haven't contributed to Julia yet so it will not be straightforward
MasonProtter
Metadata
Metadata
Assignees
Labels
No labels