diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2021-12-04 07:43:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-04 07:43:20 +0100 |
commit | f90620fb325d5b5b924774ce84384cb4098ed18e (patch) | |
tree | 243c94c4e7d10b34fafc3ad743cb3367ee4aa83c /tests | |
parent | d584dd5b99f4c1e32477db2dfb791d52b0139df1 (diff) | |
download | Nim-f90620fb325d5b5b924774ce84384cb4098ed18e.tar.gz |
fixes #19198 [backport:1.6] (#19209)
* fixes #19198 [backport:1.6] * added a test case
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vm/tvmmisc.nim | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim index f6fbde0f9..dfe086d10 100644 --- a/tests/vm/tvmmisc.nim +++ b/tests/vm/tvmmisc.nim @@ -290,10 +290,10 @@ block: # bug #10815 const a = P() doAssert $a == "" - + when defined osx: # xxx bug https://github.com/nim-lang/Nim/issues/10815#issuecomment-476380734 block: - type CharSet {.union.} = object + type CharSet {.union.} = object cs: set[char] vs: array[4, uint64] const a = Charset(cs: {'a'..'z'}) @@ -553,3 +553,22 @@ block: # bug #8015 doAssert $viaProc.table[0] == "(kind: Fixed, cost: 999)" doAssert viaProc.table[1].handler() == 100 doAssert viaProc.table[2].handler() == 200 + + +# bug #19198 + +block: + type + Foo[n: static int] = int + +block: + static: + let x = int 1 + echo x.type # Foo + +block: + static: + let x = int 1 + let y = x + 1 + # Error: unhandled exception: value out of range: -8 notin 0 .. 65535 [RangeDefect] + echo y |