bugfix: better implict 'items' support
This commit is contained in:
parent
0d19de18cc
commit
0ef08e49e7
4 changed files with 42 additions and 22 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue