Open faze-geek opened 7 months ago
Yeah I had given a thought on this, some days back and I think we could surely address this.
The way to do it would be very similar to how list assignment is being resolved through the symbolic ASR pass. So we go from snippet 1 to snippet 2
// snippet 1
l1: list[S] = [x]
// snippet 2
_l1 : list[CPtr] = [x]
l1: List{CPtr] = []
for i in range(len(_l1)):
tmp: CPtr = basic_new_heap()
l1.append(tmp)
basic_assign(l1[i], _l1[i])
This can be addressed similarly
1) Create a temporary list for l
of type list[Str]
2) Use a for loop going over length of l
3) append basic_str(l1[i])
to temporary list
4) print(temporary list)