0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.0.1338: :defcompile and :disassemble can't find class method

Problem:    :defcompile and :disassemble can't find class method. (Ernie Rael)
Solution:   Make a class name and class.method name work. (closes #11984)
This commit is contained in:
Bram Moolenaar
2023-02-21 19:55:14 +00:00
parent cfce5cf542
commit 99a7c0d89c
7 changed files with 149 additions and 56 deletions

View File

@@ -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