-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Assignment of multiple return values #543
Comments
See also |
Quick ack: Right, this isn't currently allowed but I intend it to be allowed. My current thought (which I almost implemented last month) was to allow this (possibly with parens)
with the semantics that it would lower to this
However, I'm thinking about the suggestions in #540 which could lead to a different meaning, so I'm glad I didn't implement it yet, to have time to think about this more. Similarly, there isn't yet a destructuring declaration syntax in Cpp2, and there will need to be (it's also on the list) and it should be consistent with the destructuring initialization/assignment syntax. |
Ok, thanks. I did a quick check but did not find anything with return values. What about option 4. Should this also be valid? With the approach of cpp2 to delay construction until the first assignment. It is actually not problem. If it is not allowed we would see something like this:
which is, in my opinion, quite ugly. Without the braces it would actually look quite natural:
Braces would help here to understand, that not only j is initialized. |
They want similar syntax for structured bindings,
|
Describe the bug
Cpp2 does not seem to be able to capture multiple return values.
To Reproduce
Expected result:
I would expect that either option 1,2 or 3 works.
Actual result/error
Option 1,2,3,4:
Additional context
I found this because I wanted to write a counterexample for #540
The text was updated successfully, but these errors were encountered: