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

checker: fix mut check bypass with for in loops (#12208)

This commit is contained in:
05st
2021-10-16 22:41:39 -05:00
committed by GitHub
parent e6b7ab8b9d
commit fd3a10ab43
7 changed files with 36 additions and 11 deletions

View File

@@ -15,12 +15,12 @@ pub fn new_transformer(pref &pref.Preferences) &Transformer {
pub fn (t Transformer) transform_files(ast_files []&ast.File) {
for i in 0 .. ast_files.len {
file := unsafe { ast_files[i] }
t.transform(file)
mut file := unsafe { ast_files[i] }
t.transform(mut file)
}
}
pub fn (t Transformer) transform(ast_file &ast.File) {
pub fn (t Transformer) transform(mut ast_file ast.File) {
for mut stmt in ast_file.stmts {
t.stmt(mut stmt)
}