Fix forward declarations in shadow scope contexts (#15386)
* Fix forward declarations in shadow scope contexts * Add testcase for #15385 * Less empty lines * Fix tests * Inline isShadowScope * Add original testcase (with reduced amount of iterations) * Add testcase without forward decl
This commit is contained in:
parent
11c377c114
commit
4b9eea2fcc
5 changed files with 101 additions and 13 deletions
|
|
@ -662,10 +662,10 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
|
|||
localError(c.config, n[bodyPos].info, errImplOfXNotAllowed % s.name.s)
|
||||
elif n[bodyPos].kind == nkEmpty:
|
||||
localError(c.config, n.info, "implementation of '$1' expected" % s.name.s)
|
||||
var proto = searchForProc(c, c.currentScope, s)
|
||||
var (proto, comesFromShadowscope) = searchForProc(c, c.currentScope, s)
|
||||
if proto == nil:
|
||||
addInterfaceOverloadableSymAt(c, c.currentScope, s)
|
||||
else:
|
||||
elif not comesFromShadowscope:
|
||||
symTabReplace(c.currentScope.symbols, proto, s)
|
||||
if n[patternPos].kind != nkEmpty:
|
||||
c.patterns.add(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue