mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
bugfix: implicit items/pairs work better
This commit is contained in:
@@ -589,9 +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 flags*{efInTypeOf, efWantIterator} != {}:
|
||||
# consider: 'for x in pReturningArray()' --> we don't want the restriction
|
||||
# to 'skIterator' anymore; skIterator is preferred in sigmatch already for
|
||||
# typeof support.
|
||||
# for ``type(countup(1,3))``, see ``tests/ttoseq``.
|
||||
result = semOverloadedCall(c, n, nOrig,
|
||||
{skProc, skMethod, skConverter, skMacro, skTemplate, skIterator})
|
||||
|
||||
12
tests/compile/tcolonisproc.nim
Normal file
12
tests/compile/tcolonisproc.nim
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
proc p(a, b: int, c: proc ()) =
|
||||
c()
|
||||
|
||||
|
||||
p(1, 3):
|
||||
echo 1
|
||||
echo 3
|
||||
|
||||
p(1, 1, proc() =
|
||||
echo 1
|
||||
echo 2)
|
||||
Reference in New Issue
Block a user