Open
Description
Describe the bug
Cpp2 does not seem to be able to capture multiple return values.
To Reproduce
- Sample code: https://cpp2.godbolt.org/z/eW66nP4eq
f: () -> (a: int, b: int) = {
a = 1;
b = 2;
}
main: (args) -> int = {
i: int = 0;
j: int = 0;
// (i, j) = f(); // Option1: Parse error
// i ,j = f(); // Option2: Parse error
// {i, j} = f(); // Option3: Parse error
// (s: int, t: int) = f(); // Option4: Parse error
i = f(); // Obiously: Cpp compiler error
return 0;
}
-
Expected result:
I would expect that either option 1,2 or 3 works. -
Actual result/error
Option 1,2,3,4:
example.cpp2(6,23): error: ill-formed initializer (at '{')
example.cpp2(6,1): error: unexpected text at end of Cpp2 code section (at 'main')
example.cpp2(1,0): error: parse failed for section starting here
Additional context
I found this because I wanted to write a counterexample for #540