Closed
Description
The compiler creates an invalid int8 constant with the value 128.
Example
const a = high(int8)
const b = a +% 1
doAssert typeof(b) is int8
doAssert b == 128 # INVALID BUT WORKS !!!
doAssert b <= high(int8) # FAILS
Current Output
Error: unhandled exception: /tmp/test.nim(7, 10) `b <= high(int8)` [AssertionError]
Expected Output
b should be -128
$ nim -v
Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2020-02-26
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: f091b5a0ee9b5585a08e9130d3ec682a9526ef39
active boot switches: -d:release
Metadata
Metadata
Assignees
Labels
No labels