fixes generic instantations in concepts
This commit is contained in:
parent
bf698fbc2a
commit
c27019f4d9
1 changed files with 3 additions and 0 deletions
|
|
@ -221,6 +221,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
||||||
# NOTE: for access of private fields within generics from a different module
|
# NOTE: for access of private fields within generics from a different module
|
||||||
# we set the friend module:
|
# we set the friend module:
|
||||||
c.friendModules.add(getModule(fn))
|
c.friendModules.add(getModule(fn))
|
||||||
|
let oldInTypeClass = c.inTypeClass
|
||||||
|
c.inTypeClass = 0
|
||||||
let oldScope = c.currentScope
|
let oldScope = c.currentScope
|
||||||
while not isTopLevel(c): c.currentScope = c.currentScope.parent
|
while not isTopLevel(c): c.currentScope = c.currentScope.parent
|
||||||
result = copySym(fn, false)
|
result = copySym(fn, false)
|
||||||
|
|
@ -269,4 +271,5 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
||||||
c.currentScope = oldScope
|
c.currentScope = oldScope
|
||||||
discard c.friendModules.pop()
|
discard c.friendModules.pop()
|
||||||
dec(c.instCounter)
|
dec(c.instCounter)
|
||||||
|
c.inTypeClass = oldInTypeClass
|
||||||
if result.kind == skMethod: finishMethod(c, result)
|
if result.kind == skMethod: finishMethod(c, result)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue