Resolve cross file resolution errors in atomics (#19422) [backport:1.6]

* Resolve call undeclared routine testAndSet

* Fix undeclared field atomicType
This commit is contained in:
James
2022-01-20 04:58:59 -08:00
committed by GitHub
parent 4a38092ac1
commit 851e515bba
3 changed files with 27 additions and 10 deletions

View File

@@ -0,0 +1,9 @@
import atomics
type
AtomicWithGeneric*[T] = object
value: Atomic[T]
proc initAtomicWithGeneric*[T](value: T): AtomicWithGeneric[T] =
result.value.store(value)

View File

@@ -0,0 +1,11 @@
import atomicSample
block crossFileObjectContainingAGenericWithAComplexObject:
discard initAtomicWithGeneric[string]("foo")
block crossFileObjectContainingAGenericWithAnInteger:
discard initAtomicWithGeneric[int](1)
discard initAtomicWithGeneric[int8](1)
discard initAtomicWithGeneric[int16](1)
discard initAtomicWithGeneric[int32](1)
discard initAtomicWithGeneric[int64](1)