From c27019f4d9db52f6e3922ac3d222d2b6e3b73fb2 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 12 Sep 2015 19:40:08 +0200 Subject: [PATCH] fixes generic instantations in concepts --- compiler/seminst.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 370990326a..42a39d0df4 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)