better error handling for bug #3550

This commit is contained in:
Araq 2015-11-18 13:32:16 +01:00
commit 528cf3eae4

View file

@ -23,8 +23,8 @@ proc genConv(n: PNode, d: PType, downcast: bool): PNode =
# how the real fix looks like: # how the real fix looks like:
localError(n.info, "there is no subtype relation between " & localError(n.info, "there is no subtype relation between " &
typeToString(d) & " and " & typeToString(n.typ)) typeToString(d) & " and " & typeToString(n.typ))
#internalError(n.info, "cgmeth.genConv") result = n
if diff < 0: elif diff < 0:
result = newNodeIT(nkObjUpConv, n.info, d) result = newNodeIT(nkObjUpConv, n.info, d)
addSon(result, n) addSon(result, n)
if downcast: internalError(n.info, "cgmeth.genConv: no upcast allowed") if downcast: internalError(n.info, "cgmeth.genConv: no upcast allowed")