summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-22 10:47:07 +0100
committerAraq <rumpf_a@web.de>2015-03-22 10:47:07 +0100
commite7d709791942480cc60afc5e34ec75ec26402b9e (patch)
tree24ca24ec93c0e1ba8a97bb826d19044848eecd90
parent36acac3000b496756ae3fbf561e875a1f9570bac (diff)
downloadNim-e7d709791942480cc60afc5e34ec75ec26402b9e.tar.gz
fixes #1787
-rw-r--r--compiler/types.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/types.nim b/compiler/types.nim
index 0d91d1327..f4ac4daea 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -1092,9 +1092,11 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
       if result != nil: break
     if result.isNil and t.sons[0] != nil:
       result = typeAllowedAux(marker, t.sons[0], skResult, flags)
-  of tyExpr, tyStmt, tyTypeDesc, tyStatic:
+  of tyTypeDesc:
+    # XXX: This is still a horrible idea...
     result = nil
-    # XXX er ... no? these should not be allowed!
+  of tyExpr, tyStmt, tyStatic:
+    if kind notin {skParam, skResult}: result = t
   of tyEmpty:
     if taField notin flags: result = t
   of tyTypeClasses: