summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-07-22 18:49:18 +0200
committerAraq <rumpf_a@web.de>2015-07-22 18:49:18 +0200
commit5409142120cfff5ff11f81547613b199f518ccee (patch)
treedc0c6eb78f82546cf55f64e29c8e1212b9694d24 /compiler
parente6e0527fd2ee23519bfad994a12b4776fe627a84 (diff)
downloadNim-5409142120cfff5ff11f81547613b199f518ccee.tar.gz
fix recently introduced regressions
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim2
-rw-r--r--compiler/sigmatch.nim7
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 2f4a1e039..288ce1c99 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -1319,6 +1319,8 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
     putIntoDest(p, d, e.typ,
                 ropecg(p.module, "#reprAny($1, $2)", [
                 rdLoc(a), genTypeInfo(p.module, t)]))
+  of tyEmpty:
+    localError(e.info, "'repr' doesn't support 'void' type")
   else:
     putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
                                    [addrLoc(a), genTypeInfo(p.module, t)]))
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index a44df5783..ef1c01b7a 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -260,7 +260,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1;
     if i != sonsLen(n) - 1: add(result, ", ")
 
 proc typeRel*(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation
-proc concreteType(c: TCandidate, t: PType; forAny=false): PType =
+proc concreteType(c: TCandidate, t: PType): PType =
   case t.kind
   of tyArrayConstr:
     # make it an array
@@ -269,9 +269,6 @@ proc concreteType(c: TCandidate, t: PType; forAny=false): PType =
     addSonSkipIntLit(result, t.sons[1]) # XXX: semantic checking for the type?
   of tyNil:
     result = nil              # what should it be?
-  of tyEmpty:
-    if tfVoid in t.flags and not forAny: result = nil
-    else: result = t
   of tyTypeDesc:
     if c.isNoCall: result = t
     else: result = nil
@@ -974,7 +971,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
 
   of tyAnything:
     considerPreviousT:
-      var concrete = concreteType(c, a, forAny=true)
+      var concrete = concreteType(c, a)
       if concrete != nil and doBind:
         put(c.bindings, f, concrete)
       return isGeneric