wso2 / ballerina-vscode

To keep Ballerina VSCode plugin related issues, discussions, etc.
Apache License 2.0
41 stars 20 forks source link

Data mapper doesn't work with optional field access #569

Open MaryamZi opened 1 month ago

MaryamZi commented 1 month ago

Description: $title.

Steps to reproduce:

type Person record {|
    string fName;
    string lName;
    int age?;
|};

type Employee record {|
    int id;
    string name;
    int? age;
|};

function transform(Person person) returns Employee => {
    id: 0,
    name: string `${person.fName} ${person.lName}`,
    age: person?.age
};

Screenshot from 2024-06-06 00-02-36

Affected Versions: Plugin v4.6.0