Skip to content

Fix dyn T resolution ICE#1520

Closed
ninehusky wants to merge 3 commits intoflux-rs:mainfrom
ninehusky:ninehusky-fix-dyn-assoc-reft-resolution
Closed

Fix dyn T resolution ICE#1520
ninehusky wants to merge 3 commits intoflux-rs:mainfrom
ninehusky:ninehusky-fix-dyn-assoc-reft-resolution

Conversation

@ninehusky
Copy link
Contributor

Closes #1519.

@ninehusky ninehusky marked this pull request as ready for review February 26, 2026 23:35
@nilehmann nilehmann requested a review from Copilot February 27, 2026 15:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an internal compiler error (ICE) that occurred when resolving associated refinements on dyn trait types. The issue arose because trait resolution for dyn Trait types falls into the builtin implementation path, but user-defined traits on dyn types don't have builtin refinement bodies, causing a panic when the code expected one.

Changes:

  • Added a test case that reproduces the ICE scenario from issue #1519
  • Added an early return in normalize_alias_reft to handle dyn trait types by treating them as unresolvable aliases

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/tests/pos/surface/no_panic07.rs Regression test demonstrating the fixed ICE when using associated refinements with dyn trait objects
crates/flux-infer/src/projections.rs Added check to detect dyn trait types and return them as unresolved aliases instead of attempting builtin resolution

@nilehmann
Copy link
Member

Superseded by #1522

@nilehmann nilehmann closed this Feb 27, 2026
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.

ICE when resolving associated refinement on dyn trait

3 participants