carbon-lang
carbon-lang copied to clipboard
var a: [i32;] = (i, i, i);
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!
I think here that mainly some features aren't yet implemented in the explorer. This is likely one of them.
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
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.
Filed as #1592 just to track it.
Ok I'll report tomorrow
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.
@Zhanytrix sir can you please assign me this issue wanna contribute on this.__
@ 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)
I want to work on this issue.Can you please assign me to this?
Hi team, It looks like we can close this issue, isnt it ? (it looks to me that way ) or am i missing something ?
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 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 ?
Yes, we think the label is appropriate. (good first issues should be easy, but that doesn't mean they're going to be trivial)