This repository was archived by the owner on Feb 7, 2019. It is now read-only.
File tree 1 file changed +23
-19
lines changed
1 file changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -496,28 +496,32 @@ end
496
496
497
497
# TODO issue https://github.com/JuliaLang/julia/issues/11355 and https://github.com/mauro3/Traits.jl/pull/13
498
498
# this error-ed on test @test istrait(TT33{String}) on commit 565a4d4c27d59452f
499
- # function find_tvar{T<:Tuple}(sig::Type{T}, tv)
500
- # ns = length(sig)
501
- # out = Int[]
502
- # for i = 1:ns
503
- # @show sig[i], tv
504
- # if length(find_tvar(sig[i], tv))>0
505
- # push!(out,i)
506
- # end
507
- # end
508
- # return out
509
- # end
499
+ function find_tvar {T<:Tuple} (sig:: Type{T} , tv)
500
+ ns = length (sig)
501
+ out = Int[]
502
+ @show sig, tv
503
+ for i = 1 : ns
504
+ if length (find_tvar (sig[i], tv))> 0
505
+ push! (out,i)
506
+ end
507
+ end
508
+ return out
509
+ end
510
510
find_tvar (sig:: TypeVar , tv) = sig=== tv ? [1 ] : Int[] # note ===, this is essential!
511
511
function find_tvar (arg:: DataType , tv)
512
512
if arg<: Tuple # TODO issue https://github.com/JuliaLang/julia/issues/11327#issuecomment-103159360
513
- ns = length (arg)
514
- out = Int[]
515
- for i = 1 : ns
516
- if length (find_tvar (arg[i], tv))> 0
517
- push! (out,i)
518
- end
519
- end
520
- return out
513
+ # ns = length(arg)
514
+ # out = Int[]
515
+ # for i = 1:ns
516
+ # if length(find_tvar(arg[i], tv))>0
517
+ # push!(out,i)
518
+ # end
519
+ # end
520
+ # return out
521
+ @show arg, tv
522
+ xdump (arg)
523
+ xdump (tv)
524
+ error (" Dispatch error!" )
521
525
end
522
526
ns = length (arg. parameters)
523
527
for i= 1 : ns
You can’t perform that action at this time.
0 commit comments