-
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Currently we cannot assign structure member directly with unrolled return value members, this is super annoying in case we introduce error handling, where we kinda expect the error value go to right catch block and other values go to the left. We should allow automatic unroll at least for functions returning two values, where error value should be "consumed" by catch block, leaving the rest for left-side expression.
foo :: fn () (s32, Error) {
return 1, OK;
}
Data :: struct {
a: s32;
}
main :: fn () s32 {
data: Data;
data.a = foo() catch panic($); // We have to use local temporary variable here.
return 0;
}
Metadata
Metadata
Assignees
Labels
No labels