mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
fixes #332
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user