Templates will pick the candidate in the nearest scope when symbols are mixed-in

This commit is contained in:
Zahary Karadjov 2013-12-31 03:58:31 +02:00
commit 8f3d5a25a6
6 changed files with 32 additions and 16 deletions

View file

@ -1430,6 +1430,10 @@ proc skipGenericOwner*(s: PSym): PSym =
result = if sfFromGeneric in s.flags: s.owner.owner
else: s.owner
proc originatingModule*(s: PSym): PSym =
result = s.owner
while result.kind != skModule: result = result.owner
proc isRoutine*(s: PSym): bool {.inline.} =
result = s.kind in {skProc, skTemplate, skMacro, skIterator, skMethod,
skConverter}