diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 6a1e6d31a641a3..e7feb1f9cb94ae 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -921,7 +921,7 @@ fn (mut c Checker) fail_if_immutable(mut expr ast.Expr) (string, token.Pos) { } } } else if expr.obj is ast.ConstField && expr.name in c.const_names { - if !c.inside_unsafe && !c.pref.translated { + if !c.pref.translated { // TODO: fix this in c2v, do not allow modification of all consts // in translated code c.error('cannot modify constant `${expr.name}`', expr.pos)