Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mypyc/irbuild/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def transform_generator_expr(builder: IRBuilder, o: GeneratorExpr) -> Value:


def transform_assignment_expr(builder: IRBuilder, o: AssignmentExpr) -> Value:
value = builder.accept(o.value)
value = try_constant_fold(builder, o.value) or builder.accept(o.value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this has any effect. Can you show an example where this changes the generated IR? Constant folding should happen through builder.accept(...) already, and if it doesn't work, this is probably not the right place to do it.

target = builder.get_assignment_target(o.target)
builder.assign(target, value, o.line)
return value
Expand Down