diff options
author | Araq <rumpf_a@web.de> | 2015-09-12 19:40:08 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-09-12 19:40:08 +0200 |
commit | c27019f4d9db52f6e3922ac3d222d2b6e3b73fb2 (patch) | |
tree | c6c5348d197e79b10f4144cc749ee72520612343 | |
parent | bf698fbc2ab3ec3f1698261bbe4ddb897dc47f95 (diff) | |
download | Nim-c27019f4d9db52f6e3922ac3d222d2b6e3b73fb2.tar.gz |
fixes generic instantations in concepts
-rw-r--r-- | compiler/seminst.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 370990326..42a39d0df 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -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) |