more robust for nim check

This commit is contained in:
Araq 2014-09-17 23:13:38 +02:00
commit 02c076f9b4

View file

@ -969,6 +969,7 @@ proc inheritanceDiff*(a, b: PType): int =
# | returns: -x iff `a` is the x'th direct superclass of `b` # | returns: -x iff `a` is the x'th direct superclass of `b`
# | returns: +x iff `a` is the x'th direct subclass of `b` # | returns: +x iff `a` is the x'th direct subclass of `b`
# | returns: `maxint` iff `a` and `b` are not compatible at all # | returns: `maxint` iff `a` and `b` are not compatible at all
if a == b or a.kind == tyError or b.kind == tyError: return 0
assert a.kind == tyObject assert a.kind == tyObject
assert b.kind == tyObject assert b.kind == tyObject
var x = a var x = a