01alchemist/TurboScript

User wants int32[] as well as Array<int32>

Opened this issue · 4 comments

How

let arr1: int32[] = new Array<int32>(1);
let arr2: int32[] = new int32[](2); // if possible and make sense
let arr3: int32[] = new Array(3); // implicitly type detection

Sorry, posted here but then noticed that it's the wrong repo ^^

nidin commented

😄 btw @dcodeIO is Array type implemented in AssemblyScript

nidin commented

@MaxGraey I would simplify

let arr2: int32[] = new int32[](2);

to

let arr2: int32[] = [](2);

I think new keyword should be exists.

let arr2: int32[] = new [](2);

The best solution in my opinion (shortest and compatible):

let arr2 = new int32[](2);