fix issue #3550
This commit is contained in:
parent
86bb9d8b47
commit
3c557a0144
2 changed files with 20 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue