adds some test cases (#24436)

closes #24043
closes #24045

(cherry picked from commit cc696f18c0)
This commit is contained in:
ringabout
2024-11-15 19:31:12 +08:00
committed by narimiran
parent 2d658e8de5
commit c79fb859f1

View File

@@ -69,3 +69,25 @@ proc main() =
doAssert ctx.rootsOfUnity2[0].limbs.len == wordsRequired(255)
main()
block: # bug #24045
type ArrayBuf[N: static int, T] = object
buf: array[N, T]
func maxLen(T: type): int =
sizeof(T) * 2
type MyBuf[I: type] = ArrayBuf[maxLen(I), byte]
var v: MyBuf[int]
block: # bug #24043
type ArrayBuf[N: static int, T = byte] = object
buf: array[N, T]
func maxLen(T: type): int =
sizeof(T) * 2
type MyBuf[I] = ArrayBuf[maxLen(I)]
var v: MyBuf[int]