diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index ade202dc1afa2..312afec1a5c1f 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -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) diff --git a/tests/method/tmultim8.nim b/tests/method/tmultim8.nim new file mode 100644 index 0000000000000..0d067b668bfd3 --- /dev/null +++ b/tests/method/tmultim8.nim @@ -0,0 +1,19 @@ + +# bug #3550 + +type + BaseClass = ref object of RootObj + Class1 = ref object of BaseClass + Class2 = ref object of BaseClass + +method test(obj: Class1, obj2: BaseClass) = + discard + +method test(obj: Class2, obj2: BaseClass) = + discard + +var obj1 = Class1() +var obj2 = Class2() + +obj1.test(obj2) +obj2.test(obj1)