Skip to content

Commit 0d91a3c

Browse files
committed
fix check for iterability in Dict constructor
1 parent cff3cd6 commit 0d91a3c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

base/dict.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ function Dict(kv)
144144
try
145145
associative_with_eltype((K, V) -> Dict{K, V}, kv, eltype(kv))
146146
catch e
147-
if any(x->isempty(methods(x, (typeof(kv),))), [start, next, done]) ||
148-
!all(x->isa(x,Union{Tuple,Pair}),kv)
147+
if !applicable(start, kv) || !all(x->isa(x,Union{Tuple,Pair}),kv)
149148
throw(ArgumentError("Dict(kv): kv needs to be an iterator of tuples or pairs"))
150149
else
151150
rethrow(e)

0 commit comments

Comments
 (0)