diff options
author | Araq <rumpf_a@web.de> | 2015-04-22 16:11:51 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-04-22 16:11:51 +0200 |
commit | 13c5f792dce81c89e0578c7aa296928ada6b9eb4 (patch) | |
tree | 1e9e4f951a33bac4fdc9d13e6b6a2280cb5f80ef /compiler | |
parent | daad8100a946bb8b38524b092c495fdda5846f65 (diff) | |
download | Nim-13c5f792dce81c89e0578c7aa296928ada6b9eb4.tar.gz |
fixes #2447
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semmagic.nim | 2 | ||||
-rw-r--r-- | compiler/semtypes.nim | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index f15a55832..478e2cf37 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -54,7 +54,7 @@ proc evalTypeTrait(trait: PNode, operand: PType, context: PSym): PNode = result.typ = newType(tyString, context) result.info = trait.info of "arity": - result = newIntNode(nkIntLit, typ.n.len-1) + result = newIntNode(nkIntLit, typ.len - ord(typ.kind==tyProc)) result.typ = newType(tyInt, context) result.info = trait.info else: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 9e36341bb..304fe6d14 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -261,7 +261,8 @@ proc semArray(c: PContext, n: PNode, prev: PType): PType = if not isOrdinalType(indx): localError(n.sons[1].info, errOrdinalTypeExpected) elif enumHasHoles(indx): - localError(n.sons[1].info, errEnumXHasHoles, indx.sym.name.s) + localError(n.sons[1].info, errEnumXHasHoles, + typeToString(indx.skipTypes({tyRange}))) base = semTypeNode(c, n.sons[2], nil) addSonSkipIntLit(result, base) else: |