[Bug]: Incorrect error diagnostic message when return result is not defined for a worker that expects a return value #42746
Labels
Area/Diagnostics
Issues related Diagnostics reported by the Compiler. #Compiler
good first issue
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Bug
userCategory/Compilation
Description
When a worker with a return type is defined, and nothing is being returned, the compiler gives the following error message,
It is incorrect because the structure in question is a worker and not a function. The error should be refactored into something similar to,
Steps to Reproduce
Compile the following code,
Affected Version(s)
Ballerina 2201.8.6 (Swan Lake Update 8)
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: