0
0
mirror of https://github.com/vim/vim.git synced 2025-10-08 06:04:08 -04:00

patch 9.0.1821: Vim9 constructors are always static

Problem:  Vim9 constructors are always static
Solution: make the "static" keyword an error

closes: #12945

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gianmaria Bajo <mg1979.git@gmail.com>
This commit is contained in:
Gianmaria Bajo
2023-08-29 22:26:30 +02:00
committed by Christian Brabandt
parent 2ac708b548
commit 4b9777a1df
5 changed files with 52 additions and 16 deletions

View File

@@ -1317,6 +1317,18 @@ def Test_class_defcompile()
END
v9.CheckScriptFailure(lines, 'E1012: Type mismatch; expected number but got string')
lines =<< trim END
vim9script
class C
static def new()
enddef
endclass
defcompile C.new
END
v9.CheckScriptFailure(lines, 'E1370: Cannot define a "new" function as static')
# Trying to compile a function using a non-existing class variable
lines =<< trim END
vim9script