mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
* test implicitly huge set types refs https://github.com/nim-lang/RFCs/issues/298 * oh my god * boot at least * don't error, fix remaining issues, no 2 len arrays * fix runnable example * test assuming 0..255 for int literal * test refactor, add changelog, test
11 lines
362 B
Nim
11 lines
362 B
Nim
let x = 20_000
|
|
let s = {x, 123} #[tt.Warning
|
|
^ type 'int' is too big to be a `set` element, assuming a range of 0..65535, explicitly write this range to get rid of warning [AboveMaxSizeSet]]#
|
|
doAssert x in s
|
|
doAssert 20_000 in s
|
|
{.push warningAsError[AboveMaxSizeSet]: on.}
|
|
let s2 = {range[0..65535](x), 123}
|
|
doAssert x in s
|
|
doAssert 20_000 in s
|
|
{.pop.}
|