Skip to content

Commit c66d269

Browse files
committed
Update release notes for PR #5095
1 parent 61910df commit c66d269

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

.release-notes/fix-with-tuple-dispose.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.release-notes/next-release.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,25 @@ This is the hard part that Pony protects you from. Concurrent access to mutable
88

99
Alpine 3.20 has reached end-of-life. We no longer test against it or build ponyc releases for it.
1010

11+
## Fix with tuple only processing first binding in build_with_dispose
12+
13+
When using a `with` block with a tuple pattern, only the first binding was processed for dispose-call generation and `_` validation. Later bindings were silently skipped, which meant dispose was never called on them and `_` in a later position was not rejected.
14+
15+
For example, the following code compiled without error even though `_` is not allowed in a `with` block:
16+
17+
```pony
18+
class D
19+
new create() => None
20+
fun dispose() => None
21+
22+
actor Main
23+
new create(env: Env) =>
24+
with (a, _) = (D.create(), D.create()) do
25+
None
26+
end
27+
```
28+
29+
This now correctly produces an error: `_ isn't allowed for a variable in a with block`.
30+
31+
Additionally, valid tuple patterns like `with (a, b) = (D.create(), D.create()) do ... end` now correctly generate dispose calls for all bindings, not just the first.
32+

0 commit comments

Comments
 (0)