Skip to content

Commit

Permalink
Fix compiler test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
chamil321 committed May 17, 2021
1 parent d29a357 commit 0f0ef0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ service http:Service on new http:Listener(9090) {

resource function get callerInfo15(@http:CallerInfo {respondType: string} http:Caller abc) returns error? {
http:Client c = check new("path");
var a = c->get("done"); // different remote method call
http:Response|error a = c->get("done"); // different remote method call
if (a is error) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public class RespondExpressionVisitor extends NodeVisitor {

@Override
public void visit(RemoteMethodCallActionNode node) {
SimpleNameReferenceNode simpleNameReferenceNode = node.methodName();
if (!simpleNameReferenceNode.name().text().equals(Constants.RESPOND_METHOD_NAME)) {
return;
}
TypeSymbol typeSymbol = ctx.semanticModel().type(node.expression()).get();
ModuleID moduleID = typeSymbol.getModule().get().id();
if (!Constants.BALLERINA.equals(moduleID.orgName())) {
Expand All @@ -58,11 +62,8 @@ public void visit(RemoteMethodCallActionNode node) {
if (!callerToken.equals(node.expression().toString())) {
return;
}
SimpleNameReferenceNode simpleNameReferenceNode = node.methodName();
if (simpleNameReferenceNode.name().text().equals(Constants.RESPOND_METHOD_NAME)) {
if (node.arguments().size() > 0) {
respondStatementNodes.add((PositionalArgumentNode) node.arguments().get(0));
}
if (node.arguments().size() > 0) {
respondStatementNodes.add((PositionalArgumentNode) node.arguments().get(0));
}
}

Expand Down

0 comments on commit 0f0ef0c

Please sign in to comment.