Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message for records with array fields in data.xmldata #6924

Closed
SasinduDilshara opened this issue Aug 27, 2024 · 1 comment · Fixed by ballerina-platform/module-ballerina-data.xmldata#45

Comments

@SasinduDilshara
Copy link
Contributor

SasinduDilshara commented Aug 27, 2024

Code

import ballerina/data.xmldata;
import ballerina/test;

xml x1 = xml `<A>42</A>`;

type A11 record {
    int[] \#content;
};

type A12 record {int[] \#content;};

type A13 record {|
    int[]|string...;
|};

public function main() {
    A11|error a11 = xmldata:parseAsType(x1);
    test:assertEquals(a11, {});
}

Output

error Error ("class java.lang.Long cannot be cast to class io.ballerina.runtime.
internal.values.ArrayValue (java.lang.Long is in module java.base of loader 'boo
tstrap'; io.ballerina.runtime.internal.values.ArrayValue is in unnamed module of
 loader 'app')")

This should be an error message that didn't reflect the internal details.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
1 participant