* fixes #7601, array construction of ptr generics * add more test
This commit is contained in:
parent
822d2b5085
commit
07d6ff4be4
3 changed files with 71 additions and 2 deletions
|
|
@ -153,8 +153,9 @@ proc commonType*(x, y: PType): PType =
|
|||
if a.kind in {tyRef, tyPtr}:
|
||||
k = a.kind
|
||||
if b.kind != a.kind: return x
|
||||
a = a.lastSon
|
||||
b = b.lastSon
|
||||
# bug #7601, array construction of ptr generic
|
||||
a = a.lastSon.skipTypes({tyGenericInst})
|
||||
b = b.lastSon.skipTypes({tyGenericInst})
|
||||
if a.kind == tyObject and b.kind == tyObject:
|
||||
result = commonSuperclass(a, b)
|
||||
# this will trigger an error later:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue