ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

Using an undefined type in a service decl results in a misleading error message

Open pubudu91 opened this issue 3 years ago • 7 comments
trafficstars

Consider the following snippet:

import ballerina/http;

service modify on new http:Listener(9090) {
}

We get the following error messages for the above:

ERROR [2_simplify_response.bal:(2:1,4:2)] service declaration does not implement all required constructs of type: 'other'
ERROR [2_simplify_response.bal:(2:9,2:15)] unknown type 'modify'
ERROR [2_simplify_response.bal:(2:19,2:42)] service type is not supported by the listener

Do we need to be even running the type checking logic related to the first error message if the type is undefined? When working on the IDE and you hover over the error, this is the first one you see and it's kind of misleading since then you start wondering what needs to be implemented. Especially when the intention was to specify the path (i.e., /modify), not a typedesc.

pubudu91 avatar May 11 '22 11:05 pubudu91