Skip to content

Conversation

@JeffBezanson
Copy link
Member

No description provided.

@JeffBezanson JeffBezanson added types and dispatch Types, subtyping and method dispatch bugfix This change fixes an existing bug labels May 7, 2019
@JeffBezanson JeffBezanson added this to the 1.2 milestone May 7, 2019
JL_GC_PUSH2(&res, &newvar);
// try to reduce var to a single value
if (obviously_egal(vb->lb, vb->ub)) {
if (jl_is_long(vb->ub) && jl_is_typevar(vb->lb)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jl_is_typevar(vb->lb)

IIUC, doesn't this also need checks that vb->ub <: jl_any_type && vb->lb >: Union{}?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be more precise, I just wanted to be conservative here and also not complicate the code too much.

if (xx) record_var_occurrence(xx, e, param);
if (xx->lb == jl_bottom_type)
return 1; // allow Bottom <: non-type
return subtype(xx->lb, yy->ub, e, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have thought subtype should already handle lhs == Union{}, instead of needing to add a fast-path here to catch some cases of it just for the egal case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should be ok to change that. I thought there might be some reason we don't have that general fast path, but I'm not sure what it would be.

@JeffBezanson JeffBezanson merged commit 4c28b36 into master May 8, 2019
@JeffBezanson JeffBezanson deleted the jb/fix31899 branch May 8, 2019 18:38
KristofferC pushed a commit that referenced this pull request May 13, 2019
@KristofferC KristofferC mentioned this pull request May 13, 2019
58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug types and dispatch Types, subtyping and method dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants