Skip to content

Commit

Permalink
sema: add array support to dynamic type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Apr 26, 2024
1 parent 27a9b9e commit 66a6739
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions std/jule/sema/type2.jule
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,16 @@ impl DynamicTypeAnnotation {
ret self.annotate_any(k)
}

unsafe fn annotate_arr(mut self, mut &k: &TypeKind): (ok: bool) {
let mut parr = (*self.k).arr()
if parr == nil {
ret false
}
let mut arr = k.arr()
self.k = &parr.elem
ret self.annotate_kind(arr.elem)
}

unsafe fn annotate_slc(mut self, mut &k: &TypeKind): (ok: bool) {
let mut pslc = (*self.k).slc()
if pslc == nil {
Expand Down Expand Up @@ -626,6 +636,8 @@ impl DynamicTypeAnnotation {
ret true
| k.prim() != nil:
ret self.annotate_prim(k)
| k.arr() != nil:
ret self.annotate_arr(k)
| k.slc() != nil:
ret self.annotate_slc(k)
| k.map() != nil:
Expand Down

0 comments on commit 66a6739

Please sign in to comment.