diff options
-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 ================================== |