-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support alternate receive action #1277
Comments
For case 1, case 2 and case 3, do we need to omit the function case1() {
boolean foo = true;
worker w1 {
if foo {
10 -> w2;
} else {
20 -> w2;
}
}
worker w2 {
int|error:NoMessageError a = <- w1 | w1; // is enforcing NoMessageError here correct?
}
_ = wait {a: w1, b: w2};
} function case2() {
boolean foo = true;
worker w1 {
if foo {
10 -> w2;
}
20 -> w2;
}
worker w2 {
int|error:NoMessageError a = <- w1 | w1; // is enforcing NoMessageError here correct?
}
_ = wait {a: w1, b: w2};
} function case3() {
boolean foo = true;
boolean bar = true;
worker w1 {
if foo {
if bar {
10 -> w2;
} else {
20 -> w2;
}
} else {
if bar {
20 -> w2;
} else {
30 -> w2;
}
}
}
worker w2 {
int|error:NoMessageError a = <- w1 | w1 | w1 | w1; // is enforcing NoMessageError here correct?
}
_ = wait {a: w1, b: w2};
} function case4() {
boolean foo = true;
boolean bar = true;
worker w1 {
if foo {
10 -> w2;
}
if bar {
20 -> w2;
}
}
worker w2 {
int|error:NoMessageError a = <- w1 | w1; // OK here
}
_ = wait {a: w1, b: w2};
} |
|
I am just updating the issue with the current jBallerina behavior.
We enforce
We fixed this. |
The static type of alternative-receive-action isn't right in the spec at the moment. error:NoMessage is included if any of the alternate receives can fail, rather than if all of them can fail. Need to change the definition of failure type to handle this. Now fixed by 45f08c3 |
When send actions can be conditional #1273, it becomes useful to have an alternate-receive-action, analogous to the alternate-wait-action that already exists.
The text was updated successfully, but these errors were encountered: