diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-02-21 19:55:14 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-21 19:55:14 +0000 |
commit | 99a7c0d89cf77c0a908b60191e63f41f04f9e793 (patch) | |
tree | f69745ee2fa5641b0934326c92cdd6920df59e56 /src/testdir | |
parent | cfce5cf542db20c7beba5b4211c0ae3305a64a43 (diff) |
patch 9.0.1338: :defcompile and :disassemble can't find class methodv9.0.1338
Problem: :defcompile and :disassemble can't find class method. (Ernie Rael)
Solution: Make a class name and class.method name work. (closes #11984)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_class.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_class.vim b/src/testdir/test_vim9_class.vim index d1f361a919..c268dde50e 100644 --- a/src/testdir/test_vim9_class.vim +++ b/src/testdir/test_vim9_class.vim @@ -842,6 +842,34 @@ def Test_class_function() v9.CheckScriptSuccess(lines) enddef +def Test_class_defcompile() + var lines =<< trim END + vim9script + + class C + def Fo(i: number): string + return i + enddef + endclass + + defcompile C.Fo + END + v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected string but got number') + + lines =<< trim END + vim9script + + class C + static def Fc(): number + return 'x' + enddef + endclass + + defcompile C.Fc + END + v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected number but got string') +enddef + def Test_class_object_to_string() var lines =<< trim END vim9script |