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

patch 9.0.1157: "implements" only handles one interface name

Problem:    "implements" only handles one interface name.
Solution:   Handle a comma separated list of names.  Check for duplicate
            names.
This commit is contained in:
Bram Moolenaar
2023-01-07 14:51:03 +00:00
parent 0cb3ca9f7a
commit df8f947359
4 changed files with 81 additions and 13 deletions

View File

@@ -627,9 +627,48 @@ def Test_class_implements_interface()
echo nr
enddef
endclass
interface Another
this.member: string
endinterface
class SomeImpl implements Some, Another
this.member = 'abc'
static count: number
def Method(nr: number)
echo nr
enddef
endclass
END
v9.CheckScriptSuccess(lines)
lines =<< trim END
vim9script
interface Some
static counter: number
endinterface
class SomeImpl implements Some implements Some
static count: number
endclass
END
v9.CheckScriptFailure(lines, 'E1350:')
lines =<< trim END
vim9script
interface Some
static counter: number
endinterface
class SomeImpl implements Some, Some
static count: number
endclass
END
v9.CheckScriptFailure(lines, 'E1351: Duplicate interface after "implements": Some')
lines =<< trim END
vim9script