From 9d02ca51d15518a39ca92450022750a38b1fb544 Mon Sep 17 00:00:00 2001 From: div72 <60045611+div72@users.noreply.github.com> Date: Wed, 30 Jun 2021 14:47:13 +0300 Subject: [PATCH] checker: relax naming requirements for translated code (#10619) --- vlib/v/checker/checker.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 92ad1f4453..5e5070abdd 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -296,7 +296,8 @@ fn (mut c Checker) file_has_main_fn(file &ast.File) bool { } fn (mut c Checker) check_valid_snake_case(name string, identifier string, pos token.Position) { - if !c.pref.is_vweb && name.len > 0 && (name[0] == `_` || name.contains('._')) { + if !c.pref.is_vweb && !c.pref.translated && name.len > 0 + && (name[0] == `_` || name.contains('._')) { c.error('$identifier `$name` cannot start with `_`', pos) } if !c.pref.experimental && !c.pref.translated && util.contains_capital(name) {