summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorEtan Kissling <etan@status.im>2021-12-06 20:38:23 +0100
committerGitHub <noreply@github.com>2021-12-06 20:38:23 +0100
commit0213c7313b2edf8e8ec9d81764685744e874ef84 (patch)
treec50e0cabf30fd47fe1caa1fb9e32dda157d8ddd2 /tests
parent7e3da693f5bd8879d91ccadc469a3ec80d77a34f (diff)
downloadNim-0213c7313b2edf8e8ec9d81764685744e874ef84.tar.gz
allow `HSlice` bounded by constants of distinct types (#19219) [backport:1.2]
When creating heterogenous slices of distinct types, the compiler does
not initialize the internal type's `size` before accessing it.
This then leads to this crash message:
```
compiler/int128.nim(594, 11) `false` masking only implemented for 1, 2, 4 and 8 bytes [AssertionError]
```
This patch initializes the `size` properly, fixing the problem.
Diffstat (limited to 'tests')
-rw-r--r--tests/slice/tdistinct.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/slice/tdistinct.nim b/tests/slice/tdistinct.nim
new file mode 100644
index 000000000..d99b529a7
--- /dev/null
+++ b/tests/slice/tdistinct.nim
@@ -0,0 +1,2 @@
+type Foo = distinct uint64
+const slice = 0 ..< 42.Foo