summary refs log tree commit diff stats
path: root/tests/method
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-10-25 02:22:50 +0100
committerAraq <rumpf_a@web.de>2015-10-25 02:22:50 +0100
commitaa36e73ecf1e09367a5e94de6c3af488449eb4f6 (patch)
treec135ef199ca93b5564930460b529455d5d6a5a20 /tests/method
parent77dc0e50ff8da88a567281dde86216150126f54e (diff)
downloadNim-aa36e73ecf1e09367a5e94de6c3af488449eb4f6.tar.gz
fixes #3431, fixes #3370, fixes #3468
Diffstat (limited to 'tests/method')
-rw-r--r--tests/method/tmultim7.nim48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/method/tmultim7.nim b/tests/method/tmultim7.nim
new file mode 100644
index 000000000..7a8859679
--- /dev/null
+++ b/tests/method/tmultim7.nim
@@ -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