summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
authorcooldome <ariabushenko@bk.ru>2018-04-29 23:28:18 +0100
committercooldome <ariabushenko@bk.ru>2018-04-29 23:28:18 +0100
commit3e5c94664d0d490340bc1a0c23ff129d284aae23 (patch)
tree08c1ea5e3e3cf20cb67c05e415f5a659d0d60484 /compiler/sem.nim
parent0ef93bdea4dba268e7e30e31aab7922ee55168f7 (diff)
parent9d77f61038ddabeb4b59847d709e6d722e743082 (diff)
downloadNim-3e5c94664d0d490340bc1a0c23ff129d284aae23.tar.gz
merge devel
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r--compiler/sem.nim5
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: