Skip to content

Conversation

dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Sep 3, 2025

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

Comment on lines +341 to +343
def map_ir(self, function: MapIR, /) -> Self:
"""**WARNING**: don't use renaming ops here, or `self.name` is invalid."""
return self.with_expr(function(self.expr.map_ir(function)))

def with_expr(self, expr: ExprIRT2, /) -> NamedIR[ExprIRT2]:
return cast("NamedIR[ExprIRT2]", replace(self, expr=expr))
return replace(self, expr=function(self.expr.map_ir(function)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Self isn't correct, but a current limitation of the type system

@dangotbanned dangotbanned changed the title refactor(expr-ir): Actually copy.replace most with_* methods refactor(expr-ir): Generalize __replace__, map_ir Sep 3, 2025
@dangotbanned dangotbanned marked this pull request as ready for review September 3, 2025 14:27
@dangotbanned dangotbanned merged commit 70d3126 into expr-ir/shrink-main Sep 3, 2025
22 of 31 checks passed
@dangotbanned dangotbanned deleted the expr-ir/replace-ier branch September 3, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant