diff options
author | James <james@frasca.me> | 2022-01-20 04:58:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 13:58:59 +0100 |
commit | 851e515bbae6edf6b28cf6723b2c7a45acce1869 (patch) | |
tree | 2334c888012184966b96d1c32b38f78324ba063b /tests | |
parent | 4a38092ac1f8368cb1ebb0245c99c701963662f8 (diff) | |
download | Nim-851e515bbae6edf6b28cf6723b2c7a45acce1869.tar.gz |
Resolve cross file resolution errors in atomics (#19422) [backport:1.6]
* Resolve call undeclared routine testAndSet * Fix undeclared field atomicType
Diffstat (limited to 'tests')
-rw-r--r-- | tests/stdlib/concurrency/atomicSample.nim | 9 | ||||
-rw-r--r-- | tests/stdlib/concurrency/tatomic_import.nim | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/stdlib/concurrency/atomicSample.nim b/tests/stdlib/concurrency/atomicSample.nim new file mode 100644 index 000000000..d56d867df --- /dev/null +++ b/tests/stdlib/concurrency/atomicSample.nim @@ -0,0 +1,9 @@ +import atomics + +type + AtomicWithGeneric*[T] = object + value: Atomic[T] + +proc initAtomicWithGeneric*[T](value: T): AtomicWithGeneric[T] = + result.value.store(value) + diff --git a/tests/stdlib/concurrency/tatomic_import.nim b/tests/stdlib/concurrency/tatomic_import.nim new file mode 100644 index 000000000..e8faaae20 --- /dev/null +++ b/tests/stdlib/concurrency/tatomic_import.nim @@ -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) |