Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Bradley W. / ()
Created: 09/24/2019
Components: Language, Closures
Versions: 2018
Failure Type: Crash
Found In Build/Fixed In Build: Update 5 / CF2018U6
Priority/Frequency: Normal / Some users will encounter
Locale/System: / Platforms All
Vote Count: 1
Problem Description:
Passing a fat arrow UDF into a BIF with no curly braces around the body causes a parsing error.
Steps to Reproduce:
{code:java}
myArr = [3,3,3]
writeDump( myArr.reduce( (acc,x) => acc+x, 0 ) )
{code}
Actual Result:
Parameter validation error for the reduce function. The function accepts 1 to 2 parameter(s).
Improper parsing of closure
Expected Result:
9
Any Workarounds:
Add curly braces to the function body like so:
myArr = [3,3,3]
writeDump( myArr.reduce( (acc,x) => { return acc+x }, 0 ) )
Attachments:
Comments: