checker: fix interface name check

pull/4752/head
Alexander Medvednikov 2020-05-06 12:32:44 +02:00
parent cc66eb1194
commit b4c93349e8
1 changed files with 3 additions and 2 deletions

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)
}