This commit is contained in:
trustable-code 2015-12-24 00:07:03 +01:00
commit 3c557a0144
2 changed files with 20 additions and 4 deletions

View file

@ -19,10 +19,7 @@ proc genConv(n: PNode, d: PType, downcast: bool): PNode =
if (source.kind == tyObject) and (dest.kind == tyObject):
var diff = inheritanceDiff(dest, source)
if diff == high(int):
# see bug #3550 which triggers it. XXX This is a hack but I don't know yet
# how the real fix looks like:
localError(n.info, "there is no subtype relation between " &
typeToString(d) & " and " & typeToString(n.typ))
# no subtype relation, nothing to do
result = n
elif diff < 0:
result = newNodeIT(nkObjUpConv, n.info, d)