summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-11-02 15:39:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-11-02 15:39:44 +0100
commit30b098fcafbcf6d6f228a51decc533f38458d232 (patch)
tree08c1859c54dec081b5c6d60fe94c597867932983 /compiler
parent1ae5ba253628b7bfa570283b844cd01d993c0089 (diff)
downloadNim-30b098fcafbcf6d6f228a51decc533f38458d232.tar.gz
wip
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgstmts.nim2
-rw-r--r--compiler/semgnrc.nim2
-rw-r--r--compiler/semmagic.nim4
-rw-r--r--compiler/semstmts.nim2
-rw-r--r--compiler/semtypes.nim2
5 files changed, 7 insertions, 5 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index 9682a0e86..24a376dec 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -165,7 +165,7 @@ proc genGotoState(p: BProc, n: PNode) =
     statesCounter = n[1].intVal
   let prefix = if n.len == 3 and n[2].kind == nkStrLit: n[2].strVal.rope
                else: rope"STATE"
-  for i in 0 .. statesCounter:
+  for i in 0i64 .. statesCounter:
     lineF(p, cpsStmts, "case $2: goto $1$2;$n", [prefix, rope(i)])
   lineF(p, cpsStmts, "}$n", [])
 
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index 3cdb68df6..fb17dced8 100644
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -210,7 +210,7 @@ proc semGenericStmt(c: PContext, n: PNode,
         considerQuotedIdent(fn).id notin ctx.toMixin:
       errorUndeclaredIdentifier(c, n.info, fn.renderTree)
 
-    var first = ord(withinConcept in flags)
+    var first = int ord(withinConcept in flags)
     var mixinContext = false
     if s != nil:
       incl(s.flags, sfUsed)
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index d721f42ab..0803b99ec 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -168,7 +168,9 @@ proc semTypeTraits(c: PContext, n: PNode): PNode =
 proc semOrd(c: PContext, n: PNode): PNode =
   result = n
   let parType = n.sons[1].typ
-  if isOrdinalType(parType) or parType.kind == tySet:
+  if isOrdinalType(parType):
+    discard
+  elif parType.kind == tySet:
     result.typ = makeRangeType(c, firstOrd(parType), lastOrd(parType), n.info)
   else:
     localError(n.info, errOrdinalTypeExpected)
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 540ef4c07..f747b9b41 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1004,7 +1004,7 @@ proc checkForMetaFields(n: PNode) =
     case t.kind
     of tySequence, tySet, tyArray, tyOpenArray, tyVar, tyPtr, tyRef,
        tyProc, tyGenericInvocation, tyGenericInst, tyAlias:
-      let start = ord(t.kind in {tyGenericInvocation, tyGenericInst})
+      let start = int ord(t.kind in {tyGenericInvocation, tyGenericInst})
       for i in start ..< t.sons.len:
         checkMeta(t.sons[i])
     else:
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 8c4ad81ad..92a36857a 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -138,7 +138,7 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType =
   if n.len < 1:
     result = newConstraint(c, kind)
   else:
-    let isCall = ord(n.kind in nkCallKinds+{nkBracketExpr})
+    let isCall = int ord(n.kind in nkCallKinds+{nkBracketExpr})
     let n = if n[0].kind == nkBracket: n[0] else: n
     checkMinSonsLen(n, 1)
     var t = semTypeNode(c, n.lastSon, nil)