diff options
author | Clyybber <darkmine956@gmail.com> | 2020-08-11 22:28:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 22:28:49 +0200 |
commit | 2cea52ee7e7d0f118976df5311a84540cbea85cd (patch) | |
tree | 0f0fa5aea4a46c3ae74aab774eac568826ca229c /compiler | |
parent | 813f16a2a39f1375b241cf50845f641ea44d890e (diff) | |
download | Nim-2cea52ee7e7d0f118976df5311a84540cbea85cd.tar.gz |
Allow pragmas on parameters (#15178)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtypes.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index c2aeadc21..6a1c1afc9 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -1234,7 +1234,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, if typ == nil: typ = def.typ if isEmptyContainer(typ): - localError(c.config, a.info, "cannot infer the type of parameter '" & a[0].ident.s & "'") + localError(c.config, a.info, "cannot infer the type of parameter '" & $a[0] & "'") if typ.kind == tyTypeDesc: # consider a proc such as: @@ -1265,7 +1265,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode, continue for j in 0..<a.len-2: - var arg = newSymG(skParam, a[j], c) + var arg = newSymG(skParam, if a[j].kind == nkPragmaExpr: a[j][0] else: a[j], c) if not hasType and not hasDefault and kind notin {skTemplate, skMacro}: let param = strTableGet(c.signatures, arg.name) if param != nil: typ = param.typ |