closures without a return throws confusing error message

Description

throws

Can't cast String [] to a boolean on line 10

because there is no return value

https://trycf.com/gist/3467ff8f94d50088fd83aa0b5fa78caf/lucee5?theme=monokai

Environment

None

Activity

Zac Spitzer 
2 December 2020 at 11:49

perhaps a new function for casting the closure result to a Boolean which checks null and doesn’t cast it to a string, instead throwing a Closure didn’t return a Boolean value?

Pothys - MitrahSoft 
1 December 2020 at 16:09

I've checked this ticket with lucee latest version 5.3.8.117-SNAPSHOT also. Yes, the error message "Can't cast String [] to a boolean" is confusing when using structSome closure without a return. And same error throws for structEvery,arrayEvery,arraySome also.

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 1 December 2020 at 10:18
Updated 24 February 2021 at 03:53