diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semstmts.nim | 3 | ||||
-rw-r--r-- | compiler/sigmatch.nim | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 10c74e7ea..3fbb6f8f3 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -786,7 +786,8 @@ proc semProcAnnotation(c: PContext, prc: PNode; result = semStmt(c, x) # since a proc annotation can set pragmas, we process these here again. # This is required for SqueakNim-like export pragmas. - if result[namePos].kind == nkSym and result[pragmasPos].kind != nkEmpty: + if result.kind in procDefs and result[namePos].kind == nkSym and + result[pragmasPos].kind != nkEmpty: pragma(c, result[namePos].sym, result[pragmasPos], validPragmas) return diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 9f1e98190..a1b5c8dc9 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1270,9 +1270,11 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType, of isGeneric: inc(m.genericMatches) when true: - if skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple: + if arg.typ == nil: + result = arg + elif skipTypes(arg.typ, abstractVar-{tyTypeDesc}).kind == tyTuple: result = implicitConv(nkHiddenStdConv, f, copyTree(arg), m, c) - elif arg.typ != nil and arg.typ.isEmptyContainer: + elif arg.typ.isEmptyContainer: result = arg.copyTree result.typ = getInstantiatedType(c, arg, m, f) else: |