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

patch 9.0.1466: cannot use an object member name as a method argument

Problem:    Cannot use an object member name as a method argument.
Solution:   Do not give an error for using an object member name for a method
            argument. (Hirohito Higashi, closes #12241, closes #12225)
            Fix line number for other argument error.
This commit is contained in:
h-east
2023-04-18 19:07:29 +01:00
committed by Bram Moolenaar
parent 89f9ffbe81
commit 61378a1542
3 changed files with 22 additions and 18 deletions

View File

@@ -995,7 +995,7 @@ def Test_interface_basics()
def Method(count: number)
endinterface
END
v9.CheckScriptFailure(lines, 'E1340: Argument already declared in the class: count')
v9.CheckScriptFailure(lines, 'E1340: Argument already declared in the class: count', 5)
lines =<< trim END
vim9script
@@ -1005,7 +1005,9 @@ def Test_interface_basics()
def Method(value: number)
endinterface
END
v9.CheckScriptFailure(lines, 'E1340: Argument already declared in the class: value')
# The argument name and the object member name are the same, but this is not a
# problem because object members are always accessed with the "this." prefix.
v9.CheckScriptSuccess(lines)
lines =<< trim END
vim9script