diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-04-21 22:49:15 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-04-21 22:49:15 +0200 |
commit | 14e496fab0d42eb54be38ccfb40b65f6c1d2cdf4 (patch) | |
tree | 325430a09ef06b02d5c3e1ebf173416d6dc59cae /compiler | |
parent | 85ea9593b38351e69fedac61ff0c2b958bac4b7f (diff) | |
download | Nim-14e496fab0d42eb54be38ccfb40b65f6c1d2cdf4.tar.gz |
fixes #6393
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/procfind.nim | 7 | ||||
-rw-r--r-- | compiler/types.nim | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/compiler/procfind.nim b/compiler/procfind.nim index 137765ddb..f7d86aaef 100644 --- a/compiler/procfind.nim +++ b/compiler/procfind.nim @@ -66,12 +66,10 @@ proc searchForProcOld*(c: PContext, scope: PScope, fn: PSym): PSym = proc searchForProcNew(c: PContext, scope: PScope, fn: PSym): PSym = const flags = {ExactGenericParams, ExactTypeDescValues, ExactConstraints, IgnoreCC} - var it: TIdentIter - result = initIdentIter(it, scope.symbols, fn.name) while result != nil: - if result.kind == fn.kind and sameType(result.typ, fn.typ, flags): + if result.kind == fn.kind: #and sameType(result.typ, fn.typ, flags): case equalParams(result.typ.n, fn.typ.n) of paramsEqual: if (sfExported notin result.flags) and (sfExported in fn.flags): @@ -85,11 +83,8 @@ proc searchForProcNew(c: PContext, scope: PScope, fn: PSym): PSym = return of paramsNotEqual: discard - result = nextIdentIter(it, scope.symbols) - return nil - proc searchForProc*(c: PContext, scope: PScope, fn: PSym): PSym = result = searchForProcNew(c, scope, fn) when false: diff --git a/compiler/types.nim b/compiler/types.nim index a930779bf..4d55ac7a9 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -777,8 +777,8 @@ proc equalParams(a, b: PNode): TParamsEquality = return paramsNotEqual # paramsIncompatible; # continue traversal! If not equal, we can return immediately; else # it stays incompatible - if not sameTypeOrNil(a.sons[0].typ, b.sons[0].typ, {ExactTypeDescValues}): - if (a.sons[0].typ == nil) or (b.sons[0].typ == nil): + if not sameTypeOrNil(a.typ, b.typ, {ExactTypeDescValues}): + if (a.typ == nil) or (b.typ == nil): result = paramsNotEqual # one proc has a result, the other not is OK else: result = paramsIncompatible # overloading by different |