summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-09-17 23:13:38 +0200
committerAraq <rumpf_a@web.de>2014-09-17 23:13:38 +0200
commit02c076f9b42e0d65d1b4416e671a8f9cfae6d9b1 (patch)
tree0d7152353c9362486628084777decc2f74e6c199
parent1ce17c7aaada713755698ef49af7861a05dc333b (diff)
downloadNim-02c076f9b42e0d65d1b4416e671a8f9cfae6d9b1.tar.gz
more robust for nim check
-rw-r--r--compiler/types.nim1
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