Skip to content

subtype: don't re-select constraintkind 1 for vars bounding inner vars - #63812

Open
adienes wants to merge 1 commit into
JuliaLang:masterfrom
adienes:intersect-ck-reselection
Open

adienes wants to merge 1 commit into
JuliaLang:masterfrom
adienes:intersect-ck-reselection

Conversation

@adienes

@adienes adienes commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

I think this needs to match the check above with never_occurs_in_inside_ub before setting constraintkind=1

julia/src/subtype.c

Lines 5334 to 5335 in 4cecb80

// Setting constraintkind=1 for covariant var might be invalid if it also occurs in triangular positions.
if (is_leaf_typevar(u->var) && noinv && always_occurs_cov(u->body, u->var, param) && never_occurs_in_inside_ub(u->body, u->var))

also fixes a test case that tests the bug (witness: Tuple{Tuple{Int8},Tuple{Int},Int})

Assisted-by: Claude Code (Opus 5.5)

the second pass skipped the `never_occurs_in_inside_ub` check the first pass does, so the ub got narrowed and valid results were dropped; the JuliaLang#30335 expectation was one of them

Assisted-by: Claude Code (Opus 5.5)
@adienes adienes added types and dispatch Types, subtyping and method dispatch bugfix This change fixes an existing bug labels Oct 14, 2026

This branch has not been deployed

No deployments
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.

1 participant