<cQ18QLphlVx7iH9N9bY-TocynQ71uPr5JqQGnkgvXoFa4vJX0tXhY4xZU57zx8chQNlfG7X12tLcyuNkpdNp0E54GFOsGjdpEc30beh5Zr4=@protonmail.com>
Good day! I wanted to ask about the append built-in, is it impossible to use it with type aliases for slices?
<CQ22UE5JBFGO.35G5EKI79XLFX@taiga>
<cQ18QLphlVx7iH9N9bY-TocynQ71uPr5JqQGnkgvXoFa4vJX0tXhY4xZU57zx8chQNlfG7X12tLcyuNkpdNp0E54GFOsGjdpEc30beh5Zr4=@protonmail.com>
(view parent)
This question is trivially answered by writing a small program to test it for yourself: type foo = []int; export fn main() void = { let x: foo = []; append(x, 10); };
<PVIDBM4bOrVGP_hwy9c6kECZ_iFWt5iqgcnYNpYd1FvJ8CGdKaK2sJHUSKp689UremZJmJAS5srSDPSUaDhz0SQ8AyfmaHrc4M1CqqowYAI=@protonmail.com>
<CQ22UE5JBFGO.35G5EKI79XLFX@taiga>
(view parent)
Apologies, I confused myself. The error in my code was elsewhere, I mixed up the var name for the type name. I did some testing, "slice type" from spec refers to any type alias for a slice type no matter the nesting, right?
<CQ23C1ZPJRCN.EO9YSZ14JZDR@taiga>
<PVIDBM4bOrVGP_hwy9c6kECZ_iFWt5iqgcnYNpYd1FvJ8CGdKaK2sJHUSKp689UremZJmJAS5srSDPSUaDhz0SQ8AyfmaHrc4M1CqqowYAI=@protonmail.com>
(view parent)
On Thu Jan 26, 2023 at 12:36 PM CET, KAAtheWise wrote: > I did some testing, "slice type" from spec refers to any type alias for > a slice type no matter the nesting, right? Yes.
<gj2cM7f7y6b2ehCgDN_74iPdO_0DGsINO7MLYrcPh8BT0IVQsxXEzK8RphXCP9sdabM_W_Nn2LcmmhY6t7DLkhDzAYKMB7Wcis-z0KqrSwE=@protonmail.com>
<CQ23C1ZPJRCN.EO9YSZ14JZDR@taiga>
(view parent)
Thanks!