ballerina-platform / ballerina-library

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

CCE for xml text values with `regex` type in `data.xmldata` module #6974

Open SasinduDilshara opened 3 weeks ago

SasinduDilshara commented 3 weeks ago
import ballerina/data.xmldata;
import ballerina/io;

public function main() returns error? {
    record {string:RegExp \#content;}|error rec5 = xmldata:parseAsType(xml `<A>42</A>`);
    io:println(rec5);
}

This code gives

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