parent
d1a0ac26fd
commit
2109a6a85c
|
@ -0,0 +1,6 @@
|
|||
vlib/v/checker/tests/interface_method_name_err.vv:2:2: error: method name `Fizz` cannot contain uppercase letters, use snake_case instead
|
||||
1 | interface Foo {
|
||||
2 | Fizz()
|
||||
| ~~~~~~
|
||||
3 | }
|
||||
4 |
|
|
@ -0,0 +1,6 @@
|
|||
interface Foo {
|
||||
Fizz()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
|
@ -516,7 +516,8 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
|
|||
mut mut_pos := -1
|
||||
mut ifaces := []ast.InterfaceEmbedding{}
|
||||
for p.tok.kind != .rcbr && p.tok.kind != .eof {
|
||||
if p.tok.kind == .name && p.tok.lit.len > 0 && p.tok.lit[0].is_capital() {
|
||||
if p.tok.kind == .name && p.tok.lit.len > 0 && p.tok.lit[0].is_capital()
|
||||
&& p.peek_tok.kind != .lpar {
|
||||
iface_pos := p.tok.pos()
|
||||
mut iface_name := p.tok.lit
|
||||
iface_type := p.parse_type()
|
||||
|
@ -584,10 +585,6 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
|
|||
p.error_with_pos('duplicate method `$name`', method_start_pos)
|
||||
return ast.InterfaceDecl{}
|
||||
}
|
||||
if language == .v && util.contains_capital(name) {
|
||||
p.error('interface methods cannot contain uppercase letters, use snake_case instead')
|
||||
return ast.InterfaceDecl{}
|
||||
}
|
||||
// field_names << name
|
||||
args2, _, is_variadic := p.fn_args() // TODO merge ast.Param and ast.Arg to avoid this
|
||||
mut args := [
|
||||
|
|
Loading…
Reference in New Issue