diff options
author | Araq <rumpf_a@web.de> | 2015-11-18 16:07:20 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-11-18 16:07:20 +0100 |
commit | ba6d0eb4db5bb85c772dea3d4c5afb2bfbb5a6d5 (patch) | |
tree | f68eb05cbc04c2f71927edf076d7c71bfb7916da | |
parent | 1757b8466dc0b5d81319e1100933122f5e1b1a5a (diff) | |
download | Nim-ba6d0eb4db5bb85c772dea3d4c5afb2bfbb5a6d5.tar.gz |
fixes #3541
-rw-r--r-- | lib/core/macros.nim | 3 | ||||
-rw-r--r-- | tests/macros/tnodecompare.nim | 16 | ||||
-rw-r--r-- | tests/macros/tsametype.nim | 20 | ||||
-rw-r--r-- | web/news.txt | 14 |
4 files changed, 33 insertions, 20 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 552c0dbff..c8cb3d199 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -416,8 +416,7 @@ proc newLit*(i: BiggestInt): NimNode {.compileTime.} = proc newLit*(b: bool): NimNode {.compileTime.} = ## produces a new boolean literal node. - result = newNimNode(nnkIntLit) - result.intVal = ord(b) + result = if b: bindSym"true" else: bindSym"false" proc newLit*(f: BiggestFloat): NimNode {.compileTime.} = ## produces a new float literal node. diff --git a/tests/macros/tnodecompare.nim b/tests/macros/tnodecompare.nim index ef25ae370..3870c7559 100644 --- a/tests/macros/tnodecompare.nim +++ b/tests/macros/tnodecompare.nim @@ -1,12 +1,12 @@ discard """ -output: '''1 -0 -1 -0 -1 -0 -1 -0''' +output: '''true +false +true +false +true +false +true +false''' """ import macros diff --git a/tests/macros/tsametype.nim b/tests/macros/tsametype.nim index 6baa34751..34296015f 100644 --- a/tests/macros/tsametype.nim +++ b/tests/macros/tsametype.nim @@ -1,14 +1,14 @@ discard """ -output: '''1 -0 -1 -0 -1 -0 -1 -0 -1 -0''' +output: '''true +false +true +false +true +false +true +false +true +false''' """ import macros diff --git a/web/news.txt b/web/news.txt index 5e6e7894e..192ddbb74 100644 --- a/web/news.txt +++ b/web/news.txt @@ -2,6 +2,20 @@ News ==== +.. + 2015-11-XX Version 0.12.2 released + ================================== + + This is a bugfix release. + + + Changes affecting backwards compatibility + ----------------------------------------- + + - ``macros.newLit`` for ``bool`` now produces false/true symbols which + actually work with the bool datatype. + + 2015-10-27 Version 0.12.0 released ================================== |