summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-08-17 19:52:28 +0300
committerGitHub <noreply@github.com>2023-08-17 18:52:28 +0200
commit98c39e8e571b95e7d9351c7115f897ce9af1a218 (patch)
tree69cc5b34456e36fd659d412ef90b1a0488f77748 /tests
parentfede75723824e06f59f23b38a9016d3f8cdf71db (diff)
downloadNim-98c39e8e571b95e7d9351c7115f897ce9af1a218.tar.gz
cascade tyFromExpr in type conversions in generic bodies (#22499)
fixes #22490, fixes #22491, adapts #22029 to type conversions
Diffstat (limited to 'tests')
-rw-r--r--tests/statictypes/tgenericcomputedrange.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/statictypes/tgenericcomputedrange.nim b/tests/statictypes/tgenericcomputedrange.nim
index 82abe2677..9e3a49ae0 100644
--- a/tests/statictypes/tgenericcomputedrange.nim
+++ b/tests/statictypes/tgenericcomputedrange.nim
@@ -115,3 +115,11 @@ block: # issue #22187
     k: array[p(m(T, s)), int64]
   var x: F[int, 3]
   doAssert x.k is array[3, int64]
+
+block: # issue #22490
+  proc log2trunc(x: uint64): int =
+    if x == 0: int(0) else: int(0)
+  template maxChunkIdx(T: typedesc): int64 = 0'i64
+  template layer(vIdx: int64): int = log2trunc(0'u64)
+  type HashList[T] = object
+    indices: array[int(layer(maxChunkIdx(T))), int]