diff options
author | Araq <rumpf_a@web.de> | 2014-09-17 23:13:38 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-09-17 23:13:38 +0200 |
commit | 02c076f9b42e0d65d1b4416e671a8f9cfae6d9b1 (patch) | |
tree | 0d7152353c9362486628084777decc2f74e6c199 | |
parent | 1ce17c7aaada713755698ef49af7861a05dc333b (diff) | |
download | Nim-02c076f9b42e0d65d1b4416e671a8f9cfae6d9b1.tar.gz |
more robust for nim check
-rw-r--r-- | compiler/types.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/types.nim b/compiler/types.nim index 7b59fbf20..7a9b6bb85 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -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 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 var x = a |