Open
Description
Consider the snippet below:
public function foo(json|error data) returns json {
if (data is error) {
fail data;
} else {
return data;
}
}
The error given to the above is:
invalid usage of the 'fail' expression operator: no matching error return type(s) in the enclosing invokable
I don't think it's correct to call it the "fail
expression operator" seeing at it's a statement. Need to reword this error message to,
- Correct the terminology
- Convey what went wrong in a better way
Metadata
Metadata
Assignees
Labels
Internal tasks such as code cleanup, etc #CompilerIssues related Diagnostics reported by the Compiler. #CompilerOlder issues that are not being actively worked on but may be revisited in the future.All issues planned for Swan Lake GA releaseAll issues related to Language implementation and Compiler, this exclude run times.