fixed merge conflict

This commit is contained in:
Andreas Rumpf 2018-06-04 16:16:50 +02:00
commit 12996c08a1
30 changed files with 879 additions and 332 deletions

View file

@ -1100,7 +1100,7 @@ proc getSomeInitName(m: PSym, suffix: string): Rope =
if {sfSystemModule, sfMainModule} * m.flags == {}:
result = m.owner.name.s.mangle.rope
result.add "_"
result.add m.name.s
result.add m.name.s.mangle
result.add suffix
proc getInitName(m: PSym): Rope =

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

View file

@ -1044,7 +1044,7 @@ proc inheritanceDiff*(a, b: PType): int =
inc(result)
result = high(int)
proc commonSuperclass*(a, b: PType): PType =
proc commonSuperclass*(a, b: PType, k: TTypeKind): PType =
# quick check: are they the same?
if sameObjectTypes(a, b): return a
@ -1060,8 +1060,12 @@ proc commonSuperclass*(a, b: PType): PType =
x = x.sons[0]
var y = b
while y != nil:
var t = y # bug #7818, save type before skip
y = skipTypes(y, skipPtrs)
if ancestors.contains(y.id): return y
if ancestors.contains(y.id):
# bug #7818, defer the previous skipTypes
if k in {tyRef, tyPtr}: t = y
return t
y = y.sons[0]
type