summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-11-28 19:57:41 +0100
committerAraq <rumpf_a@web.de>2012-11-28 19:57:41 +0100
commit0ef08e49e74ca075f3dd7348791a77f00e5b3cab (patch)
treeccffd8af2cfa0459c86f4d6293ada59342a47214 /compiler
parent0d19de18cce2ba62e3c753e7474c29bbe4c47ad7 (diff)
downloadNim-0ef08e49e74ca075f3dd7348791a77f00e5b3cab.tar.gz
bugfix: better implict 'items' support
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/importer.nim5
-rwxr-xr-xcompiler/semexprs.nim7
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim
index f96377915..c928e8f3c 100755
--- a/compiler/importer.nim
+++ b/compiler/importer.nim
@@ -11,7 +11,7 @@
 
 import 
   intsets, strutils, os, ast, astalgo, msgs, options, idents, rodread, lookups,
-  semdata, passes
+  semdata, passes, renderer
 
 proc evalImport*(c: PContext, n: PNode): PNode
 proc evalFrom*(c: PContext, n: PNode): PNode
@@ -29,7 +29,8 @@ proc getModuleName*(n: PNode): string =
   of nkSym:
     result = n.sym.name.s
   else:
-    internalError(n.info, "getModuleName")
+    localError(n.info, errGenerated,
+      "invalide module name: '$1'" % renderTree(n))
     result = ""
 
 proc checkModuleName*(n: PNode): string =
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index e1d69c0bc..482489a65 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -589,11 +589,10 @@ proc semStaticExpr(c: PContext, n: PNode): PNode =
 
 proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode,
                                      flags: TExprFlags): PNode =
-  if efWantIterator in flags:
-    result = semOverloadedCall(c, n, nOrig, {skIterator})
-  elif efInTypeOf in flags:
+  if {efInTypeOf, efWantIterator} * flags != {}:
+    # consider 'proc p(): seq[int];  for x in p()' here and
     # for ``type(countup(1,3))``, see ``tests/ttoseq``.
-    result = semOverloadedCall(c, n, nOrig, 
+    result = semOverloadedCall(c, n, nOrig,
       {skProc, skMethod, skConverter, skMacro, skTemplate, skIterator})
   else:
     result = semOverloadedCall(c, n, nOrig,