From ba6d0eb4db5bb85c772dea3d4c5afb2bfbb5a6d5 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 18 Nov 2015 16:07:20 +0100 Subject: fixes #3541 --- lib/core/macros.nim | 3 +-- tests/macros/tnodecompare.nim | 16 ++++++++-------- tests/macros/tsametype.nim | 20 ++++++++++---------- 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 ================================== -- cgit 1.4.1-2-gfad0