diff options
author | Araq <rumpf_a@web.de> | 2014-02-14 02:29:19 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-14 02:29:19 +0100 |
commit | e210b049e99b3a42933f099f7fe0f834bcba1cf3 (patch) | |
tree | 1a85a7a5789dbe2eb4edb12430c1addab8c9d20c /compiler | |
parent | f2216b8e3256312f827e645c4488828145b54328 (diff) | |
download | Nim-e210b049e99b3a42933f099f7fe0f834bcba1cf3.tar.gz |
fixes #712
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sem.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim index 845d4ae71..140687721 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -120,7 +120,8 @@ proc commonType*(x, y: PType): PType = if a.kind == tyObject and b.kind == tyObject: result = commonSuperclass(a, b) # this will trigger an error later: - if result.isNil: return x + if result.isNil or result == a: return x + if result == b: return y if k != tyNone: let r = result result = newType(k, r.owner) |