scanner: remove the "too long name" error; checker: check string() cast arg

pull/3988/head
Alexander Medvednikov 2020-03-11 06:46:14 +01:00
parent cd0b81fc5f
commit 0ad9eb5e16
2 changed files with 5 additions and 0 deletions

View File

@ -1002,7 +1002,9 @@ fn good_type_name(s string) bool {
// registration_date good
// registrationdate bad
fn (s &Scanner) validate_var_name(name string) {
/*
if name.len > 15 && !name.contains('_') {
s.error('bad variable name `$name`\n' + 'looks like you have a multi-word name without separating them with `_`' + '\nfor example, use `registration_date` instead of `registrationdate` ')
}
*/
}

View File

@ -591,6 +591,9 @@ pub fn (c mut Checker) expr(node ast.Expr) table.Type {
}
ast.CastExpr {
c.expr(it.expr)
if it.has_arg {
c.expr(it.arg)
}
return it.typ
}
ast.CallExpr {