mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-12 04:09:34 +00:00
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`.
13 lines
307 B
Nim
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()
|