Skip to content

Instantly share code, notes, and snippets.

@ClementJnc
Last active August 29, 2015 13:59
Show Gist options
  • Save ClementJnc/a31a8dcf61668e2d045e to your computer and use it in GitHub Desktop.
Save ClementJnc/a31a8dcf61668e2d045e to your computer and use it in GitHub Desktop.
Assignement operator bug ?
import macros
type
Td = tuple
a:string
b:int
proc get_data(d: Td) : string {.compileTime.} =
result = d.a # Works if a literal string is used here.
result &= "aa" # BUG
#result = result & "aa" # OK
macro m(s:static[Td]) : stmt =
echo get_data(s)
echo get_data(s)
result = newEmptyNode()
const s=("TT", 3)
m(s)
m(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment