fixes #3431, fixes #3370, fixes #3468

This commit is contained in:
Araq
2015-10-25 02:22:50 +01:00
parent 77dc0e50ff
commit aa36e73ecf
2 changed files with 52 additions and 3 deletions

48
tests/method/tmultim7.nim Normal file
View File

@@ -0,0 +1,48 @@
# bug #3431
type
Lexer = object
buf*: string
pos*: int
lastchar*: char
ASTNode = object
method init*(self: var Lexer; buf: string) {.base.} =
self.buf = buf
self.pos = 0
self.lastchar = self.buf[0]
method init*(self: var ASTNode; val: string) =
discard
# bug #3370
type
RefTestA*[T] = ref object of RootObj
data*: T
method tester*[S](self: S): bool =
true
type
RefTestB* = RefTestA[(string, int)]
method tester*(self: RefTestB): bool =
true
type
RefTestC = RefTestA[string]
method tester*(self: RefTestC): bool =
false
# bug #3468
type X = ref object of RootObj
type Y = ref object of RootObj
method draw*(x: X) {.base.} = discard
method draw*(y: Y) {.base.} = discard