diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/metatype/tautonotgeneric.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/metatype/tautonotgeneric.nim b/tests/metatype/tautonotgeneric.nim new file mode 100644 index 000000000..a55ae488e --- /dev/null +++ b/tests/metatype/tautonotgeneric.nim @@ -0,0 +1,15 @@ +discard """ + output: "wof!" +""" + +# bug #1659 +type Animal = ref object {.inheritable.} +type Dog = ref object of Animal + +method say(a: Animal): auto = "wat!" +method say(a: Dog): auto = "wof!" + +proc saySomething(a: Animal): auto = a.say() + +var a = Dog() +echo saySomething(a) |