ballerina-lang
ballerina-lang copied to clipboard
Generate a proper object constructor expr for the return value in create function code action
trafficstars
Consider the following:
public function main() {
object {
string name;
int age;
} person = foo();
}
When using the create function code action for foo(), it generates the following:
function foo() returns object {string name;int age;} {
return object {};
}
Currently, for ease of implementation, we have simply made the return value object {}. Need to see if this can be improved to generate an object constructor expression which matches the return type of the function.