Skip to content

Reapply "Fix open world public types" (#8802)#8810

Open
tlively wants to merge 2 commits into
mainfrom
reland-public-type-fix
Open

Reapply "Fix open world public types" (#8802)#8810
tlively wants to merge 2 commits into
mainfrom
reland-public-type-fix

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented Jun 6, 2026

This reverts commit 9e3b947.

Beyond reapplying the original commit, this adds special handling when func is exposed so that we avoid considering function types used only to declare unreferenced functions public. This avoids an assertion failure in MinimizeRecGroups when a previous pass like DAE optimizes an unreferenced function's type to differ from a public function type only by e.g. the exactness of a reference when custom descriptors is disabled. The assertion in MinimizeRecGroups is checking that all public types are distinguishable from each other given the enabled feature set. This is something we enforce when parsing input modules, so it makes sense to keep as an invariant of the IR. The change to consider types used only for unreferenced functions private lets us maintain that invariant without giving up optimization power unnecessarily.

tlively added 2 commits June 5, 2026 17:50
This reverts commit 9e3b947.

Beyond reapplying the original commit, this adds special handling when `func` is exposed so that we avoid considering function types used only to declare unreferenced functions public. This avoids an assertion failure in MinimizeRecGroups when a previous pass like DAE optimizes an unreferenced function's type to differ from a public function type only by e.g. the exactness of a reference when custom descriptors is disabled. The assertion in MinimizeRecGroups is checking that all public types are distinguishable from each other given the enabled feature set. This is something we enforce when parsing input modules, so it makes sense to keep as an invariant of the IR. The change to consider types used only for unreferenced functions private lets us maintain that invariant without giving up optimization power unnecessarily.
@tlively tlively requested a review from a team as a code owner June 6, 2026 00:50
@tlively tlively requested review from stevenfontanella and removed request for a team June 6, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant