closes #8295; add a test case (#21486)

(cherry picked from commit 2f89f1eb78)
This commit is contained in:
ringabout
2023-03-07 20:17:05 +08:00
committed by narimiran
parent 5bddac3e34
commit db9442bf84

View File

@@ -153,3 +153,16 @@ proc unzip*[T,U](xs: List[tuple[t: T, u: U]]): (List[T], List[U]) = discard
proc unzip2*[T,U](xs: List[(T,U)]): (List[T], List[U]) = discard
type
AtomicType = pointer|ptr|int
Atomic[T: AtomicType] = distinct T
Block[T: AtomicType] = object
AtomicContainer[T: AtomicType] = object
b: Atomic[ptr Block[T]]
# bug #8295
var x = AtomicContainer[int]()
doAssert (ptr Block[int])(x.b) == nil