1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: fix interface name check

This commit is contained in:
Alexander Medvednikov 2020-05-06 12:32:44 +02:00
parent cc66eb1194
commit b4c93349e8

View File

@ -1477,11 +1477,12 @@ fn (mut c Checker) stmt(node ast.Stmt) {
// ast.HashStmt {}
ast.Import {}
ast.InterfaceDecl {
if !it.name[0].is_capital() {
name := it.name.after('.')
if !name[0].is_capital() {
pos := token.Position{
line_nr: it.pos.line_nr
pos: it.pos.pos + 'interface'.len
len: it.name.len
len: name.len
}
c.error('interface name must begin with capital letter', pos)
}