From e210b049e99b3a42933f099f7fe0f834bcba1cf3 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 14 Feb 2014 02:29:19 +0100 Subject: fixes #712 --- compiler/sem.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0