fixes #7818, correct internal representation of generic objects array construction (#7824)

* defer skiptypes
* defer skiptypes for tyRef & tyPtr
* remove unneeded skipTypes
This commit is contained in:
andri lim 2018-05-29 14:38:52 +07:00 • committed by Andreas Rumpf
commit 25a41d5d90
3 changed files with 52 additions and 3 deletions

View file

@ -158,7 +158,7 @@ proc commonType*(x, y: PType): PType =
a = a.lastSon.skipTypes({tyGenericInst})
b = b.lastSon.skipTypes({tyGenericInst})
if a.kind == tyObject and b.kind == tyObject:
result = commonSuperclass(a, b)
result = commonSuperclass(a, b, k)
# this will trigger an error later:
if result.isNil or result == a: return x
if result == b: return y