forked from aniani/vim
patch 9.0.1928: Vim9: constructor type checking bug
Problem: Vim9: constructor type checking bug Solution: Fix class constructor regression closes: #13102 closes: #13113 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: h-east <h.east.727@gmail.com>
This commit is contained in:
committed by
Christian Brabandt
parent
ceee7a808c
commit
b895b0fabc
@@ -921,6 +921,27 @@ def Test_class_new_with_object_member()
|
||||
Check()
|
||||
END
|
||||
v9.CheckSourceFailure(lines, 'E1013:')
|
||||
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
||||
class C
|
||||
this.str: string
|
||||
def new(str: any)
|
||||
enddef
|
||||
endclass
|
||||
|
||||
def Check()
|
||||
try
|
||||
var c = C.new(1)
|
||||
catch
|
||||
assert_report($'Unexpected exception was caught: {v:exception}')
|
||||
endtry
|
||||
enddef
|
||||
|
||||
Check()
|
||||
END
|
||||
v9.CheckSourceSuccess(lines)
|
||||
enddef
|
||||
|
||||
def Test_class_object_member_inits()
|
||||
|
||||
Reference in New Issue
Block a user