Mercurial > vim
view src/testdir/test_ex_equal.vim @ 33211:71a097aab64d v9.0.1883
patch 9.0.1883: Vim9: Calling an interface method using a child object fails
Commit: https://github.com/vim/vim/commit/cc0bcf4c9f4133750f5ee99c685ba995a1b840fd
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Fri Sep 8 19:12:03 2023 +0200
patch 9.0.1883: Vim9: Calling an interface method using a child object fails
Problem: Vim9: Calling an interface method using a child object fails
Solution: Search methods of parent class
When a class implementing an interface is extended by another class and
a child class instance is passed to a function that accepts the
interface, calling an interface method doesn't work properly.
closes: #13053
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 08 Sep 2023 19:15:08 +0200 |
parents | 08940efa6b4e |
children |
line wrap: on
line source
" Test Ex := command. func Test_ex_equal() new call setline(1, ["foo\tbar", "bar\tfoo"]) let a = execute('=') call assert_equal("\n2", a) let a = execute('=#') call assert_equal("\n2\n 1 foo bar", a) let a = execute('=l') call assert_equal("\n2\nfoo^Ibar$", a) let a = execute('=p') call assert_equal("\n2\nfoo bar", a) let a = execute('=l#') call assert_equal("\n2\n 1 foo^Ibar$", a) let a = execute('=p#') call assert_equal("\n2\n 1 foo bar", a) let a = execute('.=') call assert_equal("\n1", a) call assert_fails('3=', 'E16:') call assert_fails('=x', 'E488:') bwipe! endfunc " vim: shiftwidth=2 sts=2 expandtab