fixes genMagicExpr: handle mAsgn for Isolated[T] with primitive types in tuple assignment (#25955)

Explicit `=sink` calls such as `Isolated[T].=sink` can delegate to a
field type like `float`, which has no attached sink op. In that case
`replaceHookMagic` leaves the builtin `mAsgn` call in place.
`genMagicExpr` did not lower that shape, which caused the regression.
Mapping `=sink` to `nkSinkAsgn` and other builtin assignment hooks to
`nkAsgn`.

(cherry picked from commit 985b1125b1)
This commit is contained in:
ringabout
2026-07-03 01:51:08 +08:00
committed by narimiran
parent 1aabd0d794
commit df0eedcbf3
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# Issue: genMagicExpr: mAsgn internal error when using Isolated[T] with primitive types
# in tuple assignment to pointer dereference
import std/isolation
proc main() =
var x: ptr Isolated[float]
x = cast[ptr Isolated[float]](alloc0(sizeof(Isolated[float])))
x[] = isolate(42.0)
dealloc(x)
main()