Skip to content

Commit

Permalink
jule: add map and array literals with explicit type
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jan 21, 2025
1 parent 1c3032c commit 3dcf34c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion std/jule/sema/eval.jule
Original file line number Diff line number Diff line change
@@ -1912,11 +1912,16 @@ impl eval {
mut prefix := self.prefix
self.prefix = nil
defer { self.prefix = prefix }
if t.Slice() != nil {
if t.Slice() != nil || t.Array() != nil {
match type e.Kind {
| &ast::SliceExpr:
self.prefix = t
}
} else if t.Map() != nil {
match type e.Kind {
| &ast::BraceLit:
self.prefix = t
}
}
mut v := self.evalExpr(e)
if v == nil || self.prefix != nil {

0 comments on commit 3dcf34c

Please sign in to comment.