TurboScript icon indicating copy to clipboard operation
TurboScript copied to clipboard

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

Open MaxGraey opened this issue 7 years ago • 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

MaxGraey avatar Jun 16 '17 15:06 MaxGraey

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

dcodeIO avatar Jun 16 '17 15:06 dcodeIO

😄 btw @dcodeIO is Array type implemented in AssemblyScript

nidin avatar Jun 16 '17 19:06 nidin

@MaxGraey I would simplify

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

to

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

nidin avatar Jun 18 '17 21:06 nidin

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);

MaxGraey avatar Jun 18 '17 21:06 MaxGraey