carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

var a: [i32;] = (i, i, i);

Open Zhanytrix opened this issue 3 years ago • 5 comments

Hello, I was reading the documentation and I was playing around with carbon until I got into this:

var i: i32 = 1;
// `[i32;]` equivalent to `[i32; 3]` here.
var a: [i32;] = (i, i, i);

The var a: [i32;] = (i, i) gives me this error COMPILATION ERROR: ../TestCarbon/prova2.carb:24: syntax error, unexpected RIGHT_SQUARE_BRACKET It wants a number after the semicolon or it will not work (as said in the wiki)

Ready to reply to give more info if needed!

Zhanytrix avatar Jul 23 '22 01:07 Zhanytrix

I think here that mainly some features aren't yet implemented in the explorer. This is likely one of them.

jonmeow avatar Jul 23 '22 01:07 jonmeow

Hi I found other things not working as the documentation says: For example; for (var name: String in names) will give unexpected VAR. If I remove it for (name: String in names) it will give unexpected COLON Console.Print() in any case will give me syntax error, unexpected intrinsic_identifier, expecting identifier or LEFT_PARENTHESIS I cannot do things like i += 1 (like the documentation says) it will give me syntax error, unexpected EQUAL

Zhanytrix avatar Jul 23 '22 01:07 Zhanytrix

I'd recommend reporting that separately (we have not implemented for at all, it's actually treating that as a function call). It's a different feature, and we expect the explorer to be incomplete versus the design.

jonmeow avatar Jul 23 '22 01:07 jonmeow

Filed as #1592 just to track it.

jonmeow avatar Jul 23 '22 01:07 jonmeow

Ok I'll report tomorrow

Zhanytrix avatar Jul 23 '22 01:07 Zhanytrix

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Oct 21 '22 02:10 github-actions[bot]

@Zhanytrix sir can you please assign me this issue wanna contribute on this.__

shankkyy avatar Mar 19 '23 04:03 shankkyy

@ Zhanytrix sir can you please assign me this issue wanna contribute on this.__

@shankkyy Please feel free to work on this, but we don't assign issues to new contributors because some people have different time constraints, and we want new contributors to feel welcome to pick the issue up when it may not be making progress. (as noted here)

jonmeow avatar Mar 20 '23 16:03 jonmeow

I want to work on this issue.Can you please assign me to this?

SoumyadeepOSD avatar Mar 22 '23 06:03 SoumyadeepOSD

Hi team, It looks like we can close this issue, isnt it ? (it looks to me that way ) or am i missing something ?

sembooooo avatar May 01 '23 15:05 sembooooo

The original error still occurs: https://carbon.compiler-explorer.com/z/xessEd995

The correct behavior is that the array should be automatically sized to 3, matching the tuple size and similar to auto behavior.

jonmeow avatar May 01 '23 15:05 jonmeow

@jonmeow then isnt this a missing capability in the carbon ? If this is a missing carbon capability then is this appropriate to tag this as goodfirstissue ?

sembooooo avatar May 01 '23 15:05 sembooooo

Yes, we think the label is appropriate. (good first issues should be easy, but that doesn't mean they're going to be trivial)

jonmeow avatar May 01 '23 15:05 jonmeow