fmt: support static too

pull/8924/head
Delyan Angelov 2021-02-28 13:08:16 +02:00
parent 7e08e84bc1
commit 276c08e7f7
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr, left_comments []ast.Comme
iv := lx.info as ast.IdentVar
share = iv.share
if iv.is_static {
if !p.pref.translated {
if !p.pref.translated && !p.pref.is_fmt {
p.error_with_pos('static variables are supported only in -translated mode',
lx.pos)
return ast.Stmt{}