diff options
author | Araq <rumpf_a@web.de> | 2015-04-10 11:58:17 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-04-10 14:03:47 +0200 |
commit | 3a9500f7b102c4cfd10dd551e0c4b40449492351 (patch) | |
tree | 534432dca5a44bd4159f8e231f66ed68f2894cd9 /compiler | |
parent | 6e6c6446a4d3d30a7e97ef4417bdca892e376b53 (diff) | |
download | Nim-3a9500f7b102c4cfd10dd551e0c4b40449492351.tar.gz |
fixes #2500
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sigmatch.nim | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 805266389..7e0820593 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -99,10 +99,12 @@ proc initCandidate*(ctx: PContext, c: var TCandidate, callee: PSym, c.calleeSym = callee if callee.kind in skProcKinds and calleeScope == -1: if callee.originatingModule == ctx.module: - let rootSym = if sfFromGeneric notin callee.flags: callee - else: callee.owner - c.calleeScope = 2 # rootSym.scope.depthLevel - #echo "SCOPE IS ", rootSym.scope.depthLevel + c.calleeScope = 2 + var owner = callee + while true: + owner = owner.skipGenericOwner + if owner.kind == skModule: break + inc c.calleeScope else: c.calleeScope = 1 else: |