summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-10-11 12:25:15 +0200
committerAraq <rumpf_a@web.de>2014-10-11 12:25:15 +0200
commit6c9730b3534927ac2bdd4ec7c77e0d37bba7aa2e (patch)
treef2c64a84d968861918b94cc23e0517b6842e5887 /compiler
parent8afb85b3d42b45509c78aa38a6009766cfe371f2 (diff)
downloadNim-6c9730b3534927ac2bdd4ec7c77e0d37bba7aa2e.tar.gz
fixes #1551
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index ff445ecd0..46e6f1ab3 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1614,6 +1614,11 @@ proc instantiateCreateFlowVarCall(c: PContext; t: PType;
   initIdTable(bindings)
   bindings.idTablePut(sym.ast[genericParamsPos].sons[0].typ, t)
   result = c.semGenerateInstance(c, sym, bindings, info)
+  # since it's an instantiation, we unmark it as a compilerproc. Otherwise
+  # codegen would fail:
+  if sfCompilerProc in result.flags:
+    result.flags = result.flags - {sfCompilerProc, sfExportC, sfImportC}
+    result.loc.r = nil
 
 proc setMs(n: PNode, s: PSym): PNode = 
   result = n
2' href='#n142'>142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204