summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/astalgo.nim10
-rw-r--r--compiler/semtypinst.nim16
-rw-r--r--compiler/sigmatch.nim7
-rw-r--r--compiler/vmgen.nim8
4 files changed, 19 insertions, 22 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim
index 4772009b4..3ca44ea7e 100644
--- a/compiler/astalgo.nim
+++ b/compiler/astalgo.nim
@@ -448,20 +448,20 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int;
 
 proc debug(n: PSym) =
   if n == nil:
-    msgWriteln("null")
+    echo("null")
   elif n.kind == skUnknown:
-    msgWriteln("skUnknown")
+    echo("skUnknown")
   else:
     #writeLine(stdout, $symToYaml(n, 0, 1))
-    msgWriteln("$1_$2: $3, $4, $5, $6" % [
+    echo("$1_$2: $3, $4, $5, $6" % [
       n.name.s, $n.id, $flagsToStr(n.flags), $flagsToStr(n.loc.flags),
       $lineInfoToStr(n.info), $n.kind])
 
 proc debug(n: PType) =
-  msgWriteln($debugType(n))
+  echo($debugType(n))
 
 proc debug(n: PNode) =
-  msgWriteln($debugTree(n, 0, 100))
+  echo($debugTree(n, 0, 100))
 
 const
   EmptySeq = @[]
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim
index d20704a2a..7ff33f918 100644
--- a/compiler/semtypinst.nim
+++ b/compiler/semtypinst.nim
@@ -203,14 +203,14 @@ proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym =
   # symbol is not our business:
   if cl.owner != nil and s.owner != cl.owner:
     return s
-  result = PSym(idTableGet(cl.symMap, s))
-  if result == nil:
-    result = copySym(s, false)
-    incl(result.flags, sfFromGeneric)
-    idTablePut(cl.symMap, s, result)
-    result.owner = s.owner
-    result.typ = replaceTypeVarsT(cl, s.typ)
-    result.ast = replaceTypeVarsN(cl, s.ast)
+  #result = PSym(idTableGet(cl.symMap, s))
+  #if result == nil:
+  result = copySym(s, false)
+  incl(result.flags, sfFromGeneric)
+  #idTablePut(cl.symMap, s, result)
+  result.owner = s.owner
+  result.typ = replaceTypeVarsT(cl, s.typ)
+  result.ast = replaceTypeVarsN(cl, s.ast)
 
 proc lookupTypeVar(cl: var TReplTypeVars, t: PType): PType =
   result = PType(idTableGet(cl.typeMap, t))
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index ceadc2fea..e67942cb2 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1301,11 +1301,8 @@ proc paramTypesMatchAux(m: var TCandidate, f, argType: PType,
         arg.typ.n = evaluated
         argType = arg.typ
 
-  var
-    a = if c.inTypeClass > 0: argType.skipTypes({tyTypeDesc, tyFieldAccessor})
-        else: argType
-
-    r = typeRel(m, f, a)
+  var a = argType
+  var r = typeRel(m, f, a)
 
   if r != isNone and m.calleeSym != nil and
      m.calleeSym.kind in {skMacro, skTemplate}:
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index e4435294f..47f16a013 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -108,8 +108,8 @@ proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) =
 proc gABI(c: PCtx; n: PNode; opc: TOpcode; a, b: TRegister; imm: BiggestInt) =
   # Takes the `b` register and the immediate `imm`, appies the operation `opc`,
   # and stores the output value into `a`.
-  # `imm` is signed and must be within [-127, 128]
-  if imm >= -127 and imm <= 128:
+  # `imm` is signed and must be within [-128, 127]
+  if imm >= -128 and imm <= 127:
     let ins = (opc.uint32 or (a.uint32 shl 8'u32) or
                              (b.uint32 shl 16'u32) or
                              (imm+byteExcess).uint32 shl 24'u32).TInstr
@@ -121,8 +121,8 @@ proc gABI(c: PCtx; n: PNode; opc: TOpcode; a, b: TRegister; imm: BiggestInt) =
 
 proc gABx(c: PCtx; n: PNode; opc: TOpcode; a: TRegister = 0; bx: int) =
   # Applies `opc` to `bx` and stores it into register `a`
-  # `bx` must be signed and in the range [-32767, 32768]
-  if bx >= -32767 and bx <= 32768:
+  # `bx` must be signed and in the range [-32768, 32767]
+  if bx >= -32768 and bx <= 32767:
     let ins = (opc.uint32 or a.uint32 shl 8'u32 or
               (bx+wordExcess).uint32 shl 16'u32).TInstr
     c.code.add(ins)