summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-04-05 00:55:32 +0200
committerAraq <rumpf_a@web.de>2011-04-05 00:55:32 +0200
commitecb3590102a6ee5a77d52075e136337c9ec6c4c5 (patch)
treeaf1a6c6fae98b668742c3d9563ac9b438a0ced5b
parente38876efb67b6b7f24f4c9a4669ced6fdd2d4371 (diff)
downloadNim-ecb3590102a6ee5a77d52075e136337c9ec6c4c5.tar.gz
fixes #25
-rwxr-xr-xrod/ccgexprs.nim2
-rw-r--r--tests/accept/run/trepr.nim14
2 files changed, 15 insertions, 1 deletions
diff --git a/rod/ccgexprs.nim b/rod/ccgexprs.nim
index 32cc8fb32..4d31337c4 100755
--- a/rod/ccgexprs.nim
+++ b/rod/ccgexprs.nim
@@ -1038,7 +1038,7 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
     putIntoDest(p, d, e.typ, ropecg(p.module, "#reprStr($1)", [rdLoc(a)]))
   of tySet:
     putIntoDest(p, d, e.typ, ropecg(p.module, "#reprSet($1, $2)", [
-                rdLoc(a), genTypeInfo(p.module, t)]))
+                addrLoc(a), genTypeInfo(p.module, t)]))
   of tyOpenArray:
     var b: TLoc
     case a.t.kind
diff --git a/tests/accept/run/trepr.nim b/tests/accept/run/trepr.nim
new file mode 100644
index 000000000..19ed8e180
--- /dev/null
+++ b/tests/accept/run/trepr.nim
@@ -0,0 +1,14 @@
+discard """
+  file: "trepr.nim"
+  output: "{a, b}{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}"
+"""
+
+type
+  TEnum = enum
+    a, b
+    
+var val = {a, b}
+stdout.write(repr(val))
+stdout.writeln(repr({'a'..'z', 'A'..'Z'}))
+
+