Skip to content

Commit

Permalink
fix bug sequence has no elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Stepami committed Oct 16, 2023
1 parent c9c97a3 commit a8ed4d0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ public AddressedInstructions Visit(AssignmentExpression visitable)
}

if (visitable.Destination.Empty())
result.OfType<Simple>().Last().Left = visitable.Destination.Id;
{
var lastSimple = result.OfType<Simple>().LastOrDefault();
if (lastSimple is not null)
lastSimple.Left = visitable.Destination.Id;
}
else
{
var last = new Name(result.OfType<Simple>().Last().Left);
Expand Down

0 comments on commit a8ed4d0

Please sign in to comment.