Skip to content

Fix effects for inexactly imported functions#8823

Open
stevenfontanella wants to merge 1 commit into
mainfrom
import-global-effects
Open

Fix effects for inexactly imported functions#8823
stevenfontanella wants to merge 1 commit into
mainfrom
import-global-effects

Conversation

@stevenfontanella

@stevenfontanella stevenfontanella commented Jun 9, 2026

Copy link
Copy Markdown
Member

Followup to #8807 (review). When a function is imported inexactly, it may be downcasted to any of its subtypes. So a call_ref to $sub needs to include effects from an import of type $super. This isn't needed for ref.func on a defined (non-imported) function because we know its exact type in that case, and ditto for exact imports.

Part of #8615.

@stevenfontanella stevenfontanella marked this pull request as ready for review June 9, 2026 23:40
@stevenfontanella stevenfontanella requested a review from a team as a code owner June 9, 2026 23:40
@stevenfontanella stevenfontanella requested review from tlively and removed request for a team June 9, 2026 23:40
Base automatically changed from non-const-iter to main June 10, 2026 00:01
stevenfontanella added a commit that referenced this pull request Jun 10, 2026
Even if the visitor takes a mutable pointer param e.g. `Function*`, it
still works since the pointers aren't a member of a the `Module` itself
but stored in a separate unique_ptr.

Also use a forwarding reference for `visitor` to avoid copies.

For use in #8823.
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