diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index a72143bdd7..85411f7c46 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -674,6 +674,9 @@ proc semTemplateDef(c: PContext, n: PNode): PNode = # a template's parameters are not gensym'ed even if that was originally the # case as we determine whether it's a template parameter in the template # body by the absence of the sfGenSym flag: + let retType = s.typ[0] + if retType != nil and retType.kind != tyUntyped: + allUntyped = false for i in 1..