You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function queryWithString2() returns error? {
stream<Book, error?> bookStream = [{ author: "Author 1", title: "Title 1" },
{author: "Author 2", title: "Title 2" }].toStream();
string strValue = check from Book _ in bookStream
select <string:Char> "a";
}
public function main() {
error? testQueryWithXmlResult2 = trap queryWithString2();
if (testQueryWithXmlResult2 is error) {
io:println(testQueryWithXmlResult2);
}
}
Gives
Compiling source
a.bal
WARNING [a.bal:(12:5,13:34)] unused variable 'strValue'
Running executable
[2023-03-30 10:45:00,661] SEVERE {b7a.log.crash} - class java.lang.String cannot be cast to class io.ballerina.runtime.api.values.BValue (java.lang.String is in module java.base of loader 'bootstrap'; io.ballerina.runtime.api.values.BValue is in unnamed module of loader 'app')
java.lang.ClassCastException: class java.lang.String cannot be cast to class io.ballerina.runtime.api.values.BValue (java.lang.String is in module java.base of loader 'bootstrap'; io.ballerina.runtime.api.values.BValue is in unnamed module of loader 'app')
at io.ballerina.runtime.internal.TypeChecker.getType(TypeChecker.java:367)
at io.ballerina.runtime.internal.ErrorUtils.createNumericConversionError(ErrorUtils.java:148)
at io.ballerina.runtime.internal.TypeConverter.stringToChar(TypeConverter.java:930)
at io.ballerina.runtime.internal.TypeConverter.anyToChar(TypeConverter.java:992)
at a.queryWithString2(a.bal:12)
at a.main(a.bal:17)
at $_init.$moduleExecute(.)
at $_init.$lambda$$moduleExecute$(.)
at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:306)
at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:273)
at java.base/java.lang.Thread.run(Thread.java:829)
Steps to Reproduce
No response
Affected Version(s)
No response
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered:
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.
Description
Gives
Steps to Reproduce
No response
Affected Version(s)
No response
OS, DB, other environment details and versions
No response
Related area
-> Compilation
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: