* fix #16516 * fix comment * Trigger build
This commit is contained in:
parent
d721f5ceca
commit
58b9191354
2 changed files with 34 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ proc sameMethodBucket(a, b: PSym; multiMethods: bool): MethodResult =
|
||||||
while true:
|
while true:
|
||||||
aa = skipTypes(aa, {tyGenericInst, tyAlias})
|
aa = skipTypes(aa, {tyGenericInst, tyAlias})
|
||||||
bb = skipTypes(bb, {tyGenericInst, tyAlias})
|
bb = skipTypes(bb, {tyGenericInst, tyAlias})
|
||||||
if aa.kind == bb.kind and aa.kind in {tyVar, tyPtr, tyRef, tyLent}:
|
if aa.kind == bb.kind and aa.kind in {tyVar, tyPtr, tyRef, tyLent, tySink}:
|
||||||
aa = aa.lastSon
|
aa = aa.lastSon
|
||||||
bb = bb.lastSon
|
bb = bb.lastSon
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ discard """
|
||||||
output: '''
|
output: '''
|
||||||
wof!
|
wof!
|
||||||
wof!
|
wof!
|
||||||
|
type A
|
||||||
|
type B
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -126,3 +128,34 @@ var obj2 = Class2()
|
||||||
|
|
||||||
obj1.test(obj2)
|
obj1.test(obj2)
|
||||||
obj2.test(obj1)
|
obj2.test(obj1)
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------
|
||||||
|
# issue #16516
|
||||||
|
|
||||||
|
type
|
||||||
|
A = ref object of RootObj
|
||||||
|
x: int
|
||||||
|
|
||||||
|
B = ref object of A
|
||||||
|
|
||||||
|
method foo(v: sink A, lst: var seq[A]) {.base,locks:0.} =
|
||||||
|
echo "type A"
|
||||||
|
lst.add v
|
||||||
|
|
||||||
|
method foo(v: sink B, lst: var seq[A]) =
|
||||||
|
echo "type B"
|
||||||
|
lst.add v
|
||||||
|
|
||||||
|
proc main() =
|
||||||
|
let
|
||||||
|
a = A(x: 5)
|
||||||
|
b: A = B(x: 5)
|
||||||
|
|
||||||
|
var lst: seq[A]
|
||||||
|
|
||||||
|
foo(a, lst)
|
||||||
|
foo(b, lst)
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue