diff options
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r-- | compiler/sem.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim index 041f2e127..52282d0e4 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -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: |