aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't use vector_reserve() as a default value for a class/struct field.

MortimerSnerd opened this issue · comments

Or you can, but you just get zero length array. Example:

class Blass:
   arf: [int] = vector_reserve(typeof return, 12)

let b = Blass{}
print("count {length(b.arf)}")   // prints "count 0"

I'd be happy with a compile error if it's just something that's not supported.

Nevermind, my brain is not working today. I forgot it reserves, but the length is still at 0.