1
0
forked from aniani/vim

patch 9.0.1204: expression compiled the wrong way after using an object

Problem:    Expression compiled the wrong way after using an object.
Solution:   Generate constants before getting the type.
This commit is contained in:
Bram Moolenaar
2023-01-15 20:18:55 +00:00
parent 32517c4c14
commit 912bfee710
3 changed files with 54 additions and 30 deletions

View File

@@ -240,6 +240,25 @@ def Test_list_of_objects()
v9.CheckScriptSuccess(lines)
enddef
def Test_expr_after_using_object()
var lines =<< trim END
vim9script
class Something
this.label: string = ''
endclass
def Foo(): Something
var v = Something.new()
echo 'in Foo(): ' .. typename(v)
return v
enddef
Foo()
END
v9.CheckScriptSuccess(lines)
enddef
def Test_class_default_new()
var lines =<< trim END
vim9script