Files
Nim/tests/arc/tisolated_primitive.nim
ringabout 985b1125b1 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`.
2026-07-02 19:51:08 +02:00

13 lines
307 B
Nim

# 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()