-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
types and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch
Description
The following ambiguous method situation fails to produce a method ambiguity warning:
~/Documents/no-backup/julia$ ./julia
julia> f{T<:Integer}(::Type{T}, ::Ptr{Integer}) = 2
f (generic function with 1 method)
julia> f{T<:Integer}(::Type{T}, ::Ptr{T}) = 1
f (generic function with 2 methods)
julia> f(Integer, convert(Ptr{Integer}, C_NULL))
1
~/Documents/no-backup/julia$ ./julia
julia> f{T<:Integer}(::Type{T}, ::Ptr{T}) = 1
f (generic function with 1 method)
julia> f{T<:Integer}(::Type{T}, ::Ptr{Integer}) = 2
f (generic function with 2 methods)
julia> f(Integer, convert(Ptr{Integer}, C_NULL))
2
this affects the behavior of the following lines:
https://github.com/JuliaLang/Gtk.jl/blob/5d1e5ee360aafae97c2189b8970345b70707024a/src/GLib/gtype.jl#L270
https://github.com/JuliaLang/Gtk.jl/blob/5d1e5ee360aafae97c2189b8970345b70707024a/src/GLib/gtype.jl#L284
currently, it works as intended, but if I switch the order of those two statements, it instead turns into a stack overflow
Metadata
Metadata
Assignees
Labels
types and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch