Skip to content

check issimpleenoughtype for PartialStruct during issimplertype#61130

Open
adienes wants to merge 4 commits intoJuliaLang:masterfrom
adienes:fast_path_tmerge_partialstruct
Open

check issimpleenoughtype for PartialStruct during issimplertype#61130
adienes wants to merge 4 commits intoJuliaLang:masterfrom
adienes:fast_path_tmerge_partialstruct

Conversation

@adienes
Copy link
Member

@adienes adienes commented Feb 23, 2026

fixes #60715

tmerge_types_slow would check issimpleenoughtype(u) after the PartialStructs were stripped from the types, but that path wasn't getting hit as it would early return via tmerge_fast_path

Claude assisted the analysis but the proposed fix is mine

@adienes adienes added bugfix This change fixes an existing bug compiler:inference Type inference labels Feb 23, 2026
@vtjnash
Copy link
Member

vtjnash commented Feb 23, 2026

This looks inaccurate of a fix. The tmerge_fast_path code checks issimplertype which should already be a sufficient and superior fix to this. Any idea what input is there? We should add a unit test for that, and not just this integration test

@adienes
Copy link
Member Author

adienes commented Feb 23, 2026

let T(n) = Tuple{Int, Union{Int, Tuple{Int, Union{...}}}} to a nesting depth of 2n (so each of Tuple, Union occurs n times)

then IIUC typea = PartialStruct(T(n), [Const(0), Union{Int, T(n-1)}]) and typeb = PartialStruct(T(n+1), [Const(0), Union{Int, T(n)}])

@adienes adienes changed the title enforce issimpleenoughtype in fast path for tmerge for PartialStruct check issimpleenoughtype for PartialStruct during issimplertype Feb 23, 2026
adienes and others added 2 commits February 23, 2026 15:59
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
@KristofferC KristofferC added backport 1.12 Change should be backported to release-1.12 backport 1.13 Change should be backported to release-1.13 labels Feb 24, 2026
@KristofferC KristofferC mentioned this pull request Feb 25, 2026
36 tasks
@adienes adienes requested a review from vtjnash February 25, 2026 14:16
@KristofferC KristofferC mentioned this pull request Mar 3, 2026
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 1.12 Change should be backported to release-1.12 backport 1.13 Change should be backported to release-1.13 bugfix This change fixes an existing bug compiler:inference Type inference status: waiting for PR reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type inference hangs on recursive varargs function returning nested tuples

3 participants