summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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
-rw-r--r--lib/system.nim6
6 files changed, 10 insertions, 8 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)
diff --git a/lib/system.nim b/lib/system.nim
index 92c5e009f..9991f6e77 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1985,7 +1985,7 @@ iterator countdown*[T](a, b: T, step = 1): T {.inline.} =
       yield res
       dec(res, step)
 
-iterator countup*[S, T](a: S, b: T, step = 1): T {.inline.} =
+iterator countup*[T](a, b: T, step = 1): T {.inline.} =
   ## Counts from ordinal value `a` up to `b` (inclusive) with the given
   ## step count. `S`, `T` may be any ordinal type, `step` may only
   ## be positive. **Note**: This fails to count to ``high(int)`` if T = int for
@@ -2001,7 +2001,7 @@ iterator countup*[S, T](a: S, b: T, step = 1): T {.inline.} =
       yield res
       inc(res, step)
 
-iterator `..`*[S, T](a: S, b: T): T {.inline.} =
+iterator `..`*[T](a, b: T): T {.inline.} =
   ## An alias for `countup`.
   when T is IntLikeForCount:
     var res = int(a)
@@ -3433,7 +3433,7 @@ template `..<`*(a, b: untyped): untyped =
   ## a shortcut for 'a..pred(b)'.
   a .. pred(b)
 
-iterator `..<`*[S,T](a: S, b: T): T =
+iterator `..<`*[T](a, b: T): T =
   var i = T(a)
   while i < b:
     yield i