summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semmagic.nim2
-rw-r--r--compiler/semtypes.nim3
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: