summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xcompiler/ccgtypes.nim2
-rwxr-xr-xtests/compile/tcodegenbug1.nim12
-rwxr-xr-xtodo.txt4
3 files changed, 15 insertions, 3 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index e456a1eaa..4bbfc072f 100755
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -583,6 +583,8 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var TIntSet): PRope =
   else: 
     InternalError("getTypeDescAux(" & $t.kind & ')')
     result = nil
+  # fixes bug #145:
+  excl(check, t.id)
 
 proc getTypeDesc(m: BModule, typ: PType): PRope = 
   var check = initIntSet()
diff --git a/tests/compile/tcodegenbug1.nim b/tests/compile/tcodegenbug1.nim
index 909101db1..7d0fc4ad5 100755
--- a/tests/compile/tcodegenbug1.nim
+++ b/tests/compile/tcodegenbug1.nim
@@ -53,3 +53,15 @@ proc `$`*(status: TStatusEnum): string =
 proc makeCommitPath*(platform, hash: string): string =
   return platform / "nimrod_" & hash.substr(0, 11) # 11 Chars.
 
+type
+  TFlag = enum
+    A, B, C, D
+
+  TFlags = set[TFlag]
+
+  TObj = object
+    x: int
+    flags: TFlags
+
+# have a proc taking TFlags as param and returning object having TFlags field
+proc foo(flags: TFlags): TObj = nil
diff --git a/todo.txt b/todo.txt
index 09605f391..9e22e9561 100755
--- a/todo.txt
+++ b/todo.txt
@@ -1,6 +1,7 @@
 version 0.9.0
 =============
 
+- complete and document optional indentation for 'case' statement
 - implement a warning message for shadowed 'result' variable
 - make templates hygienic by default: try to gensym() everything in the 'block'
   of a template
@@ -149,9 +150,6 @@ Version 2 and beyond
 - implement/generalize the effect system; checked exceptions
 - const ptr/ref
 
-- optional indentation for 'case' statement; hm, keep in mind other syntax
-  changes that people want; may turn out to be a bad idea
-
 - language change: inheritance should only work with reference types, so that
   the ``type`` field is not needed for objects! --> zero overhead aggregation
   BETTER: ``of`` and safe object conversions only work with ref objects. Same