fix recently introduced regressions
This commit is contained in:
parent
e6e0527fd2
commit
5409142120
3 changed files with 5 additions and 6 deletions
|
|
@ -1319,6 +1319,8 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
putIntoDest(p, d, e.typ,
|
putIntoDest(p, d, e.typ,
|
||||||
ropecg(p.module, "#reprAny($1, $2)", [
|
ropecg(p.module, "#reprAny($1, $2)", [
|
||||||
rdLoc(a), genTypeInfo(p.module, t)]))
|
rdLoc(a), genTypeInfo(p.module, t)]))
|
||||||
|
of tyEmpty:
|
||||||
|
localError(e.info, "'repr' doesn't support 'void' type")
|
||||||
else:
|
else:
|
||||||
putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
|
putIntoDest(p, d, e.typ, ropecg(p.module, "#reprAny($1, $2)",
|
||||||
[addrLoc(a), genTypeInfo(p.module, t)]))
|
[addrLoc(a), genTypeInfo(p.module, t)]))
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ proc describeArgs*(c: PContext, n: PNode, startIdx = 1;
|
||||||
if i != sonsLen(n) - 1: add(result, ", ")
|
if i != sonsLen(n) - 1: add(result, ", ")
|
||||||
|
|
||||||
proc typeRel*(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation
|
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
|
case t.kind
|
||||||
of tyArrayConstr:
|
of tyArrayConstr:
|
||||||
# make it an array
|
# 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?
|
addSonSkipIntLit(result, t.sons[1]) # XXX: semantic checking for the type?
|
||||||
of tyNil:
|
of tyNil:
|
||||||
result = nil # what should it be?
|
result = nil # what should it be?
|
||||||
of tyEmpty:
|
|
||||||
if tfVoid in t.flags and not forAny: result = nil
|
|
||||||
else: result = t
|
|
||||||
of tyTypeDesc:
|
of tyTypeDesc:
|
||||||
if c.isNoCall: result = t
|
if c.isNoCall: result = t
|
||||||
else: result = nil
|
else: result = nil
|
||||||
|
|
@ -974,7 +971,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
|
||||||
|
|
||||||
of tyAnything:
|
of tyAnything:
|
||||||
considerPreviousT:
|
considerPreviousT:
|
||||||
var concrete = concreteType(c, a, forAny=true)
|
var concrete = concreteType(c, a)
|
||||||
if concrete != nil and doBind:
|
if concrete != nil and doBind:
|
||||||
put(c.bindings, f, concrete)
|
put(c.bindings, f, concrete)
|
||||||
return isGeneric
|
return isGeneric
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
line: 9
|
line: 9
|
||||||
errormsg: "type mismatch: got (empty)"
|
errormsg: "'repr' doesn't support 'void' type"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# bug #2879
|
# bug #2879
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue