Skip to content

Commit 71a699c

Browse files
committed
parser: fix detection of static variables
1 parent 553b3af commit 71a699c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

std/jule/parser/parser.jule

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,9 @@ impl parser {
13791379
if v != nil {
13801380
v.Public = false
13811381
v.Binded = true
1382-
v.Static = true
1382+
if !v.Constant {
1383+
v.Static = true
1384+
}
13831385
if v.Expr != nil {
13841386
self.pushErr(v.Token, log::BindedVarHasExpr)
13851387
}
@@ -1586,7 +1588,7 @@ impl parser {
15861588
| token::Const
15871589
| token::Mut:
15881590
mut v := self.buildVar(tokens)
1589-
if v != nil {
1591+
if v != nil && !v.Constant {
15901592
v.Static = true
15911593
}
15921594
ret v

0 commit comments

Comments
 (0)