Skip to content
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]: The result of multiple-receive-action should be error:NoMessage if any of the recevie operations fail #42953

Open
lochana-chathura opened this issue Jun 19, 2024 · 0 comments
Labels
Spec/Different Implementation or runtime behavior is different from the spec. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@lochana-chathura
Copy link
Member

lochana-chathura commented Jun 19, 2024

Description

$subject.

In the multiple-receive-action section of the spec, it says,

If any of these receive operations fail, then the evaluation of the multiple-receive action completes normally with the result being a new value of type error:NoMessage, Otherwise, the evaluation completes normally with the result being a new record value, with one field for each receive-field, where the value of the field is the value received from the slot.

Consider the below sample,

public function main() {
   worker w1 {
       1 -> w3;
   }


   worker w2 {
       boolean b = true;
       if b {
           2 -> w3;
       }
   }


   worker w3 {
       map<int|error:NoMessage> m = <- {w1,w2}; // <--- [1]
   }


   wait w3;
}
  • Currently at [1], we are expecting map<int|error:NoMessage>. This should be corrected to map<int>|error:NoMessage.
  • Also, a record value is created at the moment in case of an error:NoMessage in at least one receive. Instead of a record, we need to create an error:NoMessage value.

Affected Version(s)

SL 2201.9.0 on

@lochana-chathura lochana-chathura added Type/Bug Spec/Different Implementation or runtime behavior is different from the spec. labels Jun 19, 2024
@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Jun 19, 2024
@lochana-chathura lochana-chathura added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime and removed needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spec/Different Implementation or runtime behavior is different from the spec. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants