Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

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

Open
MaxGraey opened this issue Jun 16, 2017 · 4 comments
Open

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

MaxGraey opened this issue Jun 16, 2017 · 4 comments

Comments

@MaxGraey
Copy link
Contributor

MaxGraey commented Jun 16, 2017

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
@dcodeIO
Copy link
Contributor

dcodeIO commented Jun 16, 2017

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

@nidin
Copy link
Contributor

nidin commented Jun 16, 2017

😄 btw @dcodeIO is Array type implemented in AssemblyScript

@nidin
Copy link
Contributor

nidin commented Jun 18, 2017

@MaxGraey I would simplify

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

to

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

@MaxGraey
Copy link
Contributor Author

MaxGraey commented Jun 18, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants