Files
Nim/tests/vm
ringabout 03df884f02 fixes #25682; fix vm genAsgn to handle statementListExpr (#25686)
fixes #25682

This pull request introduces a fix to the Nim compiler's assignment code
generation logic to better handle statement list expressions, and adds
regression tests to ensure correct behavior when assigning to object
fields via templates. The changes address a specific bug (#25682)
related to assignments using templates with side effects in static
contexts.

**Compiler code generation improvements:**

* Updated the `genAsgn` procedure in `compiler/vmgen.nim` to properly
handle assignments where the left-hand side is a `nkStmtListExpr`
(statement list expression), ensuring all statements except the last are
executed before the assignment occurs.

**Regression tests for assignment semantics:**

* Added new test blocks in `tests/vm/tvmmisc.nim` to verify that
template-based assignments to object fields work as expected in static
contexts, specifically testing for bug #25682.

(cherry picked from commit 9c07bb94c1)
2026-04-01 08:35:32 +02:00
..
2018-08-13 13:02:52 +02:00
2017-07-25 09:28:23 +02:00
2019-02-01 12:12:10 +01:00
2018-08-13 13:02:52 +02:00
2016-08-23 01:10:34 +02:00
2025-01-14 13:16:38 +01:00
2017-02-05 08:51:43 +01:00
2019-09-28 19:50:20 +02:00
2019-08-02 22:59:04 +01:00
2019-05-21 21:31:40 +02:00
2018-12-11 21:23:22 +01:00
2016-10-09 18:02:48 +02:00
2018-06-26 21:25:27 +02:00
2018-10-27 14:10:05 +01:00
2018-08-13 23:16:03 +02:00
2018-11-23 11:58:28 +01:00
2020-12-28 14:13:21 +01:00
2020-11-05 14:00:08 +01:00
2020-12-28 14:13:21 +01:00
2017-07-25 09:28:23 +02:00
2014-03-16 20:42:49 +02:00