ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

Invalid error message for `readonly` types with `parseString` API in `jsondata` module #7254

Closed SasinduDilshara closed 3 weeks ago

SasinduDilshara commented 1 month ago
import ballerina/data.jsondata;
import ballerina/io;

type User readonly & record {|
    int id;
|};

public isolated function main() returns error? {
    string user2 = string `{"id": 4012}`;
    User r2 = check jsondata:parseString(user2);
    io:println(r2.id);
}

This gives error: unsupported type '(readonly & record {| int id; |})'. This should be a valid usecase.

SasinduDilshara commented 1 month ago

Duplicate issue : #7253

It is different one. This issue is focused on the parseString API

github-actions[bot] commented 3 weeks ago

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.