This commit is contained in:
Araq
2013-03-17 23:40:03 +01:00
parent 3620155d93
commit 65319ba22d
2 changed files with 14 additions and 2 deletions

View File

@@ -108,8 +108,8 @@ proc methodDef*(s: PSym, fromCache: bool) =
proc relevantCol(methods: TSymSeq, col: int): bool =
# returns true iff the position is relevant
var t = methods[0].typ.sons[col]
if skipTypes(t, skipPtrs).kind == tyObject:
var t = methods[0].typ.sons[col].skipTypes(skipPtrs)
if t.kind == tyObject:
for i in countup(1, high(methods)):
let t2 = skipTypes(methods[i].typ.sons[col], skipPtrs)
if not SameType(t2, t):

View File

@@ -5,6 +5,18 @@ discard """
method somethin(obj: TObject) =
echo "do nothing"
type
TNode* = object {.inheritable.}
PNode* = ref TNode
PNodeFoo* = ref object of TNode
TSomethingElse = object
PSomethingElse = ref TSomethingElse
method foo(a: PNode, b: PSomethingElse) = nil
method foo(a: PNodeFoo, b: PSomethingElse) = nil
var o: TObject
o.somethin()