Of operator in vm fixes [backport] (#9717)

* fixes #9701
*  fixes #9702
* optimize of statement to bool
This commit is contained in:
cooldome 2018-11-15 12:03:42 +00:00 • committed by Andreas Rumpf
commit 8c1083d3b7
6 changed files with 65 additions and 7 deletions

View file

@ -1086,8 +1086,8 @@ proc inheritanceDiff*(a, b: PType): int =
# | returns: +x iff `a` is the x'th direct subclass of `b`
# | 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 b.kind == tyObject
assert a.kind in {tyObject} + skipPtrs
assert b.kind in {tyObject} + skipPtrs
var x = a
result = 0
while x != nil: