scanner: remove the "too long name" error; checker: check string() cast arg
parent
cd0b81fc5f
commit
0ad9eb5e16
|
@ -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` ')
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue