fixes generic instantations in concepts

This commit is contained in:
Araq
2015-09-12 19:40:08 +02:00
parent bf698fbc2a
commit c27019f4d9

View File

@@ -221,6 +221,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
# NOTE: for access of private fields within generics from a different module
# we set the friend module:
c.friendModules.add(getModule(fn))
let oldInTypeClass = c.inTypeClass
c.inTypeClass = 0
let oldScope = c.currentScope
while not isTopLevel(c): c.currentScope = c.currentScope.parent
result = copySym(fn, false)
@@ -269,4 +271,5 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
c.currentScope = oldScope
discard c.friendModules.pop()
dec(c.instCounter)
c.inTypeClass = oldInTypeClass
if result.kind == skMethod: finishMethod(c, result)