Skip to content

Commit

Permalink
fix a method cache matching issue with Type{T}
Browse files Browse the repository at this point in the history
This is needed to avoid confusing `Type{A{B}}` and `Type{A{B} where B}`.
In the future, this can be improved by not using `Type{ }` to dispatch
types with free variables.
  • Loading branch information
JeffBezanson committed Mar 25, 2017
1 parent 0152278 commit dfd8fc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int sig_match_by_type_simple(jl_value_t **types, size_t n, jl_tupletype_t
return 0;
}
else {
if (!jl_types_equal(jl_tparam0(a), tp0))
if (!(jl_typeof(jl_tparam0(a)) == jl_typeof(tp0) && jl_types_equal(jl_tparam0(a), tp0)))
return 0;
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ static inline int sig_match_simple(jl_value_t **args, size_t n, jl_value_t **sig
return 0;
}
else {
if (a!=tp0 && !jl_types_equal(a,tp0))
if (a!=tp0 && !(jl_typeof(a) == jl_typeof(tp0) && jl_types_equal(a,tp0)))
return 0;
}
}
Expand Down

0 comments on commit dfd8fc1

Please sign in to comment.