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:
@@ -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
|
||||
|
Reference in New Issue
Block a user