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