0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 9.0.1192: no error when class function argument shadows a member

Problem:    No error when class function argument shadows a member.
Solution:   Check for shadowing.
This commit is contained in:
Bram Moolenaar
2023-01-13 17:36:49 +00:00
parent 3213952966
commit d40f00cb43
3 changed files with 53 additions and 2 deletions

View File

@@ -639,8 +639,17 @@ def Test_interface_basics()
def Method(count: number)
endinterface
END
# TODO: this should give an error for "count" shadowing
v9.CheckScriptSuccess(lines)
v9.CheckScriptFailure(lines, 'E1340: Argument already declared in the class: count')
lines =<< trim END
vim9script
interface Some
this.value: number
def Method(value: number)
endinterface
END
v9.CheckScriptFailure(lines, 'E1340: Argument already declared in the class: value')
lines =<< trim END
vim9script