Skip to content

Commit

Permalink
Add new diagnostic code for unsupported.alternative.wait.action
Browse files Browse the repository at this point in the history
  • Loading branch information
SasinduDilshara committed Oct 19, 2022
1 parent 83a0018 commit 1dba8da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public enum DiagnosticErrorCode implements DiagnosticCode {
"BCE4043", "module.generated.for.client.decl.must.have.a.client.object.type"),
MODULE_GENERATED_FOR_CLIENT_DECL_CANNOT_HAVE_MUTABLE_STATE(
"BCE4044", "module.generated.for.client.decl.cannot.have.mutable.state"),
ALTERNATIVE_WAIT_ACTION_NOT_SUPPORTED_IN_MULTIPLE_WAIT_EXPRESSION("BCE4035",
ALTERNATIVE_WAIT_ACTION_NOT_SUPPORTED_IN_MULTIPLE_WAIT_EXPRESSION("BCE4045",
"unsupported.alternative.wait.action.in.multiple.wait.expr")
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4621,8 +4621,7 @@ private void checkTypesForRecords(BLangWaitForAllExpr waitExpr, AnalyzerData dat
dlog.error(valueExpr.pos,
DiagnosticErrorCode.ALTERNATIVE_WAIT_ACTION_NOT_SUPPORTED_IN_MULTIPLE_WAIT_EXPRESSION);
data.resultType = symTable.semanticError;
}
else if (!lhsFields.containsKey(key)) {
} else if (!lhsFields.containsKey(key)) {
// Check if the field is sealed if so you cannot have dynamic fields
if (((BRecordType) Types.getReferredType(data.expType)).sealed) {
dlog.error(waitExpr.pos, DiagnosticErrorCode.INVALID_FIELD_NAME_RECORD_LITERAL, key, data.expType);
Expand Down

0 comments on commit 1dba8da

Please sign in to comment.