Skip to content

Commit

Permalink
Merge pull request #21041 from JuliaLang/jb/fix21028
Browse files Browse the repository at this point in the history
fix #21028, static parameter value incorrectly set to typevar
  • Loading branch information
JeffBezanson committed Mar 16, 2017
2 parents b2795eb + 0818271 commit 0f15867
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ static jl_value_t *finish_unionall(jl_value_t *res, jl_varbinding_t *vb, jl_sten

if (vb->right && e->envidx < e->envsz) {
jl_value_t *oldval = e->envout[e->envidx];
if (!varval || (!is_leaf_bound(varval) && !var_occurs_invariant(res, vb->var, 0)))
if (!varval || (!is_leaf_bound(varval) && !vb->occurs_inv))
e->envout[e->envidx] = (jl_value_t*)vb->var;
else if (!(oldval && jl_is_typevar(oldval) && jl_is_long(varval)))
e->envout[e->envidx] = varval;
Expand Down
3 changes: 3 additions & 0 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ function test_intersection()
# issue #20998
_, E = intersection_env(Tuple{Int,Any,Any}, Tuple{T,T,S} where {T,S})
@test length(E) == 2 && E[1] == Int && isa(E[2], TypeVar)
_, E = intersection_env(Tuple{Dict{Int,Type}, Type, Any},
Tuple{Dict{K,V}, Any, Int} where {K,V})
@test E[2] == Type
end

function test_intersection_properties()
Expand Down

0 comments on commit 0f15867

Please sign in to comment.