diff options
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 949d717b0..2290ff6f6 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2801,7 +2801,10 @@ when notJSnotNims and not defined(nimSeqsV2): assert y == "abcgh" discard -proc nimArrayWith[T](y: T, size: static int): array[size, T] {.compilerRtl, raises: [].} = +proc arrayWith*[T](y: T, size: static int): array[size, T] {.raises: [].} = ## Creates a new array filled with `y`. for i in 0..size-1: - result[i] = y + when nimvm: + result[i] = y + else: + result[i] = `=dup`(y) |