File: tlargeindex.nim

package info (click to toggle)
nim 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,911,644 kB
  • sloc: sh: 24,603; ansic: 1,761; python: 1,492; makefile: 1,013; sql: 298; asm: 141; xml: 13
file content (18 lines) | stat: -rw-r--r-- 649 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  cmd: "nim check --hints:off $file"
"""

# issue #17163
var e: array[int32, byte] #[tt.Error
             ^ index type 'int32' for array is too large]#
var f: array[uint32, byte] #[tt.Error
             ^ index type 'uint32' for array is too large]#
var g: array[int64, byte] #[tt.Error
             ^ index type 'int64' for array is too large]#
var h: array[uint64, byte] #[tt.Error
             ^ index type 'uint64' for array is too large]#

# crash in issue #23204
proc y[N](): array[N, int] = default(array[N, int]) #[tt.Error
                                           ^ index type 'int' for array is too large]#
discard y[int]()