Normally I would think that when I return a value from a macro or set the result to that value. There would be no difference. But aparently there is:

import macros

macro testA: string =
  result = newLit("testA")

macro testB: untyped =
  newLit("testB")

macro testC: untyped =
  return newLit("testC")

macro testD: string =
  newLit("testD")

macro testE: string =
  return newLit("testE")

I get the following error message:

scratch.nim(14, 3) Error: type mismatch: got (NimNode) but expected 'string'

Compilation exited abnormally with code 1 at Fri May 19 14:16:02

I think this is weird, because when I just set result, everything works.

2017-05-19 12:19:36
Looks inconsistent to me as well, shouldn't be to difficult to fix 2017-05-19 12:40:11
Looks like compiler in semProcBody (semexprs.nim) rewrites 'newLit("testD")' to 'result = newLit("testD")', but it happens before result type changed to NimNode
2017-05-19 12:51:20